Add proposed solution using a module function

This commit is contained in:
Raphael Pierzina 2016-06-25 10:50:14 +02:00
parent 84f0dcecf8
commit c6a711c2fc
1 changed files with 16 additions and 0 deletions

View File

@ -74,3 +74,19 @@ pytest version 3.0 and higher reports an error if you try to run above code::
Requested fixture 'extra_context'
Proposed solution
-----------------
A new function that can be used in modules can be used to dynamically define
fixtures from existing ones.
.. code-block:: python
pytest.define_combined_fixture(
name='context',
fixtures=['default_context', 'extra_context'],
)
The new fixture ``context`` inherits the scope from the used fixtures.