diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-11-05 21:42:45 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-11-05 21:42:45 (GMT) |
commit | 65676e407cd4beecf9ea482ae68926bff8329049 (patch) | |
tree | 935517a783edf601d253b2b98ca4f6d641e65d06 /Lib/test/test_fileio.py | |
parent | bd587059a6270aa58f594cd9bbfebc7e2510602a (diff) | |
download | cpython-65676e407cd4beecf9ea482ae68926bff8329049.zip cpython-65676e407cd4beecf9ea482ae68926bff8329049.tar.gz cpython-65676e407cd4beecf9ea482ae68926bff8329049.tar.bz2 |
Merged revisions 67089,67091,67101 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r67089 | benjamin.peterson | 2008-11-03 14:43:20 -0600 (Mon, 03 Nov 2008) | 1 line
clarify by splitting into multiple paragraphs
........
r67091 | benjamin.peterson | 2008-11-03 16:34:57 -0600 (Mon, 03 Nov 2008) | 1 line
move a FileIO test to test_fileio
........
r67101 | georg.brandl | 2008-11-04 14:49:35 -0600 (Tue, 04 Nov 2008) | 2 lines
#4167: fix markup glitches.
........
Diffstat (limited to 'Lib/test/test_fileio.py')
-rw-r--r-- | Lib/test/test_fileio.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index 0404a19..a11d3ba 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -6,7 +6,7 @@ import unittest from array import array from weakref import proxy -from test.support import TESTFN, findfile, run_unittest +from test.support import TESTFN, findfile, check_warnings, run_unittest from collections import UserList import _fileio @@ -240,6 +240,14 @@ class OtherFileTests(unittest.TestCase): def testInvalidInit(self): self.assertRaises(TypeError, _fileio._FileIO, "1", 0, 0) + def testWarnings(self): + with check_warnings() as w: + self.assertEqual(w.warnings, []) + self.assertRaises(TypeError, _fileio._FileIO, []) + self.assertEqual(w.warnings, []) + self.assertRaises(ValueError, _fileio._FileIO, "/some/invalid/name", "rt") + self.assertEqual(w.warnings, []) + def test_main(): # Historically, these tests have been sloppy about removing TESTFN. |