Fix/revisit do_continue with regard to conditions
This commit is contained in:
parent
d406786a8d
commit
40718efacc
|
@ -146,22 +146,25 @@ class pytestPDB(object):
|
||||||
|
|
||||||
def do_continue(self, arg):
|
def do_continue(self, arg):
|
||||||
ret = super(_PdbWrapper, self).do_continue(arg)
|
ret = super(_PdbWrapper, self).do_continue(arg)
|
||||||
if self._pytest_capman:
|
if cls._recursive_debug == 0:
|
||||||
tw = _pytest.config.create_terminal_writer(cls._config)
|
tw = _pytest.config.create_terminal_writer(cls._config)
|
||||||
tw.line()
|
tw.line()
|
||||||
if cls._recursive_debug == 0:
|
if self._pytest_capman:
|
||||||
capturing = self._pytest_capman.is_capturing()
|
capturing = self._pytest_capman.is_capturing()
|
||||||
|
else:
|
||||||
|
capturing = False
|
||||||
|
if capturing:
|
||||||
if capturing == "global":
|
if capturing == "global":
|
||||||
tw.sep(">", "PDB continue (IO-capturing resumed)")
|
tw.sep(">", "PDB continue (IO-capturing resumed)")
|
||||||
elif capturing:
|
else:
|
||||||
tw.sep(
|
tw.sep(
|
||||||
">",
|
">",
|
||||||
"PDB continue (IO-capturing resumed for %s)"
|
"PDB continue (IO-capturing resumed for %s)"
|
||||||
% capturing,
|
% capturing,
|
||||||
)
|
)
|
||||||
|
self._pytest_capman.resume()
|
||||||
else:
|
else:
|
||||||
tw.sep(">", "PDB continue")
|
tw.sep(">", "PDB continue")
|
||||||
self._pytest_capman.resume()
|
|
||||||
cls._pluginmanager.hook.pytest_leave_pdb(
|
cls._pluginmanager.hook.pytest_leave_pdb(
|
||||||
config=cls._config, pdb=self
|
config=cls._config, pdb=self
|
||||||
)
|
)
|
||||||
|
|
|
@ -576,7 +576,8 @@ class TestPDB(object):
|
||||||
child.sendline("c")
|
child.sendline("c")
|
||||||
child.expect("LEAVING RECURSIVE DEBUGGER")
|
child.expect("LEAVING RECURSIVE DEBUGGER")
|
||||||
assert b"PDB continue" not in child.before
|
assert b"PDB continue" not in child.before
|
||||||
assert b"print_from_foo" in child.before
|
# No extra newline.
|
||||||
|
assert child.before.endswith(b"c\r\nprint_from_foo\r\n")
|
||||||
child.sendline("c")
|
child.sendline("c")
|
||||||
child.expect(r"PDB continue \(IO-capturing resumed\)")
|
child.expect(r"PDB continue \(IO-capturing resumed\)")
|
||||||
rest = child.read().decode("utf8")
|
rest = child.read().decode("utf8")
|
||||||
|
|
Loading…
Reference in New Issue