Merge pull request #4070 from jeffreyrack/4058-update-fixture-docs
Update documentation to indicate a fixture can be invoked more than once in it's scope.
This commit is contained in:
commit
3f03625a5d
|
@ -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*.
|
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)
|
``package`` scope (experimental)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
Loading…
Reference in New Issue