Backport of r67908:

Added test case to ensure attempts to read from a file opened for writing
fail.
This commit is contained in:
Martin v. Löwis 2008-12-23 13:07:51 +00:00
parent b90b144c47
commit edf14317e3
2 changed files with 8 additions and 0 deletions

View File

@ -116,6 +116,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):

View File

@ -9,6 +9,12 @@ What's New in Python 2.5.4?
*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?
===========================