Skip to content

Commit a9bbfb8

Browse files
authored
Merge pull request #10252 from nicoddemus/fix-regendoc
Fix regendoc
2 parents 4b77638 + 1caa099 commit a9bbfb8

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
@@ -744,10 +744,10 @@ Note on finalizer order
744744
Finalizers are executed in a first-in-last-out order.
745745
For yield fixtures, the first teardown code to run is from the right-most fixture, i.e. the last test parameter.
746746

747-
.. regendoc:wipe
748747

749748
.. code-block:: python
750749
750+
# content of test_finalizers.py
751751
import pytest
752752
753753
@@ -769,12 +769,12 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur
769769
770770
.. code-block:: pytest
771771
772-
$ pytest test_module.py
772+
$ pytest -s test_finalizers.py
773773
=========================== test session starts ============================
774774
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
775775
collected 1 item
776776
777-
test_module.py test_bar
777+
test_finalizers.py test_bar
778778
.after_yield_2
779779
after_yield_1
780780
@@ -784,6 +784,8 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.
784784

785785
.. code-block:: python
786786
787+
# content of test_finalizers.py
788+
from functools import partial
787789
import pytest
788790
789791
@@ -799,12 +801,12 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.
799801
800802
.. code-block:: pytest
801803
802-
$ pytest test_module.py
804+
$ pytest -s test_finalizers.py
803805
=========================== test session starts ============================
804806
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
805807
collected 1 item
806808
807-
test_module.py test_bar
809+
test_finalizers.py test_bar
808810
.finalizer_1
809811
finalizer_2
810812
@@ -1416,6 +1418,8 @@ Running the above tests results in the following test IDs being used:
14161418
<Function test_showhelo[mail.python.org]>
14171419
<Module test_emaillib.py>
14181420
<Function test_email_received>
1421+
<Module test_finalizers.py>
1422+
<Function test_bar>
14191423
<Module test_ids.py>
14201424
<Function test_a[spam]>
14211425
<Function test_a[ham]>

0 commit comments

Comments
 (0)