Backport of r67908:
Added test case to ensure attempts to read from a file opened for writing fail.
This commit is contained in:
parent
b90b144c47
commit
edf14317e3
|
@ -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?
|
||||||
|
|
||||||
*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?
|
||||||
===========================
|
===========================
|
||||||
|
|
Loading…
Reference in New Issue