Revision a9b144cb
b/test/testutils.py | ||
---|---|---|
45 | 45 |
sys.stderr.write("Running %s\n" % self.progName) |
46 | 46 |
sys.stderr.flush() |
47 | 47 |
|
48 |
# Ensure assertions will be evaluated |
|
49 |
if not __debug__: |
|
50 |
raise Exception("Not running in debug mode, assertions would not be" |
|
51 |
" evaluated") |
|
52 |
|
|
53 |
# Check again, this time with a real assertion |
|
54 |
try: |
|
55 |
assert False |
|
56 |
except AssertionError: |
|
57 |
pass |
|
58 |
else: |
|
59 |
raise Exception("Assertion not evaluated") |
|
60 |
|
|
48 | 61 |
return unittest.TestProgram.runTests(self) |
49 | 62 |
|
50 | 63 |
|
Also available in: Unified diff