Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/4058.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update fixture documentation to specify that a fixture can be invoked twice in the scope it's defined for.
5 changes: 5 additions & 0 deletions doc/en/fixture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ instance, you can simply declare it:

Finally, the ``class`` scope will invoke the fixture once per test *class*.

.. note::

Pytest will only cache one instance of a fixture at a time.
This means that when using a parametrized fixture, pytest may invoke a fixture more than once in the given scope.


``package`` scope (experimental)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down