From 0b704779309332de3937bfa94eb3eb0b43b055c3 Mon Sep 17 00:00:00 2001 From: Jeffrey Rackauckas Date: Sun, 1 Jul 2018 20:18:00 -0700 Subject: [PATCH] Fix linting issues. --- changelog/3610.feature.rst | 2 +- doc/en/usage.rst | 2 +- src/_pytest/debugging.py | 6 +++--- testing/test_pdb.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/changelog/3610.feature.rst b/changelog/3610.feature.rst index 546f2be56..fd044b4b2 100644 --- a/changelog/3610.feature.rst +++ b/changelog/3610.feature.rst @@ -1 +1 @@ -Added the `--trace` option to enter the debugger at the start of a test. \ No newline at end of file +Added the `--trace` option to enter the debugger at the start of a test. diff --git a/doc/en/usage.rst b/doc/en/usage.rst index 83e7bd158..a5418df22 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -174,7 +174,7 @@ for example:: .. _trace-option: Dropping to PDB_ (Python Debugger) at the start of a test ------------------------------------------------ +---------------------------------------------------------- ``pytest`` allows one to drop into the PDB_ prompt immediately at the start of each test via a command line option:: diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index 7d7bb0ad2..cf21cb6c4 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -85,11 +85,11 @@ def pytest_pyfunc_call(pyfuncitem): if pyfuncitem._isyieldedfunction(): pyfuncitem.args = [testfunction, pyfuncitem._args] 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!") - pyfuncitem.funcargs['func'] = testfunction + pyfuncitem.funcargs["func"] = testfunction new_list = list(pyfuncitem._fixtureinfo.argnames) - new_list.append('func') + new_list.append("func") pyfuncitem._fixtureinfo.argnames = tuple(new_list) yield diff --git a/testing/test_pdb.py b/testing/test_pdb.py index c7f542c26..dab8b28c4 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -697,7 +697,7 @@ class TestDebuggingBreakpoints(object): assert "reading from stdin while output" not in rest TestPDB.flush(child) -class TestTraceOption(): +class TestTraceOption: def test_trace_sets_breakpoint(self, testdir): p1 = testdir.makepyfile( """ @@ -712,4 +712,4 @@ class TestTraceOption(): rest = child.read().decode("utf8") assert "1 passed" in rest assert "reading from stdin while output" not in rest - TestPDB.flush(child) \ No newline at end of file + TestPDB.flush(child)