Commit 96e2c88b authored by Robert Bradshaw's avatar Robert Bradshaw

Fail test when expected C compiler error not encountered.

parent a72e23ea
...@@ -869,9 +869,14 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -869,9 +869,14 @@ class CythonCompileTestCase(unittest.TestCase):
if not self.cython_only: if not self.cython_only:
try: try:
so_path = self.run_distutils(test_directory, module, workdir, incdir) so_path = self.run_distutils(test_directory, module, workdir, incdir)
except: compiled = True
except Exception:
compiled = False
if expected_errors != '_FAIL_C_COMPILE': if expected_errors != '_FAIL_C_COMPILE':
raise raise
if compiled and expected_errors == '_FAIL_C_COMPILE':
# must raise this outside the try block
raise RuntimeError('should have failed C compile')
return so_path return so_path
class CythonRunTestCase(CythonCompileTestCase): class CythonRunTestCase(CythonCompileTestCase):
......
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