summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-04 17:11:36 (GMT)
committerGeorg Brandl <georg@python.org>2010-12-04 17:11:36 (GMT)
commit34748cd6a86a423d4c0fd65af0834c8cfbb1db40 (patch)
treee471441cb7f28df1fce97c3e4c1450745d54f335 /Lib/test/test_pdb.py
parentf3fa5685e85f7aa21c124bb6a71a076f80666f2c (diff)
downloadcpython-34748cd6a86a423d4c0fd65af0834c8cfbb1db40.zip
cpython-34748cd6a86a423d4c0fd65af0834c8cfbb1db40.tar.gz
cpython-34748cd6a86a423d4c0fd65af0834c8cfbb1db40.tar.bz2
Fix test suite to not activate new sigint behavior in pdb.
Diffstat (limited to 'Lib/test/test_pdb.py')
-rw-r--r--Lib/test/test_pdb.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index a778c6c..d861df5 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -29,7 +29,7 @@ def test_pdb_displayhook():
"""This tests the custom displayhook for pdb.
>>> def test_function(foo, bar):
- ... import pdb; pdb.Pdb().set_trace()
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
... pass
>>> with PdbTestInput([
@@ -69,7 +69,7 @@ def test_pdb_basic_commands():
... return foo.upper()
>>> def test_function():
- ... import pdb; pdb.Pdb().set_trace()
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
... ret = test_function_2('baz')
... print(ret)
@@ -168,7 +168,7 @@ def test_pdb_breakpoint_commands():
"""Test basic commands related to breakpoints.
>>> def test_function():
- ... import pdb; pdb.Pdb().set_trace()
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
... print(1)
... print(2)
... print(3)
@@ -297,7 +297,7 @@ def test_list_commands():
... return foo
>>> def test_function():
- ... import pdb; pdb.Pdb().set_trace()
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
... ret = test_function_2('baz')
>>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
@@ -320,7 +320,7 @@ def test_list_commands():
-> ret = test_function_2('baz')
(Pdb) list
1 def test_function():
- 2 import pdb; pdb.Pdb().set_trace()
+ 2 import pdb; pdb.Pdb(nosigint=True).set_trace()
3 -> ret = test_function_2('baz')
[EOF]
(Pdb) step
@@ -383,7 +383,7 @@ def test_post_mortem():
... print('Exception!')
>>> def test_function():
- ... import pdb; pdb.Pdb().set_trace()
+ ... import pdb; pdb.Pdb(nosigint=True).set_trace()
... test_function_2()
... print('Not reached.')
@@ -416,7 +416,7 @@ def test_post_mortem():
-> 1/0
(Pdb) list
1 def test_function():
- 2 import pdb; pdb.Pdb().set_trace()
+ 2 import pdb; pdb.Pdb(nosigint=True).set_trace()
3 -> test_function_2()
4 print('Not reached.')
[EOF]
@@ -440,7 +440,7 @@ def test_pdb_skip_modules():
>>> def skip_module():
... import string
- ... import pdb; pdb.Pdb(skip=['stri*']).set_trace()
+ ... import pdb; pdb.Pdb(skip=['stri*'], nosigint=True).set_trace()
... string.capwords('FOO')
>>> with PdbTestInput([
@@ -469,7 +469,7 @@ def test_pdb_skip_modules_with_callback():
>>> def skip_module():
... def callback():
... return None
- ... import pdb; pdb.Pdb(skip=['module_to_skip*']).set_trace()
+ ... import pdb; pdb.Pdb(skip=['module_to_skip*'], nosigint=True).set_trace()
... mod.foo_pony(callback)
>>> with PdbTestInput([
@@ -510,7 +510,7 @@ def test_pdb_continue_in_bottomframe():
"""Test that "continue" and "next" work properly in bottom frame (issue #5294).
>>> def test_function():
- ... import pdb, sys; inst = pdb.Pdb()
+ ... import pdb, sys; inst = pdb.Pdb(nosigint=True)
... inst.set_trace()
... inst.botframe = sys._getframe() # hackery to get the right botframe
... print(1)
@@ -550,7 +550,8 @@ def test_pdb_continue_in_bottomframe():
def pdb_invoke(method, arg):
"""Run pdb.method(arg)."""
- import pdb; getattr(pdb, method)(arg)
+ import pdb
+ getattr(pdb.Pdb(nosigint=True), method)(arg)
def test_pdb_run_with_incorrect_argument():