Reviewed wording about yield being a "new" feature
--HG-- branch : yield-experimental-docs
This commit is contained in:
parent
c1b935adbd
commit
30260361dd
|
@ -11,7 +11,7 @@ pytest-2.4 allows fixture functions to seamlessly use a ``yield`` instead
|
||||||
of a ``return`` statement to provide a fixture value while otherwise
|
of a ``return`` statement to provide a fixture value while otherwise
|
||||||
fully supporting all other fixture features.
|
fully supporting all other fixture features.
|
||||||
|
|
||||||
Let's look at a simple standalone-example using the new ``yield`` syntax::
|
Let's look at a simple standalone-example using the ``yield`` syntax::
|
||||||
|
|
||||||
# content of test_yield.py
|
# content of test_yield.py
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@ The file ``f`` will be closed after the test finished execution
|
||||||
because the Python ``file`` object supports finalization when
|
because the Python ``file`` object supports finalization when
|
||||||
the ``with`` statement ends.
|
the ``with`` statement ends.
|
||||||
|
|
||||||
Note that the new syntax is fully integrated with using ``scope``,
|
Note that the yield fixture form supports all other fixture
|
||||||
``params`` and other fixture features. Changing existing
|
features such as ``scope``, ``params``, etc., thus changing existing
|
||||||
fixture functions to use ``yield`` is thus straight forward.
|
fixture functions to use ``yield`` is straight forward.
|
||||||
|
|
||||||
Discussion and future considerations / feedback
|
Discussion and future considerations / feedback
|
||||||
++++++++++++++++++++++++++++++++++++++++++++++++++++
|
++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
Loading…
Reference in New Issue