summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_file.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-04-01 18:59:20 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-04-01 18:59:20 (GMT)
commitb1295da59e90f85c71cd5591eff38376017f5e43 (patch)
tree020815085ce7b1282f554a4772bd26dda39965e1 /Lib/test/test_file.py
parent8392f3657904969f3c4217b4bb9028fd40bfa555 (diff)
downloadcpython-b1295da59e90f85c71cd5591eff38376017f5e43.zip
cpython-b1295da59e90f85c71cd5591eff38376017f5e43.tar.gz
cpython-b1295da59e90f85c71cd5591eff38376017f5e43.tar.bz2
There is no TestError, use TestFailed appropriately
Diffstat (limited to 'Lib/test/test_file.py')
-rw-r--r--Lib/test/test_file.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 33a923d..71222c1 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -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)