mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Change verify() function to raise TestFailed, not AssertionError.
(I realize that I didn't really test this, because all the tests succeed, so verify() never raised an AssertionError -- but the test suite still succeeds, so I'm not too worried.)
This commit is contained in:
parent
e7c87327b3
commit
a1374e429b
2 changed files with 8 additions and 8 deletions
|
@ -71,11 +71,11 @@ def findfile(file, here=__file__):
|
|||
return file
|
||||
|
||||
def verify(condition, reason='test failed'):
|
||||
"""Verify that condition is true. If not, raise an AssertionError.
|
||||
"""Verify that condition is true. If not, raise TestFailed.
|
||||
|
||||
The optinal argument reason can be given to provide
|
||||
a better error text.
|
||||
"""
|
||||
|
||||
if not condition:
|
||||
raise AssertionError(reason)
|
||||
raise TestFailed(reason)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue