]> granicus.if.org Git - python/commitdiff
Test assert if __debug__ is true.
authorGeorg Brandl <georg@python.org>
Sun, 29 Oct 2006 09:18:00 +0000 (09:18 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 29 Oct 2006 09:18:00 +0000 (09:18 +0000)
Lib/test/test_grammar.py

index 7d2ba377e70f3007a57e83fc4eb9b29b00ffacb9..26c93927983d086448dafb02f8a6db90586882a5 100644 (file)
@@ -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