[Python-checkins] CVS: python/dist/src/Lib/test test_complex.py,1.7,1.8 test_support.py,1.40,1.41

Tim Peters tim_one@users.sourceforge.net
2001年12月29日 09:35:00 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv21035/python/Lib/test
Modified Files:
	test_complex.py test_support.py 
Log Message:
test_support: add a docstring to vereq().
test_complex: repair new test's usage of vereq().
Index: test_complex.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_complex.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** test_complex.py	2001年12月29日 14:31:46	1.7
--- test_complex.py	2001年12月29日 17:34:57	1.8
***************
*** 64,69 ****
 raise TestFailed("complex(0.0, 0.0) should be false")
 
! if vereq(complex(5.3, 9.8).conjugate(), 5.3-9.8j):
! raise TestFailed("complex.conjugate() didn't work")
 
 try:
--- 64,68 ----
 raise TestFailed("complex(0.0, 0.0) should be false")
 
! vereq(complex(5.3, 9.8).conjugate(), 5.3-9.8j)
 
 try:
Index: test_support.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** test_support.py	2001年10月30日 23:20:46	1.40
--- test_support.py	2001年12月29日 17:34:57	1.41
***************
*** 119,122 ****
--- 119,132 ----
 
 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)

AltStyle によって変換されたページ (->オリジナル) /