From 66fa6bb42ed511fb7e3628a61233f050597fb913 Mon Sep 17 00:00:00 2001 From: Jeffrey Rackauckas Date: Sun, 1 Jul 2018 18:50:57 -0700 Subject: [PATCH] Fix flake8 issues. --- src/_pytest/debugging.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index d4c5747da..7d7bb0ad2 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -14,7 +14,10 @@ try: except ImportError: SUPPORTS_BREAKPOINT_BUILTIN = False + immediately_break = False + + def pytest_addoption(parser): group = parser.getgroup("general") group._addoption( @@ -73,7 +76,6 @@ def pytest_configure(config): config._cleanup.append(fin) - @hookimpl(hookwrapper=True) def pytest_pyfunc_call(pyfuncitem): if immediately_break: @@ -83,11 +85,13 @@ def pytest_pyfunc_call(pyfuncitem): if pyfuncitem._isyieldedfunction(): pyfuncitem.args = [testfunction, pyfuncitem._args] else: + if 'func' in pyfuncitem._fixtureinfo.argnames: + raise ValueError("--trace can't be used with a fixture named func!") pyfuncitem.funcargs['func'] = testfunction new_list = list(pyfuncitem._fixtureinfo.argnames) new_list.append('func') pyfuncitem._fixtureinfo.argnames = tuple(new_list) - outcome = yield + yield class pytestPDB(object):