1. Carl Meyer
  2. cpython-site-tests

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.

  • Participants
  • Parent commits 773af18
  • Branches 2.5

Comments (0)

Files changed (2)

File Lib/test/test_file.py

View file
         except:
             self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
 
+    def testReadWhenWriting(self):
+        self.assertRaises(IOError, self.f.read)
 
 class OtherFileTests(unittest.TestCase):
 

File Misc/NEWS

View file
 
 *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?
 ===========================