From 2be1079d1813767b0ff1df5f29e503f57defde2e Mon Sep 17 00:00:00 2001 From: Denis Yakovlev Date: Fri, 13 Mar 2020 20:10:49 +0700 Subject: [PATCH] #7 fix pytest due to https://github.com/pytest-dev/pytest/issues/6909 --- README.md | 5 +++++ ci/test_requirements.txt | 10 +++++----- requirements.txt | 22 +++++++++++----------- tests/conftest.py | 5 ++++- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 747d6fb..e54b1db 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,8 @@ Create migration: Run upgrade: `PYTHONPATH=.. alembic upgrade head` + +Run tests: +``` +docker build -t family-service-base-img . && docker-compose -f ci/docker-compose.yml run tests +``` \ No newline at end of file diff --git a/ci/test_requirements.txt b/ci/test_requirements.txt index 2b95e11..58b5b08 100644 --- a/ci/test_requirements.txt +++ b/ci/test_requirements.txt @@ -1,5 +1,5 @@ -pytest -pytest-aiohttp -pytest-factoryboy -pytest-html -pylint +pytest~=5.3.5 +pytest-aiohttp~=0.3.0 +pytest-factoryboy~=2.0.3 +pytest-html~=2.1.0 +pylint~=2.4.4 diff --git a/requirements.txt b/requirements.txt index 06a5169..bcda908 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ -aiohttp -aiohttp-apispec -aiohttp_jwt -aiopg -alembic -cryptography -factory-boy -marshmallow -PyYAML -python-dotenv -sqlalchemy +aiohttp~=3.6.2 +aiohttp-apispec~=2.2.1 +aiohttp-jwt~=0.5.0 +aiopg~=1.0.0 +alembic~=1.4.1 +cryptography~=2.8 +factory-boy~=2.12.0 +marshmallow~=3.5.1 +PyYAML~=5.3 +python-dotenv~=0.12.0 +SQLAlchemy~=1.3.15 diff --git a/tests/conftest.py b/tests/conftest.py index a71ace4..a32e373 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -50,7 +50,10 @@ async def app(): if table.name not in exclude_tables: await conn.execute(table.delete()) - return app + yield app + + await app.shutdown() + await app.cleanup() @pytest.fixture