Apply suggestions from code review

Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
This commit is contained in:
Thomas Grainger 2023-06-25 16:08:53 +01:00 committed by GitHub
parent 4cd95eeabf
commit 45f1a462d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -1752,7 +1752,7 @@ into an ini-file:
def my_fixture_that_sadly_wont_use_my_other_fixture():
...
Currently this will generate a deprecation warning.
This generates a deprecation warning, and will become an error in Pytest 8.
.. _`override fixtures`:

View File

@ -122,7 +122,7 @@ HOOK_LEGACY_MARKING = UnformattedWarning(
"#configuring-hook-specs-impls-using-markers",
)
MARKED_FIXTURE = PytestDeprecationWarning(
MARKED_FIXTURE = PytestRemovedIn8Warning(
"Marks applied to fixtures have no effect\n"
"See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function"
)

View File

@ -284,7 +284,7 @@ def test_importing_instance_is_deprecated(pytester: Pytester) -> None:
def test_fixture_disallow_on_marked_functions():
"""Test that applying @pytest.fixture to a marked function warns (#3364)."""
with pytest.warns(
pytest.PytestDeprecationWarning,
pytest.PytestRemovedIn8Warning,
match=r"Marks applied to fixtures have no effect",
) as record:
@ -303,7 +303,7 @@ def test_fixture_disallow_on_marked_functions():
def test_fixture_disallow_marks_on_fixtures():
"""Test that applying a mark to a fixture warns (#3364)."""
with pytest.warns(
pytest.PytestDeprecationWarning,
pytest.PytestRemovedIn8Warning,
match=r"Marks applied to fixtures have no effect",
) as record:
@ -319,7 +319,7 @@ def test_fixture_disallow_marks_on_fixtures():
def test_fixture_disallowed_between_marks():
"""Test that applying a mark to a fixture warns (#3364)."""
with pytest.warns(
pytest.PytestDeprecationWarning,
pytest.PytestRemovedIn8Warning,
match=r"Marks applied to fixtures have no effect",
) as record: