Revert "Merge pull request #4854 from blueyed/pdb-skip"

This reverts commit e88aa957ae, reversing
changes made to 1410d3dc9a.

I do not think it warrants an option anymore, and there is a way to
achieve this via `--pdbcls` if needed.
This commit is contained in:
Daniel Hahler 2019-04-27 02:25:38 +02:00
parent 7f519f8ab7
commit 308b733b9d
3 changed files with 0 additions and 29 deletions

View File

@ -1,5 +0,0 @@
The ``--pdb-skip`` option can now be used to ignore calls to
``pdb.set_trace()`` (and ``pytest.set_trace()``).
This is meant to help while debugging, where you want to use e.g. ``--pdb`` or
``--trace`` only, or just run the tests again without any interruption.

View File

@ -46,13 +46,6 @@ def pytest_addoption(parser):
action="store_true",
help="Immediately break when running each test.",
)
group._addoption(
"--pdb-skip",
"--pdb-ignore-set_trace",
dest="pdb_ignore_set_trace",
action="store_true",
help="Ignore calls to pdb.set_trace().",
)
def _import_pdbcls(modname, classname):
@ -222,9 +215,6 @@ class pytestPDB(object):
@classmethod
def set_trace(cls, *args, **kwargs):
"""Invoke debugging via ``Pdb.set_trace``, dropping any IO capturing."""
if pytestPDB._config: # Might not be available when called directly.
if pytestPDB._config.getoption("pdb_ignore_set_trace"):
return
frame = sys._getframe().f_back
_pdb = cls._init_pdb(*args, **kwargs)
_pdb.set_trace(frame)

View File

@ -9,7 +9,6 @@ import sys
import _pytest._code
import pytest
from _pytest.debugging import _validate_usepdb_cls
from _pytest.main import EXIT_NOTESTSCOLLECTED
try:
breakpoint
@ -1123,19 +1122,6 @@ def test_pdb_suspends_fixture_capturing(testdir, fixture):
assert "> PDB continue (IO-capturing resumed for fixture %s) >" % (fixture) in rest
def test_pdb_skip_option(testdir):
p = testdir.makepyfile(
"""
print("before_set_trace")
__import__('pdb').set_trace()
print("after_set_trace")
"""
)
result = testdir.runpytest_inprocess("--pdb-ignore-set_trace", "-s", p)
assert result.ret == EXIT_NOTESTSCOLLECTED
result.stdout.fnmatch_lines(["*before_set_trace*", "*after_set_trace*"])
def test_pdbcls_via_local_module(testdir):
"""It should be imported in pytest_configure or later only."""
p1 = testdir.makepyfile(