Update documentation on fixture being invoked more than once in a scope.
This commit is contained in:
1
changelog/4058.doc.rst
Normal file
1
changelog/4058.doc.rst
Normal file
@@ -0,0 +1 @@
|
||||
Update fixture documentation to specify that a fixture can be invoked twice in the scope it's defined for.
|
||||
@@ -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, it may need to be invoked more than once in the scope it's defined for.
|
||||
|
||||
|
||||
``package`` scope (experimental)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user