diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2015-12-05 05:32:23 (GMT) |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2015-12-05 05:32:23 (GMT) |
commit | ac28b796d80f869f39662491446145106960a886 (patch) | |
tree | 1877f8c5cd3a304a1890e81034555987fd9afbc1 /Lib | |
parent | 939614c48c3b0b5adeb408294a032118411ab987 (diff) | |
download | cpython-ac28b796d80f869f39662491446145106960a886.zip cpython-ac28b796d80f869f39662491446145106960a886.tar.gz cpython-ac28b796d80f869f39662491446145106960a886.tar.bz2 |
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.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_fork1.py | 1 | ||||
-rw-r--r-- | Lib/test/test_list.py | 1 | ||||
-rw-r--r-- | Lib/test/test_pyclbr.py | 4 | ||||
-rw-r--r-- | Lib/test/test_telnetlib.py | 10 | ||||
-rw-r--r-- | Lib/test/test_tuple.py | 1 | ||||
-rw-r--r-- | Lib/test/test_userdict.py | 1 | ||||
-rw-r--r-- | Lib/test/test_userlist.py | 1 | ||||
-rw-r--r-- | Lib/test/test_wait4.py | 1 |
8 files changed, 13 insertions, 7 deletions
diff --git a/Lib/test/test_fork1.py b/Lib/test/test_fork1.py index eeba306..da46fe5 100644 --- a/Lib/test/test_fork1.py +++ b/Lib/test/test_fork1.py @@ -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, diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py index ae1be6e..750d6cf 100644 --- a/Lib/test/test_list.py +++ b/Lib/test/test_list.py @@ -1,6 +1,7 @@ import sys from test import support, list_tests import pickle +import unittest class ListTest(list_tests.CommonTest): type2test = list diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py index cab430b..6ffbbbd 100644 --- a/Lib/test/test_pyclbr.py +++ b/Lib/test/test_pyclbr.py @@ -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() diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py index 524bba3..6c27c16 100644 --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -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] diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py index fb113ab..5d1fcf6 100644 --- a/Lib/test/test_tuple.py +++ b/Lib/test/test_tuple.py @@ -1,4 +1,5 @@ from test import support, seq_tests +import unittest import gc import pickle diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py index 1288943..8357f8b 100644 --- a/Lib/test/test_userdict.py +++ b/Lib/test/test_userdict.py @@ -1,6 +1,7 @@ # Check every path through every method of UserDict from test import support, mapping_tests +import unittest import collections d0 = {} diff --git a/Lib/test/test_userlist.py b/Lib/test/test_userlist.py index 4a304df..f92e4d3 100644 --- a/Lib/test/test_userlist.py +++ b/Lib/test/test_userlist.py @@ -2,6 +2,7 @@ from collections import UserList from test import support, list_tests +import unittest class UserListTest(list_tests.CommonTest): type2test = UserList diff --git a/Lib/test/test_wait4.py b/Lib/test/test_wait4.py index 43869be..3e6a79d 100644 --- a/Lib/test/test_wait4.py +++ b/Lib/test/test_wait4.py @@ -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 |