]> granicus.if.org Git - python/commitdiff
There is no TestError, use TestFailed appropriately
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 1 Apr 2002 18:59:20 +0000 (18:59 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 1 Apr 2002 18:59:20 +0000 (18:59 +0000)
Lib/test/test_descr.py
Lib/test/test_file.py
Lib/test/test_mpz.py

index f52edb629ac63e725b7c77663042ae8b4b02552e..862fc778859de0181edf356fc918a0dd1e51beef 100644 (file)
@@ -785,7 +785,7 @@ def metaclass():
     c = C()
     try: c()
     except TypeError: pass
-    else: raise TestError, "calling object w/o call method should raise TypeError"
+    else: raise TestFailed, "calling object w/o call method should raise TypeError"
 
 def pymods():
     if verbose: print "Testing Python subclass of module..."
index 33a923d78c1add4dec0000f04e79eb5c0ddfa4c6..71222c173f610d782c14c22e43d14c4302682877 100644 (file)
@@ -1,7 +1,7 @@
 import os
 from array import array
 
-from test_support import verify, TESTFN
+from test_support import verify, TESTFN, TestFailed
 from UserList import UserList
 
 # verify writelines with instance sequence
@@ -70,23 +70,23 @@ else:
 
 f = open(TESTFN)
 if f.name != TESTFN:
-    raise TestError, 'file.name should be "%s"' % TESTFN
+    raise TestFailed, 'file.name should be "%s"' % TESTFN
 if f.isatty():
-    raise TestError, 'file.isatty() should be false'
+    raise TestFailed, 'file.isatty() should be false'
 
 if f.closed:
-    raise TestError, 'file.closed should be false'
+    raise TestFailed, 'file.closed should be false'
 
 try:
     f.readinto("")
 except TypeError:
     pass
 else:
-    raise TestError, 'file.readinto("") should raise a TypeError'
+    raise TestFailed, 'file.readinto("") should raise a TypeError'
 
 f.close()
 if not f.closed:
-    raise TestError, 'file.closed should be true'
+    raise TestFailed, 'file.closed should be true'
 
 for methodname in ['fileno', 'flush', 'isatty', 'read', 'readinto', 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', 'xreadlines' ]:
     method = getattr(f, methodname)
@@ -95,13 +95,13 @@ for methodname in ['fileno', 'flush', 'isatty', 'read', 'readinto', 'readline',
     except ValueError:
         pass
     else:
-        raise TestError, 'file.%s() on a closed file should raise a ValueError' % methodname
+        raise TestFailed, 'file.%s() on a closed file should raise a ValueError' % methodname
 
 try:
     f.writelines([])
 except ValueError:
     pass
 else:
-    raise TestError, 'file.writelines([]) on a closed file should raise a ValueError'
+    raise TestFailed, 'file.writelines([]) on a closed file should raise a ValueError'
 
 os.unlink(TESTFN)
index 3e0a7000ef3dc84a1bbbad66289deb7f05bfe618..2e57db47958f7dbd6aed7776a81692144074d5de 100644 (file)
@@ -1,6 +1,6 @@
 
 import mpz
-from test_support import vereq
+from test_support import vereq, TestFailed
 
 def check_conversion(num):
     mpz_num = mpz.mpz(num)