summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_file.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2008-12-23 03:30:15 (GMT)
committerSkip Montanaro <skip@pobox.com>2008-12-23 03:30:15 (GMT)
commitf205c13fac76ff31dd20849b1530d0a6baf4f1ad (patch)
treea99a216cd4123a501563f233a58474bf1bda7850 /Lib/test/test_file.py
parent5423abd1824f7defde1698f8cd423de0e9164e06 (diff)
downloadcpython-f205c13fac76ff31dd20849b1530d0a6baf4f1ad.zip
cpython-f205c13fac76ff31dd20849b1530d0a6baf4f1ad.tar.gz
cpython-f205c13fac76ff31dd20849b1530d0a6baf4f1ad.tar.bz2
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 2d791a5..96f6da2 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -120,6 +120,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):