2013-09-30 19:42:39 +08:00
|
|
|
.. _yieldfixture:
|
2013-09-27 16:21:23 +08:00
|
|
|
|
2016-06-08 08:20:52 +08:00
|
|
|
"yield_fixture" functions
|
2013-09-27 16:21:23 +08:00
|
|
|
---------------------------------------------------------------
|
|
|
|
|
2016-06-08 07:59:58 +08:00
|
|
|
.. deprecated:: 2.10
|
|
|
|
|
2013-09-27 16:21:23 +08:00
|
|
|
.. versionadded:: 2.4
|
|
|
|
|
2016-06-08 07:59:58 +08:00
|
|
|
.. important::
|
|
|
|
Since pytest-2.10, fixtures using the normal ``fixture`` decorator can use a ``yield``
|
|
|
|
statement to provide fixture values and execute teardown code, exactly like ``yield_fixture``
|
2016-06-08 08:20:52 +08:00
|
|
|
in previous versions.
|
2016-06-08 07:59:58 +08:00
|
|
|
|
2016-06-08 08:20:52 +08:00
|
|
|
Marking functions as ``yield_fixture`` is still supported, but deprecated and should not
|
|
|
|
be used in new code.
|