Commit 99fba2e1 authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Make it easier to compare and debug error testcase failures

parent 5f3824b8
...@@ -318,14 +318,22 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -318,14 +318,22 @@ class CythonCompileTestCase(unittest.TestCase):
sys.stderr = old_stderr sys.stderr = old_stderr
if errors or expected_errors: if errors or expected_errors:
for expected, error in zip(expected_errors, errors): try:
self.assertEquals(expected, error) for expected, error in zip(expected_errors, errors):
if len(errors) < len(expected_errors): self.assertEquals(expected, error)
expected_error = expected_errors[len(errors)] if len(errors) < len(expected_errors):
self.assertEquals(expected_error, None) expected_error = expected_errors[len(errors)]
elif len(errors) > len(expected_errors): self.assertEquals(expected_error, None)
unexpected_error = errors[len(expected_errors)] elif len(errors) > len(expected_errors):
self.assertEquals(None, unexpected_error) unexpected_error = errors[len(expected_errors)]
self.assertEquals(None, unexpected_error)
except AssertionError:
print("\n=== Expected errors: ===")
print('\n'.join(expected_errors))
print "\n\n=== Got errors: ==="
print('\n'.join(errors))
print('\n')
raise
else: else:
if not self.cython_only: if not self.cython_only:
self.run_distutils(module, workdir, incdir) self.run_distutils(module, workdir, incdir)
......
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