summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_file.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2008-12-23 03:51:14 (GMT)
committerSkip Montanaro <skip@pobox.com>2008-12-23 03:51:14 (GMT)
commit80072cb7fa556f56ec3b3cea1ac00d0b0fa33419 (patch)
treec3b5a479869857166b691cbf745b07065351b5e8 /Lib/test/test_file.py
parent43959e100cfa363898f77b3e736c5935ac88aa1d (diff)
downloadcpython-80072cb7fa556f56ec3b3cea1ac00d0b0fa33419.zip
cpython-80072cb7fa556f56ec3b3cea1ac00d0b0fa33419.tar.gz
cpython-80072cb7fa556f56ec3b3cea1ac00d0b0fa33419.tar.bz2
Merged revisions 67908 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67908 | skip.montanaro | 2008-12-22 21:30:15 -0600 (Mon, 22 Dec 2008) | 4 lines As a result of a regression that snuck into 2.5.3 add a test case that ensures that when you try to read from a file opened for writing an IOError is raised. ........
Diffstat (limited to 'Lib/test/test_file.py')
-rw-r--r--Lib/test/test_file.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index ff4996a..7a68b2f 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -123,6 +123,8 @@ class AutoFileTests(unittest.TestCase):
except:
self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
+ def testReadWhenWriting(self):
+ self.assertRaises(IOError, self.f.read)
class OtherFileTests(unittest.TestCase):