diff --git a/test/testutils.py b/test/testutils.py index fd95c76dce9f2e3ca952fc38c4fcc5486dc46c84..fd4655a98e586938307c3a90f853e609b131da8b 100644 --- a/test/testutils.py +++ b/test/testutils.py @@ -45,6 +45,19 @@ class GanetiTestProgram(unittest.TestProgram): sys.stderr.write("Running %s\n" % self.progName) sys.stderr.flush() + # Ensure assertions will be evaluated + if not __debug__: + raise Exception("Not running in debug mode, assertions would not be" + " evaluated") + + # Check again, this time with a real assertion + try: + assert False + except AssertionError: + pass + else: + raise Exception("Assertion not evaluated") + return unittest.TestProgram.runTests(self)