Skip to content

Pytest5 support #159

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

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/contrib/django/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/contrib/flask/test_flask_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/contrib/flask/test_flask_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/validation/test_read_only_write_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/validation/test_security_override.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/unmarshalling/test_unmarshal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down