Fix --trace option with yield tests.

This commit is contained in:
Jeffrey Rackauckas 2018-07-02 19:08:41 -07:00
parent bc268a58d1
commit b75320ba95
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ def pytest_pyfunc_call(pyfuncitem):
testfunction = pyfuncitem.obj testfunction = pyfuncitem.obj
pyfuncitem.obj = pdb.runcall pyfuncitem.obj = pdb.runcall
if pyfuncitem._isyieldedfunction(): if pyfuncitem._isyieldedfunction():
pyfuncitem.args = [testfunction, pyfuncitem._args] pyfuncitem._args = [testfunction, *pyfuncitem._args]
else: else:
if "func" in pyfuncitem._fixtureinfo.argnames: if "func" in pyfuncitem._fixtureinfo.argnames:
raise ValueError("--trace can't be used with a fixture named func!") raise ValueError("--trace can't be used with a fixture named func!")