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):