Skip to content

Commit fc0e024

Browse files
nicoddemuspytestbot
authored andcommitted
[7.1.x] Fix regendoc
1 parent 8f5088f commit fc0e024

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

doc/en/how-to/fixtures.rst

+9-5
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,10 @@ Note on finalizer order
742742
Finalizers are executed in a first-in-last-out order.
743743
For yield fixtures, the first teardown code to run is from the right-most fixture, i.e. the last test parameter.
744744

745-
.. regendoc:wipe
746745

747746
.. code-block:: python
748747
748+
# content of test_finalizers.py
749749
import pytest
750750
751751
@@ -767,12 +767,12 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur
767767
768768
.. code-block:: pytest
769769
770-
$ pytest test_module.py
770+
$ pytest -s test_finalizers.py
771771
=========================== test session starts ============================
772772
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
773773
collected 1 item
774774
775-
test_module.py test_bar
775+
test_finalizers.py test_bar
776776
.after_yield_2
777777
after_yield_1
778778
@@ -782,6 +782,8 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.
782782

783783
.. code-block:: python
784784
785+
# content of test_finalizers.py
786+
from functools import partial
785787
import pytest
786788
787789
@@ -797,12 +799,12 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.
797799
798800
.. code-block:: pytest
799801
800-
$ pytest test_module.py
802+
$ pytest -s test_finalizers.py
801803
=========================== test session starts ============================
802804
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
803805
collected 1 item
804806
805-
test_module.py test_bar
807+
test_finalizers.py test_bar
806808
.finalizer_1
807809
finalizer_2
808810
@@ -1412,6 +1414,8 @@ Running the above tests results in the following test IDs being used:
14121414
<Function test_showhelo[mail.python.org]>
14131415
<Module test_emaillib.py>
14141416
<Function test_email_received>
1417+
<Module test_finalizers.py>
1418+
<Function test_bar>
14151419
<Module test_ids.py>
14161420
<Function test_a[spam]>
14171421
<Function test_a[ham]>

0 commit comments

Comments
 (0)