diff options
author | Daniel Hahler <git@thequod.de> | 2018-10-31 16:20:44 +0100 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-01-20 00:34:16 +0100 |
commit | e69b1255d7bf765d1473e71814c35bb46f72d5b8 (patch) | |
tree | a9ba8d37de57545648145a18739b145464bbfff8 /src/_pytest/debugging.py | |
parent | 4947eb85c07e71059cca1ab0fd77579724e8247b (diff) | |
download | pytest-e69b1255d7bf765d1473e71814c35bb46f72d5b8.tar.gz |
Improve quitting from pdb
Regarding tests: it merges ``test_pdb_interaction``,
``test_pdb_print_captured_stdout``, and
``test_pdb_print_captured_stderr`` into
``test_pdb_print_captured_stdout_and_stderr`` (clarity and performance,
especially since pexpect tests are slow).
Diffstat (limited to 'src/_pytest/debugging.py')
-rw-r--r-- | src/_pytest/debugging.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index adf9d0e54..7a1060ae0 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -118,6 +118,10 @@ class pytestPDB(object): do_c = do_cont = do_continue + def set_quit(self): + super(_PdbWrapper, self).set_quit() + outcomes.exit("Quitting debugger") + def setup(self, f, tb): """Suspend on setup(). @@ -210,8 +214,7 @@ def _enter_pdb(node, excinfo, rep): tw.sep(">", "entering PDB") tb = _postmortem_traceback(excinfo) rep._pdbshown = True - if post_mortem(tb): - outcomes.exit("Quitting debugger") + post_mortem(tb) return rep @@ -242,4 +245,5 @@ def post_mortem(t): p = Pdb() p.reset() p.interaction(None, t) - return p.quitting + if p.quitting: + outcomes.exit("Quitting debugger") |