Make yield_fixture just call fixture to do its work
Since fixture and yield_fixture are identical, they should call the same code; as it was, the code inside them was already starting to deviate.
This commit is contained in:
parent
c9a0881309
commit
f5165064ee
|
@ -1027,13 +1027,7 @@ def yield_fixture(scope="function", params=None, autouse=False, ids=None, name=N
|
|||
.. deprecated:: 3.0
|
||||
Use :py:func:`pytest.fixture` directly instead.
|
||||
"""
|
||||
if callable(scope) and params is None and not autouse:
|
||||
# direct decoration
|
||||
return FixtureFunctionMarker("function", params, autouse, ids=ids, name=name)(
|
||||
scope
|
||||
)
|
||||
else:
|
||||
return FixtureFunctionMarker(scope, params, autouse, ids=ids, name=name)
|
||||
return fixture(scope=scope, params=params, autouse=autouse, ids=ids, name=name)
|
||||
|
||||
|
||||
defaultfuncargprefixmarker = fixture()
|
||||
|
|
Loading…
Reference in New Issue