Commits

Martin von Löwis committed 05e0105

Backport of r67908:
Added test case to ensure attempts to read from a file opened for writing
fail.

Comments (0)

Files changed (2)

Lib/test/test_file.py

         except:
             self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
 
+    def testReadWhenWriting(self):
+        self.assertRaises(IOError, self.f.read)
 
 class OtherFileTests(unittest.TestCase):
 
 
 *Release date: XX-XXX-2009*
 
+Core and builtins
+-----------------
+
+- Added test case to ensure attempts to read from a file opened for writing
+  fail.
+
 
 What's New in Python 2.5.3?
 ===========================