[Python-checkins] CVS: python/dist/src/Lib/test test_richcmp.py,1.3,1.4

Guido van Rossum gvanrossum@users.sourceforge.net
Thu, 18 Jan 2001 13:52:28 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv15848

Modified Files:
	test_richcmp.py 
Log Message:
Since I'm about to check in a change to the recursion-detection code
for comparisons that outlaws requets for ordering on recursive data
structures, remove the tests for ordering recursive data structures.


Index: test_richcmp.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_richcmp.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_richcmp.py	2001/01/18 16:21:57	1.3
--- test_richcmp.py	2001/01/18 21:52:26	1.4
***************
*** 195,230 ****
      def check(s, a=a, b=b):
          if verbose:
!             print "trying", s, "..."
!         verify(eval(s))
      if verbose:
          print "recursion tests: a=%s, b=%s" % (a, b)
      check('a==b')
-     check('a<=b')
-     check('a>=b')
-     check('not a<b')
-     check('not a>b')
      check('not a!=b')
-     check('cmp(a,b) == 0')
      a.append(1)
      b.append(0)
      if verbose:
          print "recursion tests: a=%s, b=%s" % (a, b)
-     check('a>b')
-     check('a>=b')
      check('a!=b')
-     check('not a<b')
-     check('not a<=b')
      check('not a==b')
-     check('cmp(a,b) == 1')
      a[1] = -1
      if verbose:
          print "recursion tests: a=%s, b=%s" % (a, b)
-     check('a<b')
-     check('a<=b')
      check('a!=b')
-     check('not a>b')
-     check('not a>=b')
      check('not a==b')
-     check('cmp(a,b) == -1')
      if verbose: print "recursion tests ok"
  
--- 195,223 ----
      def check(s, a=a, b=b):
          if verbose:
!             print "check", s
!         try:
!             if not eval(s):
!                 raise TestFailed, s + " was false but expected to be true"
!         except RuntimeError, msg:
!             raise TestFailed, str(msg)
      if verbose:
          print "recursion tests: a=%s, b=%s" % (a, b)
      check('a==b')
      check('not a!=b')
      a.append(1)
+     if verbose:
+         print "recursion tests: a=%s, b=%s" % (a, b)
+     check('a!=b')
+     check('not a==b')
      b.append(0)
      if verbose:
          print "recursion tests: a=%s, b=%s" % (a, b)
      check('a!=b')
      check('not a==b')
      a[1] = -1
      if verbose:
          print "recursion tests: a=%s, b=%s" % (a, b)
      check('a!=b')
      check('not a==b')
      if verbose: print "recursion tests ok"