diff options
Diffstat (limited to 'Lib/test/test_gdb.py')
| -rw-r--r-- | Lib/test/test_gdb.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index b5017b9..16fb389 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -89,7 +89,6 @@ if not gdbpy_version: # Verify that "gdb" can load our custom hooks, as OS security settings may # disallow this without a customised .gdbinit. -cmd = ['--args', sys.executable] _, gdbpy_errors = run_gdb('--args', sys.executable) if "auto-loading has been declined" in gdbpy_errors: msg = "gdb security settings prevent use of custom hooks: " @@ -171,8 +170,7 @@ class DebuggerTests(unittest.TestCase): # print commands # Use "commands" to generate the arguments with which to invoke "gdb": - args = ["gdb", "--batch", "-nx"] - args += ['--eval-command=%s' % cmd for cmd in commands] + args = ['--eval-command=%s' % cmd for cmd in commands] args += ["--args", sys.executable] @@ -820,25 +818,27 @@ id(42) "Python was compiled without thread support") def test_pycfunction(self): 'Verify that "py-bt" displays invocations of PyCFunction instances' - cmd = ('from time import sleep\n' + # Tested function must not be defined with METH_NOARGS or METH_O, + # otherwise call_function() doesn't call PyCFunction_Call() + cmd = ('from time import gmtime\n' 'def foo():\n' - ' sleep(1)\n' + ' gmtime(1)\n' 'def bar():\n' ' foo()\n' 'bar()\n') # Verify with "py-bt": gdb_output = self.get_stack_trace(cmd, - breakpoint='time_sleep', + breakpoint='time_gmtime', cmds_after_breakpoint=['bt', 'py-bt'], ) - self.assertIn('<built-in method sleep', gdb_output) + self.assertIn('<built-in method gmtime', gdb_output) # Verify with "py-bt-full": gdb_output = self.get_stack_trace(cmd, - breakpoint='time_sleep', + breakpoint='time_gmtime', cmds_after_breakpoint=['py-bt-full'], ) - self.assertIn('#0 <built-in method sleep', gdb_output) + self.assertIn('#0 <built-in method gmtime', gdb_output) class PyPrintTests(DebuggerTests): |
