Skip to content

Commit 3558bad

Browse files
committed
fixture: Slate yield_fixture decorator for removal in pytest 10.
1 parent f1211ba commit 3558bad

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎changelog/14755.deprecation.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Schedule *yield_fixture* decorator for removal in pytest 10.

‎src/_pytest/deprecated.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
# This could have been removed pytest 8, but it's harmless and common, so no rush to remove.
32-
YIELD_FIXTURE = PytestDeprecationWarning(
32+
YIELD_FIXTURE = PytestRemovedIn10Warning(
3333
"@pytest.yield_fixture is deprecated.\n"
3434
"Use @pytest.fixture instead; they are the same."
3535
)

‎testing/deprecated_test.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from _pytest.pytester import Pytester
66
import pytest
77
from pytest import PytestDeprecationWarning
8+
from pytest import PytestRemovedIn10Warning
89

910

1011
@pytest.mark.parametrize("plugin", sorted(deprecated.DEPRECATED_EXTERNAL_PLUGINS))
@@ -66,7 +67,7 @@ def pytest_runtest_call(self):
6667

6768

6869
def test_yield_fixture_is_deprecated() -> None:
69-
with pytest.warns(DeprecationWarning, match=r"yield_fixture is deprecated"):
70+
with pytest.warns(PytestRemovedIn10Warning, match=r"yield_fixture is deprecated"):
7071

7172
@pytest.yield_fixture # type: ignore[deprecated]
7273
def fix():

0 commit comments

Comments
 (0)