Skip to content

Commit ca714a7

Browse files
committed
doc/how-to/fixtures: update usefixture on a fixture is now an error
1 parent fc2bdc7 commit ca714a7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

doc/en/how-to/fixtures.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,17 +1746,15 @@ into a configuration file:
17461746
17471747
.. warning::
17481748

1749-
Note this mark has no effect in **fixture functions**. For example,
1750-
this **will not work as expected**:
1749+
``@pytest.mark.usefixtures`` cannot be used on **fixture functions**. For example,
1750+
this is an error:
17511751

17521752
.. code-block:: python
17531753
17541754
@pytest.mark.usefixtures("my_other_fixture")
17551755
@pytest.fixture
17561756
def my_fixture_that_sadly_wont_use_my_other_fixture(): ...
17571757
1758-
This generates a deprecation warning, and will become an error in Pytest 8.
1759-
17601758
.. _`override fixtures`:
17611759

17621760
Overriding fixtures on various levels

0 commit comments

Comments
 (0)