2016-08-23 10:35:41 +08:00
|
|
|
:orphan:
|
|
|
|
|
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-07-13 08:02:40 +08:00
|
|
|
.. deprecated:: 3.0
|
2016-06-08 07:59:58 +08:00
|
|
|
|
2013-09-27 16:21:23 +08:00
|
|
|
.. versionadded:: 2.4
|
|
|
|
|
2016-06-08 07:59:58 +08:00
|
|
|
.. important::
|
2016-07-13 08:02:40 +08:00
|
|
|
Since pytest-3.0, fixtures using the normal ``fixture`` decorator can use a ``yield``
|
2016-06-08 07:59:58 +08:00
|
|
|
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.
|