diff options
-rw-r--r-- | Lib/test/test_file.py | 2 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index 2d791a5..96f6da2 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -120,6 +120,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): @@ -12,6 +12,9 @@ What's New in Python 2.7 alpha 1 Core and Builtins ----------------- +- Added test case to ensure attempts to read from a file opened for writing + fail. + - Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always print elapsed times, not only when some objects are uncollectable / unreachable. Original patch by Neil Schemenauer. |