Issue #25795: Fix several tests to run independently.
These were broken in 3aec776fc796 when they were converted away from using support.run_unittest(). Oops :) Initial patch by Felippe da Motta Raposo.
This commit is contained in:
parent
939614c48c
commit
ac28b796d8
|
@ -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,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import sys
|
||||
from test import support, list_tests
|
||||
import pickle
|
||||
import unittest
|
||||
|
||||
class ListTest(list_tests.CommonTest):
|
||||
type2test = list
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from test import support, seq_tests
|
||||
import unittest
|
||||
|
||||
import gc
|
||||
import pickle
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Check every path through every method of UserDict
|
||||
|
||||
from test import support, mapping_tests
|
||||
import unittest
|
||||
import collections
|
||||
|
||||
d0 = {}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from collections import UserList
|
||||
from test import support, list_tests
|
||||
import unittest
|
||||
|
||||
class UserListTest(list_tests.CommonTest):
|
||||
type2test = UserList
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue