Commit edf14317 authored by Martin v. Löwis's avatar Martin v. Löwis

Backport of r67908:

Added test case to ensure attempts to read from a file opened for writing
fail.
parent b90b144c
...@@ -116,6 +116,8 @@ class AutoFileTests(unittest.TestCase): ...@@ -116,6 +116,8 @@ class AutoFileTests(unittest.TestCase):
except: except:
self.assertEquals(self.f.__exit__(*sys.exc_info()), None) self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
def testReadWhenWriting(self):
self.assertRaises(IOError, self.f.read)
class OtherFileTests(unittest.TestCase): class OtherFileTests(unittest.TestCase):
......
...@@ -9,6 +9,12 @@ What's New in Python 2.5.4? ...@@ -9,6 +9,12 @@ What's New in Python 2.5.4?
*Release date: XX-XXX-2009* *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? What's New in Python 2.5.3?
=========================== ===========================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment