diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-02-01 15:29:54 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-02-01 15:29:54 (GMT) |
commit | 611083331d534481ca7956a376e38fb0e9ef3854 (patch) | |
tree | d1832de21142eca8154a49e1a5db60664db7b106 /Lib/test/test_gdb.py | |
parent | c9473b838aabdf35ad97d82ee2091c3a6b939188 (diff) | |
download | cpython-611083331d534481ca7956a376e38fb0e9ef3854.zip cpython-611083331d534481ca7956a376e38fb0e9ef3854.tar.gz cpython-611083331d534481ca7956a376e38fb0e9ef3854.tar.bz2 |
python-gdb.py supports method-wrapper
Issue #29367: python-gdb.py now supports also method-wrapper (wrapperobject)
objects.
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r-- | Lib/test/test_gdb.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 557591f..247c3ad 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -3,13 +3,14 @@ # The code for testing gdb was adapted from similar work in Unladen Swallow's # Lib/test/test_jit_gdb.py +import locale import os import re import subprocess import sys import sysconfig +import textwrap import unittest -import locale # Is this Python configured to support threads? try: @@ -847,6 +848,24 @@ id(42) ) self.assertIn('#1 <built-in method gmtime', gdb_output) + @unittest.skipIf(python_is_optimized(), + "Python was compiled with optimizations") + def test_wrapper_call(self): + cmd = textwrap.dedent(''' + class MyList(list): + def __init__(self): + super().__init__() # wrapper_call() + + l = MyList() + ''') + # Verify with "py-bt": + gdb_output = self.get_stack_trace(cmd, + breakpoint='wrapper_call', + cmds_after_breakpoint=['py-bt'], + ) + self.assertIn("<method-wrapper '__init__' of MyList object at ", + gdb_output) + class PyPrintTests(DebuggerTests): @unittest.skipIf(python_is_optimized(), |