]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
move a FileIO test to test_fileio
authorBenjamin Peterson <benjamin@python.org>
Mon, 3 Nov 2008 22:34:57 +0000 (22:34 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 3 Nov 2008 22:34:57 +0000 (22:34 +0000)
Lib/test/test_fileio.py
Lib/test/test_io.py

index 5a0e1a6b34ec7a288ed8c430207f7d64cfe5e333..cbc716570709e565afd6dc8a7ad834cdf9929060 100644 (file)
@@ -7,7 +7,7 @@ import unittest
 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 @@ 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.
index 08a524fa99d22cd3c12dff54895f39c990696de1..9ef2a818b3d4aa11fea24548287f66c4ddf70c30 100644 (file)
@@ -1236,13 +1236,6 @@ class MiscIOTest(unittest.TestCase):
             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,