diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_io.py | 7 |
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, |