mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
This commit is contained in:
parent
8551dd6078
commit
3661908a6a
70 changed files with 436 additions and 412 deletions
|
@ -71,3 +71,15 @@ def findfile(file, here=__file__):
|
|||
fn = os.path.join(dn, file)
|
||||
if os.path.exists(fn): return fn
|
||||
return file
|
||||
|
||||
def verify(condition, reason='test failed'):
|
||||
|
||||
""" Verify that condition is true. If not, raise an
|
||||
AssertionError.
|
||||
|
||||
The optinal argument reason can be given to provide
|
||||
a better error text.
|
||||
|
||||
"""
|
||||
if not condition:
|
||||
raise AssertionError,reason
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue