[Python-checkins] CVS: python/dist/src/Lib/test test_support.py,1.12,1.13 test_unicode.py,1.28,1.29

Guido van Rossum gvanrossum@users.sourceforge.net
Fri, 19 Jan 2001 11:01:58 -0800


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

Modified Files:
	test_support.py test_unicode.py 
Log Message:
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.)



Index: test_support.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** test_support.py	2001/01/19 05:59:21	1.12
--- test_support.py	2001/01/19 19:01:56	1.13
***************
*** 72,76 ****
  
  def verify(condition, reason='test failed'):
!     """Verify that condition is true. If not, raise an AssertionError.
  
         The optinal argument reason can be given to provide
--- 72,76 ----
  
  def verify(condition, reason='test failed'):
!     """Verify that condition is true. If not, raise TestFailed.
  
         The optinal argument reason can be given to provide
***************
*** 79,81 ****
  
      if not condition:
!         raise AssertionError(reason)
--- 79,81 ----
  
      if not condition:
!         raise TestFailed(reason)

Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** test_unicode.py	2001/01/18 02:22:22	1.28
--- test_unicode.py	2001/01/19 19:01:56	1.29
***************
*** 412,416 ****
      pass
  else:
!     raise AssertionError, "u'Andr\202'.encode('ascii') failed to raise an exception"
  verify(u'Andr\202 x'.encode('ascii','ignore') == "Andr x")
  verify(u'Andr\202 x'.encode('ascii','replace') == "Andr? x")
--- 412,416 ----
      pass
  else:
!     raise TestFailed, "u'Andr\202'.encode('ascii') failed to raise an exception"
  verify(u'Andr\202 x'.encode('ascii','ignore') == "Andr x")
  verify(u'Andr\202 x'.encode('ascii','replace') == "Andr? x")
***************
*** 422,426 ****
      pass
  else:
!     raise AssertionError, "unicode('Andr\202') failed to raise an exception"
  verify(unicode('Andr\202 x','ascii','ignore') == u"Andr x")
  verify(unicode('Andr\202 x','ascii','replace') == u'Andr\uFFFD x')
--- 422,426 ----
      pass
  else:
!     raise TestFailed, "unicode('Andr\202') failed to raise an exception"
  verify(unicode('Andr\202 x','ascii','ignore') == u"Andr x")
  verify(unicode('Andr\202 x','ascii','replace') == u'Andr\uFFFD x')
***************
*** 444,448 ****
      try:
          verify(unicode(u.encode(encoding),encoding) == u)
!     except AssertionError:
          print '*** codec "%s" failed round-trip' % encoding
      except ValueError,why:
--- 444,448 ----
      try:
          verify(unicode(u.encode(encoding),encoding) == u)
!     except TestFailed:
          print '*** codec "%s" failed round-trip' % encoding
      except ValueError,why:
***************
*** 455,459 ****
      try:
          verify(unicode(u.encode(encoding),encoding) == u)
!     except AssertionError:
          print '*** codec "%s" failed round-trip' % encoding
      except ValueError,why:
--- 455,459 ----
      try:
          verify(unicode(u.encode(encoding),encoding) == u)
!     except TestFailed:
          print '*** codec "%s" failed round-trip' % encoding
      except ValueError,why:
***************
*** 489,493 ****
      try:
          verify(unicode(s,encoding).encode(encoding) == s)
!     except AssertionError:
          print '*** codec "%s" failed round-trip' % encoding
      except ValueError,why:
--- 489,493 ----
      try:
          verify(unicode(s,encoding).encode(encoding) == s)
!     except TestFailed:
          print '*** codec "%s" failed round-trip' % encoding
      except ValueError,why:
***************
*** 519,523 ****
      try:
          verify(unicode(s,encoding).encode(encoding) == s)
!     except AssertionError:
          print '*** codec "%s" failed round-trip' % encoding
      except ValueError,why:
--- 519,523 ----
      try:
          verify(unicode(s,encoding).encode(encoding) == s)
!     except TestFailed:
          print '*** codec "%s" failed round-trip' % encoding
      except ValueError,why: