@@ -29,7 +29,7 @@ def test_pdb_displayhook():
2929 """This tests the custom displayhook for pdb.
3030
3131 >>> def test_function(foo, bar):
32- ... import pdb; pdb.Pdb().set_trace()
32+ ... import pdb; pdb.Pdb(nosigint=True ).set_trace()
3333 ... pass
3434
3535 >>> with PdbTestInput([
@@ -69,7 +69,7 @@ def test_pdb_basic_commands():
6969 ... return foo.upper()
7070
7171 >>> def test_function():
72- ... import pdb; pdb.Pdb().set_trace()
72+ ... import pdb; pdb.Pdb(nosigint=True ).set_trace()
7373 ... ret = test_function_2('baz')
7474 ... print(ret)
7575
@@ -168,7 +168,7 @@ def test_pdb_breakpoint_commands():
168168 """Test basic commands related to breakpoints.
169169
170170 >>> def test_function():
171- ... import pdb; pdb.Pdb().set_trace()
171+ ... import pdb; pdb.Pdb(nosigint=True ).set_trace()
172172 ... print(1)
173173 ... print(2)
174174 ... print(3)
@@ -297,7 +297,7 @@ def test_list_commands():
297297 ... return foo
298298
299299 >>> def test_function():
300- ... import pdb; pdb.Pdb().set_trace()
300+ ... import pdb; pdb.Pdb(nosigint=True ).set_trace()
301301 ... ret = test_function_2('baz')
302302
303303 >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
@@ -320,7 +320,7 @@ def test_list_commands():
320320 -> ret = test_function_2('baz')
321321 (Pdb) list
322322 1 def test_function():
323- 2 import pdb; pdb.Pdb().set_trace()
323+ 2 import pdb; pdb.Pdb(nosigint=True ).set_trace()
324324 3 -> ret = test_function_2('baz')
325325 [EOF]
326326 (Pdb) step
@@ -383,7 +383,7 @@ def test_post_mortem():
383383 ... print('Exception!')
384384
385385 >>> def test_function():
386- ... import pdb; pdb.Pdb().set_trace()
386+ ... import pdb; pdb.Pdb(nosigint=True ).set_trace()
387387 ... test_function_2()
388388 ... print('Not reached.')
389389
@@ -416,7 +416,7 @@ def test_post_mortem():
416416 -> 1/0
417417 (Pdb) list
418418 1 def test_function():
419- 2 import pdb; pdb.Pdb().set_trace()
419+ 2 import pdb; pdb.Pdb(nosigint=True ).set_trace()
420420 3 -> test_function_2()
421421 4 print('Not reached.')
422422 [EOF]
@@ -440,7 +440,7 @@ def test_pdb_skip_modules():
440440
441441 >>> def skip_module():
442442 ... import string
443- ... import pdb; pdb.Pdb(skip=['stri*']).set_trace()
443+ ... import pdb; pdb.Pdb(skip=['stri*'], nosigint=True ).set_trace()
444444 ... string.capwords('FOO')
445445
446446 >>> with PdbTestInput([
@@ -469,7 +469,7 @@ def test_pdb_skip_modules_with_callback():
469469 >>> def skip_module():
470470 ... def callback():
471471 ... return None
472- ... import pdb; pdb.Pdb(skip=['module_to_skip*']).set_trace()
472+ ... import pdb; pdb.Pdb(skip=['module_to_skip*'], nosigint=True ).set_trace()
473473 ... mod.foo_pony(callback)
474474
475475 >>> with PdbTestInput([
@@ -510,7 +510,7 @@ def test_pdb_continue_in_bottomframe():
510510 """Test that "continue" and "next" work properly in bottom frame (issue #5294).
511511
512512 >>> def test_function():
513- ... import pdb, sys; inst = pdb.Pdb()
513+ ... import pdb, sys; inst = pdb.Pdb(nosigint=True )
514514 ... inst.set_trace()
515515 ... inst.botframe = sys._getframe() # hackery to get the right botframe
516516 ... print(1)
@@ -550,7 +550,8 @@ def test_pdb_continue_in_bottomframe():
550550
551551def pdb_invoke (method , arg ):
552552 """Run pdb.method(arg)."""
553- import pdb ; getattr (pdb , method )(arg )
553+ import pdb
554+ getattr (pdb .Pdb (nosigint = True ), method )(arg )
554555
555556
556557def test_pdb_run_with_incorrect_argument ():
0 commit comments