From fe17af96655e7ab0310acf84571eeda34a0e87de Mon Sep 17 00:00:00 2001 From: Mark Florisson Date: Tue, 25 Jan 2011 22:43:52 +0100 Subject: [PATCH] Debugger: Fix backtrace test -- don't check for main() --- .../Debugger/Tests/test_libcython_in_gdb.py | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Cython/Debugger/Tests/test_libcython_in_gdb.py b/Cython/Debugger/Tests/test_libcython_in_gdb.py index 6003be08..738324ef 100644 --- a/Cython/Debugger/Tests/test_libcython_in_gdb.py +++ b/Cython/Debugger/Tests/test_libcython_in_gdb.py @@ -283,21 +283,20 @@ class TestBacktrace(DebugTestCase): libcython.parameters.colorize_code.value = False self.break_and_run('os.path.join("foo", "bar")') - result = gdb.execute('cy bt', to_string=True) - - _debug(libpython.execute, libpython._execute, gdb.execute) - _debug(gdb.execute('cy list', to_string=True)) - _debug(repr(result)) - assert re.search(r'\#\d+ *0x.* in spam\(\) at .*codefile\.pyx:22', - result), result - assert 'os.path.join("foo", "bar")' in result, result + def match_backtrace_output(result): + assert re.search(r'\#\d+ *0x.* in spam\(\) at .*codefile\.pyx:22', + result), result + assert 'os.path.join("foo", "bar")' in result, result - gdb.execute("cy step") + result = gdb.execute('cy bt', to_string=True) + match_backtrace_output(result) - gdb.execute('cy bt') result = gdb.execute('cy bt -a', to_string=True) - assert re.search(r'\#0 *0x.* in main\(\)', result), result + match_backtrace_output(result) + + # Apparently not everyone has main() + # assert re.search(r'\#0 *0x.* in main\(\)', result), result class TestFunctions(DebugTestCase): -- 2.26.2