mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
Test assert if __debug__ is true.
This commit is contained in:
parent
3354f285b9
commit
facd273198
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue