Commit b648b65a authored by Jeroen Demeyer's avatar Jeroen Demeyer Committed by Stefan Behnel

Always enable C line in traceback for tests (GH-3098)

parent 47f39d56
...@@ -1096,6 +1096,11 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -1096,6 +1096,11 @@ class CythonCompileTestCase(unittest.TestCase):
from Cython.Build.Dependencies import update_pythran_extension from Cython.Build.Dependencies import update_pythran_extension
update_pythran_extension(extension) update_pythran_extension(extension)
# Compile with -DCYTHON_CLINE_IN_TRACEBACK=1 unless we have
# the "traceback" tag
if 'traceback' not in self.tags['tag']:
extension.define_macros.append(("CYTHON_CLINE_IN_TRACEBACK", 1))
for matcher, fixer in list(EXT_EXTRAS.items()): for matcher, fixer in list(EXT_EXTRAS.items()):
if isinstance(matcher, str): if isinstance(matcher, str):
# lazy init # lazy init
......
import traceback # tag: traceback
def foo1(): def foo1():
foo2() foo2()
...@@ -21,6 +21,7 @@ def test_traceback(cline_in_traceback=None): ...@@ -21,6 +21,7 @@ def test_traceback(cline_in_traceback=None):
try: try:
foo1() foo1()
except: except:
import traceback
tb_string = traceback.format_exc() tb_string = traceback.format_exc()
expected = ( expected = (
'tracebacks.pyx', 'tracebacks.pyx',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment