Apply suggestions from code review
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
This commit is contained in:
parent
4cd95eeabf
commit
45f1a462d5
|
@ -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`:
|
||||
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
Loading…
Reference in New Issue