mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
test_support: add a docstring to vereq().
test_complex: repair new test's usage of vereq().
This commit is contained in:
parent
5a0f010c67
commit
77902970c5
2 changed files with 11 additions and 2 deletions
|
@ -118,6 +118,16 @@ def verify(condition, reason='test failed'):
|
|||
raise TestFailed(reason)
|
||||
|
||||
def vereq(a, b):
|
||||
"""Raise TestFailed if a == b is false.
|
||||
|
||||
This is better than verify(a == b) because, in case of failure, the
|
||||
error message incorporates repr(a) and repr(b) so you can see the
|
||||
inputs.
|
||||
|
||||
Note that "not (a == b)" isn't necessarily the same as "a != b"; the
|
||||
former is tested.
|
||||
"""
|
||||
|
||||
if not (a == b):
|
||||
raise TestFailed, "%r == %r" % (a, b)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue