[Python-checkins] r67091 - in python/trunk/Lib/test: test_fileio.py test_io.py
benjamin.peterson
python-checkins at python.org
Mon Nov 3 23:34:57 CET 2008
Author: benjamin.peterson
Date: Mon Nov 3 23:34:57 2008
New Revision: 67091
Log:
move a FileIO test to test_fileio
Modified:
python/trunk/Lib/test/test_fileio.py
python/trunk/Lib/test/test_io.py
Modified: python/trunk/Lib/test/test_fileio.py
==============================================================================
--- python/trunk/Lib/test/test_fileio.py (original)
+++ python/trunk/Lib/test/test_fileio.py Mon Nov 3 23:34:57 2008
@@ -7,7 +7,7 @@
from array import array
from weakref import proxy
-from test.test_support import TESTFN, findfile, run_unittest
+from test.test_support import TESTFN, findfile, check_warnings, run_unittest
from UserList import UserList
import _fileio
@@ -241,6 +241,14 @@
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.
Modified: python/trunk/Lib/test/test_io.py
==============================================================================
--- python/trunk/Lib/test/test_io.py (original)
+++ python/trunk/Lib/test/test_io.py Mon Nov 3 23:34:57 2008
@@ -1236,13 +1236,6 @@
else:
self.assert_(issubclass(obj, io.IOBase))
- def test_fileio_warnings(self):
- with test_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():
test_support.run_unittest(IOTest, BytesIOTest, StringIOTest,
More information about the Python-checkins
mailing list