summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index a03a7f7..c68b2fe 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -968,6 +968,16 @@ class IOTest(unittest.TestCase):
self.assertSequenceEqual(buffer[result:], unused)
self.assertEqual(len(reader.avail), avail - result)
+ def test_close_assert(self):
+ class R(self.IOBase):
+ def __setattr__(self, name, value):
+ pass
+ def flush(self):
+ raise OSError()
+ f = R()
+ # This would cause an assertion failure.
+ self.assertRaises(OSError, f.close)
+
class CIOTest(IOTest):