|
7 | 7 | from pprint import pprint |
8 | 8 |
|
9 | 9 | import pytest |
| 10 | +from process_tests import TestProcess |
| 11 | +from process_tests import dump_on_error |
| 12 | +from process_tests import wait_for_strings |
10 | 13 |
|
11 | 14 | from hunter import Backlog |
12 | 15 | from hunter import CallPrinter |
|
22 | 25 | from hunter import trace |
23 | 26 | from hunter import wrap |
24 | 27 |
|
| 28 | +from utils import TIMEOUT |
25 | 29 | from utils import DebugCallPrinter |
26 | 30 |
|
27 | 31 | try: |
@@ -763,3 +767,16 @@ def test_backlog_subprocess(LineMatcher): |
763 | 767 | "depth=5 calls=16 *sample7args.py:34 line return i # five", |
764 | 768 | "depth=4 calls=16 *sample7args.py:34 return <= five: 0", |
765 | 769 | ]) |
| 770 | + |
| 771 | + |
| 772 | +@pytest.mark.parametrize('pdb', ['pdb', 'ipdb']) |
| 773 | +@pytest.mark.parametrize('mode', ['postmortem', 'settrace', 'debugger']) |
| 774 | +def test_pdb(LineMatcher, pdb, mode): |
| 775 | + with TestProcess('python', '-msamplepdb', pdb, mode, stdin=subprocess.PIPE) as target, dump_on_error(target.read): |
| 776 | + wait_for_strings(target.read, TIMEOUT, '-> ') |
| 777 | + target.proc.stdin.write('c\n') |
| 778 | + output = target.read() |
| 779 | + assert 'TypeError' not in output |
| 780 | + assert "'NoneType' object is not callable" not in output |
| 781 | + assert 'Disabling tracer because handler' not in output |
| 782 | + assert 'Traceback (most recent call last)' not in output |
0 commit comments