Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure pytest and test healthcheck #11

Merged
merged 3 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ RUN apt-get update \
&& apt-get install -qq --no-install-recommends curl git jq ssh \
&& python -m pip install --upgrade pip

RUN pip install --no-cache-dir flake8 debugpy pre-commit
RUN pip install --no-cache-dir flake8 debugpy pre-commit coverage pytest
Empty file added tests/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest

from app import app as server

@pytest.fixture
def app():
yield server

@pytest.fixture
def client(app):
return app.test_client()
4 changes: 4 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def test_healthcheck(app, client):
response = client.get('/healthcheck')
assert response.status_code == 200
assert response.data == b"Healthy"