diff --git a/requirements_dev.txt b/requirements_dev.txt index e5d462ef..966e8693 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,7 +1,7 @@ mock==2.0.0 -pytest==3.5.0 +pytest~=6.0 pytest-flake8 -pytest-cov==2.5.1 +pytest-cov~=2.12 falcon==2.0.0; python_version<"3.0" falcon==3.0.0; python_version>="3.0" flask diff --git a/setup.cfg b/setup.cfg index 4936a19d..786ce5a0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,7 @@ install_requires = backports.functools-partialmethod; python_version<"3.0" tests_require = mock; python_version<"3.0" - pytest + pytest~=6.0 pytest-flake8 pytest-cov falcon diff --git a/tests/integration/contrib/django/conftest.py b/tests/integration/contrib/django/conftest.py index ce5074b3..090fbbcc 100644 --- a/tests/integration/contrib/django/conftest.py +++ b/tests/integration/contrib/django/conftest.py @@ -4,7 +4,7 @@ import sys -@pytest.yield_fixture(autouse=True, scope='module') +@pytest.fixture(autouse=True, scope='module') def django_setup(): directory = os.path.abspath(os.path.dirname(__file__)) django_project_dir = os.path.join(directory, 'data') diff --git a/tests/integration/contrib/falcon/test_falcon_middlewares.py b/tests/integration/contrib/falcon/test_falcon_middlewares.py index cbfce002..a6bc28d3 100644 --- a/tests/integration/contrib/falcon/test_falcon_middlewares.py +++ b/tests/integration/contrib/falcon/test_falcon_middlewares.py @@ -26,7 +26,7 @@ def middleware(self, spec): def app(self, middleware): return App(middleware=[middleware]) - @pytest.yield_fixture + @pytest.fixture def client(self, app): return TestClient(app) diff --git a/tests/integration/contrib/flask/test_flask_decorator.py b/tests/integration/contrib/flask/test_flask_decorator.py index 6e6c899c..95ab8641 100644 --- a/tests/integration/contrib/flask/test_flask_decorator.py +++ b/tests/integration/contrib/flask/test_flask_decorator.py @@ -26,7 +26,7 @@ def app(self): app.config['TESTING'] = True return app - @pytest.yield_fixture + @pytest.fixture def client(self, app): with app.test_client() as client: with app.app_context(): diff --git a/tests/integration/contrib/flask/test_flask_views.py b/tests/integration/contrib/flask/test_flask_views.py index 2933e505..ddc5d1d1 100644 --- a/tests/integration/contrib/flask/test_flask_views.py +++ b/tests/integration/contrib/flask/test_flask_views.py @@ -21,7 +21,7 @@ def app(self): app.config['TESTING'] = True return app - @pytest.yield_fixture + @pytest.fixture def client(self, app): with app.test_client() as client: with app.app_context(): diff --git a/tests/integration/validation/test_read_only_write_only.py b/tests/integration/validation/test_read_only_write_only.py index 08cc6892..6a609243 100644 --- a/tests/integration/validation/test_read_only_write_only.py +++ b/tests/integration/validation/test_read_only_write_only.py @@ -19,7 +19,7 @@ def request_validator(spec): return RequestValidator(spec) -@pytest.fixture('class') +@pytest.fixture(scope='class') def spec(factory): spec_dict = factory.spec_from_file("data/v3.0/read_only_write_only.yaml") return create_spec(spec_dict) diff --git a/tests/integration/validation/test_security_override.py b/tests/integration/validation/test_security_override.py index 370012c1..70042d0b 100644 --- a/tests/integration/validation/test_security_override.py +++ b/tests/integration/validation/test_security_override.py @@ -14,7 +14,7 @@ def request_validator(spec): return RequestValidator(spec) -@pytest.fixture('class') +@pytest.fixture(scope='class') def spec(factory): spec_dict = factory.spec_from_file("data/v3.0/security_override.yaml") return create_spec(spec_dict) diff --git a/tests/unit/unmarshalling/test_unmarshal.py b/tests/unit/unmarshalling/test_unmarshal.py index ed987890..4b38d67f 100644 --- a/tests/unit/unmarshalling/test_unmarshal.py +++ b/tests/unit/unmarshalling/test_unmarshal.py @@ -302,9 +302,7 @@ def test_string_format_invalid_value(self, unmarshaller_factory): with pytest.raises( FormatterNotFoundError, - message=( - 'Formatter not found for custom format' - ), + match='Formatter not found for custom format', ): unmarshaller_factory(schema)(value)