summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-10-30 21:23:35 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-10-30 21:23:35 (GMT)
commitdf32b3967c810fb54bb8fec966fec7ae009cf065 (patch)
tree18ed32fbf7f9d663d214b6de81c6519ece6ee018 /Lib/test/test_io.py
parentfec925b315efbf8a6a15251b65910266f5e20c8a (diff)
downloadcpython-df32b3967c810fb54bb8fec966fec7ae009cf065.zip
cpython-df32b3967c810fb54bb8fec966fec7ae009cf065.tar.gz
cpython-df32b3967c810fb54bb8fec966fec7ae009cf065.tar.bz2
Issue #4237: io.FileIO() was raising invalid warnings caused by insufficient initialization of PyFileIOObject struct members.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index bcb37d7..ea965d7 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -1237,6 +1237,13 @@ class MiscIOTest(unittest.TestCase):
else:
self.assert_(issubclass(obj, io.IOBase))
+ def test_fileio_warnings(self):
+ with support.check_warnings() as w:
+ self.assertEqual(w.warnings, [])
+ self.assertRaises(TypeError, io.FileIO, [])
+ self.assertEqual(w.warnings, [])
+ self.assertRaises(ValueError, io.FileIO, "/some/invalid/name", "rt")
+ self.assertEqual(w.warnings, [])
def test_main():
support.run_unittest(IOTest, BytesIOTest, StringIOTest,