diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_file2k.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_file2k.py b/Lib/test/test_file2k.py index fc8bfe9c5d..ab09f2161b 100644 --- a/Lib/test/test_file2k.py +++ b/Lib/test/test_file2k.py @@ -135,6 +135,14 @@ class AutoFileTests(unittest.TestCase): def testReadWhenWriting(self): self.assertRaises(IOError, self.f.read) + def testNastyWritelinesGenerator(self): + def nasty(): + for i in range(5): + if i == 3: + self.f.close() + yield str(i) + self.assertRaises(ValueError, self.f.writelines, nasty()) + def testIssue5677(self): # Remark: Do not perform more than one test per open file, # since that does NOT catch the readline error on Windows. |