Fix flake8 issues.

This commit is contained in:
Jeffrey Rackauckas 2018-07-01 18:50:57 -07:00
parent 713d32c4da
commit 66fa6bb42e
1 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,10 @@ try:
except ImportError: except ImportError:
SUPPORTS_BREAKPOINT_BUILTIN = False SUPPORTS_BREAKPOINT_BUILTIN = False
immediately_break = False immediately_break = False
def pytest_addoption(parser): def pytest_addoption(parser):
group = parser.getgroup("general") group = parser.getgroup("general")
group._addoption( group._addoption(
@ -73,7 +76,6 @@ def pytest_configure(config):
config._cleanup.append(fin) config._cleanup.append(fin)
@hookimpl(hookwrapper=True) @hookimpl(hookwrapper=True)
def pytest_pyfunc_call(pyfuncitem): def pytest_pyfunc_call(pyfuncitem):
if immediately_break: if immediately_break:
@ -83,11 +85,13 @@ def pytest_pyfunc_call(pyfuncitem):
if pyfuncitem._isyieldedfunction(): if pyfuncitem._isyieldedfunction():
pyfuncitem.args = [testfunction, pyfuncitem._args] pyfuncitem.args = [testfunction, pyfuncitem._args]
else: else:
if 'func' in pyfuncitem._fixtureinfo.argnames:
raise ValueError("--trace can't be used with a fixture named func!")
pyfuncitem.funcargs['func'] = testfunction pyfuncitem.funcargs['func'] = testfunction
new_list = list(pyfuncitem._fixtureinfo.argnames) new_list = list(pyfuncitem._fixtureinfo.argnames)
new_list.append('func') new_list.append('func')
pyfuncitem._fixtureinfo.argnames = tuple(new_list) pyfuncitem._fixtureinfo.argnames = tuple(new_list)
outcome = yield yield
class pytestPDB(object): class pytestPDB(object):