diff options
author | Georg Brandl <georg@python.org> | 2006-10-29 09:18:00 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-10-29 09:18:00 (GMT) |
commit | facd273198689d9c083056e55fca95c1db348d0e (patch) | |
tree | 28c3877db1abf44bc632690fc0b8e35610d5f734 /Lib | |
parent | 3354f285b958bbe8fa99b0091fcd4335251dec71 (diff) | |
download | cpython-facd273198689d9c083056e55fca95c1db348d0e.zip cpython-facd273198689d9c083056e55fca95c1db348d0e.tar.gz cpython-facd273198689d9c083056e55fca95c1db348d0e.tar.bz2 |
Test assert if __debug__ is true.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_grammar.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 7d2ba37..26c9392 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -544,10 +544,9 @@ hello world assert 0, "msg" except AssertionError, e: self.assertEquals(e.args[0], "msg") - # we can not expect an assertion error to be raised - # if the tests are run in an optimized python - #else: - # self.fail("AssertionError not raised by assert 0") + else: + if __debug__: + self.fail("AssertionError not raised by assert 0") ### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef # Tested below |