summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-12-29 17:34:57 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-12-29 17:34:57 (GMT)
commit77902970c598c068a2916e86ca386d1387c4c369 (patch)
treebd54233006108ca4973c6273bc342f44259f0742 /Lib/test/test_support.py
parent5a0f010c672c680eb0794a9e443f92b43e29301d (diff)
downloadcpython-77902970c598c068a2916e86ca386d1387c4c369.zip
cpython-77902970c598c068a2916e86ca386d1387c4c369.tar.gz
cpython-77902970c598c068a2916e86ca386d1387c4c369.tar.bz2
test_support: add a docstring to vereq().
test_complex: repair new test's usage of vereq().
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 83bde3e..4a45617 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -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)