Skip to content

Commit ac7ee40

Browse files
authored
Merge pull request #5173 from blueyed/revert
Revert "Merge pull request #4854 from blueyed/pdb-skip"
2 parents 76c6ed8 + 308b733 commit ac7ee40

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

changelog/4854.feature.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/_pytest/debugging.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ def pytest_addoption(parser):
4646
action="store_true",
4747
help="Immediately break when running each test.",
4848
)
49-
group._addoption(
50-
"--pdb-skip",
51-
"--pdb-ignore-set_trace",
52-
dest="pdb_ignore_set_trace",
53-
action="store_true",
54-
help="Ignore calls to pdb.set_trace().",
55-
)
5649

5750

5851
def _import_pdbcls(modname, classname):
@@ -222,9 +215,6 @@ def setup(self, f, tb):
222215
@classmethod
223216
def set_trace(cls, *args, **kwargs):
224217
"""Invoke debugging via ``Pdb.set_trace``, dropping any IO capturing."""
225-
if pytestPDB._config: # Might not be available when called directly.
226-
if pytestPDB._config.getoption("pdb_ignore_set_trace"):
227-
return
228218
frame = sys._getframe().f_back
229219
_pdb = cls._init_pdb(*args, **kwargs)
230220
_pdb.set_trace(frame)

testing/test_pdb.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import _pytest._code
1010
import pytest
1111
from _pytest.debugging import _validate_usepdb_cls
12-
from _pytest.main import EXIT_NOTESTSCOLLECTED
1312

1413
try:
1514
breakpoint
@@ -1123,19 +1122,6 @@ def test_inner({fixture}):
11231122
assert "> PDB continue (IO-capturing resumed for fixture %s) >" % (fixture) in rest
11241123

11251124

1126-
def test_pdb_skip_option(testdir):
1127-
p = testdir.makepyfile(
1128-
"""
1129-
print("before_set_trace")
1130-
__import__('pdb').set_trace()
1131-
print("after_set_trace")
1132-
"""
1133-
)
1134-
result = testdir.runpytest_inprocess("--pdb-ignore-set_trace", "-s", p)
1135-
assert result.ret == EXIT_NOTESTSCOLLECTED
1136-
result.stdout.fnmatch_lines(["*before_set_trace*", "*after_set_trace*"])
1137-
1138-
11391125
def test_pdbcls_via_local_module(testdir):
11401126
"""It should be imported in pytest_configure or later only."""
11411127
p1 = testdir.makepyfile(

0 commit comments

Comments
 (0)