Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.1.x] Fix regendoc #10258

Merged
merged 1 commit into from Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions doc/en/how-to/fixtures.rst
Expand Up @@ -742,10 +742,10 @@ Note on finalizer order
Finalizers are executed in a first-in-last-out order.
For yield fixtures, the first teardown code to run is from the right-most fixture, i.e. the last test parameter.

.. regendoc:wipe

.. code-block:: python

# content of test_finalizers.py
import pytest


Expand All @@ -767,12 +767,12 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur

.. code-block:: pytest

$ pytest test_module.py
$ pytest -s test_finalizers.py
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
collected 1 item

test_module.py test_bar
test_finalizers.py test_bar
.after_yield_2
after_yield_1

Expand All @@ -782,6 +782,8 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.

.. code-block:: python

# content of test_finalizers.py
from functools import partial
import pytest


Expand All @@ -797,12 +799,12 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.

.. code-block:: pytest

$ pytest test_module.py
$ pytest -s test_finalizers.py
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
collected 1 item

test_module.py test_bar
test_finalizers.py test_bar
.finalizer_1
finalizer_2

Expand Down Expand Up @@ -1412,6 +1414,8 @@ Running the above tests results in the following test IDs being used:
<Function test_showhelo[mail.python.org]>
<Module test_emaillib.py>
<Function test_email_received>
<Module test_finalizers.py>
<Function test_bar>
<Module test_ids.py>
<Function test_a[spam]>
<Function test_a[ham]>
Expand Down