From fa3d4413e7df77cdca7228e18325d0e8efd0bbc3 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Tue, 30 Aug 2016 10:41:23 +0100 Subject: [PATCH] update test requirements requirements should be kept up to date to ensure we get bug fixes and new features as they come - particularly py.test, which we were running an 18 month old version for, and missing out on some useful xfail and fixture enhancements, among other things --- requirements_for_test.txt | 17 ++++++++--------- tests/conftest.py | 6 ++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/requirements_for_test.txt b/requirements_for_test.txt index 1ea6f7a8d..52f1665aa 100644 --- a/requirements_for_test.txt +++ b/requirements_for_test.txt @@ -1,11 +1,10 @@ -r requirements.txt -pep8==1.5.7 -pytest==2.8.3 -pytest-mock==0.8.1 -pytest-cov==2.2.0 +pep8==1.7.0 +pytest==3.0.1 +pytest-mock==1.2 +pytest-cov==2.3.1 coveralls==1.1 -mock==1.0.1 -moto==0.4.19 -flex==5.7.0 -freezegun==0.3.6 -requests-mock==0.7.0 +moto==0.4.25 +flex==5.8.0 +freezegun==0.3.7 +requests-mock==1.0.0 diff --git a/tests/conftest.py b/tests/conftest.py index cf1789d6e..122f4933b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -24,6 +24,12 @@ def notify_api(request): return app +@pytest.yield_fixture(scope='function') +def client(notify_api): + with notify_api.test_request_context(), notify_api.test_client() as client: + yield client + + @pytest.fixture(scope='session') def notify_db(notify_api, request): Migrate(notify_api, db)