]> granicus.if.org Git - python/commitdiff
Issue #25795: Fix several tests to run independently.
authorZachary Ware <zachary.ware@gmail.com>
Sat, 5 Dec 2015 05:32:23 +0000 (23:32 -0600)
committerZachary Ware <zachary.ware@gmail.com>
Sat, 5 Dec 2015 05:32:23 +0000 (23:32 -0600)
These were broken in 3aec776fc796 when they were converted
away from using support.run_unittest().  Oops :)

Initial patch by Felippe da Motta Raposo.

Lib/test/test_fork1.py
Lib/test/test_list.py
Lib/test/test_pyclbr.py
Lib/test/test_telnetlib.py
Lib/test/test_tuple.py
Lib/test/test_userdict.py
Lib/test/test_userlist.py
Lib/test/test_wait4.py

index eeba306f452ce912b1ad5e29471b73462ac29ba3..da46fe565dcc10efa3dc483b067371a9d285f7ea 100644 (file)
@@ -6,6 +6,7 @@ import os
 import signal
 import sys
 import time
+import unittest
 
 from test.fork_wait import ForkWait
 from test.support import (reap_children, get_attribute,
index ae1be6e30de84d88bc449f9483b8a9b67b32bce4..750d6cfc6093f7ef750d7d4f3ed3f21f72be06bd 100644 (file)
@@ -1,6 +1,7 @@
 import sys
 from test import support, list_tests
 import pickle
+import unittest
 
 class ListTest(list_tests.CommonTest):
     type2test = list
index cab430b4bd39add63a444f7ca68326822cfc10eb..6ffbbbda27061af0600f99557157a2998395ca31 100644 (file)
@@ -5,7 +5,7 @@
 import sys
 from types import FunctionType, MethodType, BuiltinFunctionType
 import pyclbr
-from unittest import TestCase
+from unittest import TestCase, main as unittest_main
 
 StaticMethodType = type(staticmethod(lambda: None))
 ClassMethodType = type(classmethod(lambda c: None))
@@ -173,4 +173,4 @@ class PyclbrTest(TestCase):
 
 
 if __name__ == "__main__":
-    unittest.main()
+    unittest_main()
index 524bba37b363a5f51e7d7097bef1e8589358a519..6c27c16a034378731f87c110cf567c4af800f986 100644 (file)
@@ -4,8 +4,8 @@ import telnetlib
 import time
 import contextlib
 
-from unittest import TestCase
 from test import support
+import unittest
 threading = support.import_module('threading')
 
 HOST = support.HOST
@@ -21,7 +21,7 @@ def server(evt, serv):
     finally:
         serv.close()
 
-class GeneralTests(TestCase):
+class GeneralTests(unittest.TestCase):
 
     def setUp(self):
         self.evt = threading.Event()
@@ -165,7 +165,7 @@ def test_telnet(reads=(), cls=TelnetAlike):
         telnet._messages = '' # debuglevel output
     return telnet
 
-class ExpectAndReadTestCase(TestCase):
+class ExpectAndReadTestCase(unittest.TestCase):
     def setUp(self):
         self.old_selector = telnetlib._TelnetSelector
         telnetlib._TelnetSelector = MockSelector
@@ -284,7 +284,7 @@ class nego_collector(object):
 
 tl = telnetlib
 
-class WriteTests(TestCase):
+class WriteTests(unittest.TestCase):
     '''The only thing that write does is replace each tl.IAC for
     tl.IAC+tl.IAC'''
 
@@ -300,7 +300,7 @@ class WriteTests(TestCase):
             written = b''.join(telnet.sock.writes)
             self.assertEqual(data.replace(tl.IAC,tl.IAC+tl.IAC), written)
 
-class OptionTests(TestCase):
+class OptionTests(unittest.TestCase):
     # RFC 854 commands
     cmds = [tl.AO, tl.AYT, tl.BRK, tl.EC, tl.EL, tl.GA, tl.IP, tl.NOP]
 
index fb113ab29aacd9f8b7dfe85a5eb13d0850820ad3..5d1fcf68a8800d4fe6ffe36a2aaf8441bcece67d 100644 (file)
@@ -1,4 +1,5 @@
 from test import support, seq_tests
+import unittest
 
 import gc
 import pickle
index 12889438a9947a3ef7ddeae4873fc9a42359b4f9..8357f8bcd18c65ce6c849723c94a36104a4d65d2 100644 (file)
@@ -1,6 +1,7 @@
 # Check every path through every method of UserDict
 
 from test import support, mapping_tests
+import unittest
 import collections
 
 d0 = {}
index 4a304df70d46feb95b6b00eea9621734042ca8a5..f92e4d385e21adff808f4432ebb11ab90e719b56 100644 (file)
@@ -2,6 +2,7 @@
 
 from collections import UserList
 from test import support, list_tests
+import unittest
 
 class UserListTest(list_tests.CommonTest):
     type2test = UserList
index 43869be33f8756d2b5c2c1c7f0686fd55e6f086a..3e6a79df463cb47669fcc492eef8c9e49a0dca5d 100644 (file)
@@ -4,6 +4,7 @@
 import os
 import time
 import sys
+import unittest
 from test.fork_wait import ForkWait
 from test.support import reap_children, get_attribute