diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 8 | ||||
-rw-r--r-- | Lib/test/test_complex.py | 1 | ||||
-rw-r--r-- | Lib/test/test_dis.py | 4 | ||||
-rw-r--r-- | Lib/test/test_ftplib.py | 4 | ||||
-rw-r--r-- | Lib/test/test_import.py | 11 | ||||
-rw-r--r-- | Lib/test/test_regrtest.py | 12 | ||||
-rw-r--r-- | Lib/test/test_smtplib.py | 6 | ||||
-rw-r--r-- | Lib/test/test_ssl.py | 8 | ||||
-rw-r--r-- | Lib/test/test_webbrowser.py | 2 |
9 files changed, 18 insertions, 38 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 4cabf43..de0c968 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -3038,15 +3038,15 @@ class TestInitializers(unittest.TestCase): # Verifies os.close(sys.stdin.fileno) vs. sys.stdin.close() behavior # -def _ThisSubProcess(q): +def _this_sub_process(q): try: item = q.get(block=False) except pyqueue.Empty: pass -def _TestProcess(q): +def _test_process(q): queue = multiprocessing.Queue() - subProc = multiprocessing.Process(target=_ThisSubProcess, args=(queue,)) + subProc = multiprocessing.Process(target=_this_sub_process, args=(queue,)) subProc.daemon = True subProc.start() subProc.join() @@ -3085,7 +3085,7 @@ class TestStdinBadfiledescriptor(unittest.TestCase): def test_queue_in_process(self): queue = multiprocessing.Queue() - proc = multiprocessing.Process(target=_TestProcess, args=(queue,)) + proc = multiprocessing.Process(target=_test_process, args=(queue,)) proc.start() proc.join() diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py index 2a85bf4..f80d7ac 100644 --- a/Lib/test/test_complex.py +++ b/Lib/test/test_complex.py @@ -101,7 +101,6 @@ class ComplexTest(unittest.TestCase): # FIXME: The following currently crashes on Alpha # self.assertRaises(OverflowError, pow, 1e200+1j, 1e200+1j) - def test_truediv(self): self.assertAlmostEqual(complex.__truediv__(2+0j, 1+1j), 1-1j) self.assertRaises(ZeroDivisionError, complex.__truediv__, 1+1j, 0+0j) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index a1c6582..8610c5d 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -247,7 +247,6 @@ class DisTests(unittest.TestCase): expected = _BIG_LINENO_FORMAT % (i + 2) self.do_disassembly_test(func(i), expected) - def test_big_linenos(self): from test import dis_module self.do_disassembly_test(dis_module, dis_module_expected_results) @@ -273,9 +272,6 @@ class DisTests(unittest.TestCase): pass self.assertRaises(RuntimeError, dis.dis, None) - def test_dis_object(self): - self.assertRaises(TypeError, dis.dis, object()) - def test_dis_traceback(self): try: del sys.last_traceback diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 08d99d8..47563c8 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -534,10 +534,6 @@ class TestFTPClass(TestCase): dir = self.client.cwd('/foo') self.assertEqual(dir, '250 cwd ok') - def test_mkd(self): - dir = self.client.mkd('/foo') - self.assertEqual(dir, '/foo') - def test_pwd(self): dir = self.client.pwd() self.assertEqual(dir, 'pwd ok') diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 2485e22..9d15a43 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -252,17 +252,6 @@ class ImportTests(unittest.TestCase): if TESTFN in sys.modules: del sys.modules[TESTFN] - def test_import_name_binding(self): - # import x.y.z binds x in the current namespace. - import test as x - import test.support - self.assertIs(x, test, x.__name__) - self.assertTrue(hasattr(test.support, "__file__")) - - # import x.y.z as w binds z as w. - import test.support as y - self.assertIs(y, test.support, y.__name__) - def test_import_by_filename(self): path = os.path.abspath(TESTFN) encoding = sys.getfilesystemencoding() diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 353874b..a398a4f 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -167,19 +167,13 @@ class ParseArgsTestCase(unittest.TestCase): self.assertEqual(ns.testdir, os.path.join(support.SAVEDCWD, 'foo')) self.checkError(['--testdir'], 'expected one argument') - def test_findleaks(self): - for opt in '-l', '--findleaks': - with self.subTest(opt=opt): - ns = regrtest._parse_args([opt]) - self.assertTrue(ns.findleaks) - - def test_findleaks(self): + def test_runleaks(self): for opt in '-L', '--runleaks': with self.subTest(opt=opt): ns = regrtest._parse_args([opt]) self.assertTrue(ns.runleaks) - def test_findleaks(self): + def test_huntrleaks(self): for opt in '-R', '--huntrleaks': with self.subTest(opt=opt): ns = regrtest._parse_args([opt, ':']) @@ -207,7 +201,7 @@ class ParseArgsTestCase(unittest.TestCase): self.checkError([opt, '2', '-l'], "don't go together") self.checkError([opt, '2', '-M', '4G'], "don't go together") - def test_findleaks(self): + def test_coverage(self): for opt in '-T', '--coverage': with self.subTest(opt=opt): ns = regrtest._parse_args([opt]) diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 8f64ec1..a501f40 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -239,14 +239,14 @@ class DebuggingServerTests(unittest.TestCase): self.assertEqual(smtp.rset(), expected) smtp.quit() - def testNotImplemented(self): + def testELHO(self): # EHLO isn't implemented in DebuggingServer smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) - expected = (502, b'Error: command "EHLO" not implemented') + expected = (250, b'\nSIZE 33554432\nHELP') self.assertEqual(smtp.ehlo(), expected) smtp.quit() - def testNotImplemented(self): + def testEXPNNotImplemented(self): # EXPN isn't implemented in DebuggingServer smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) expected = (502, b'EXPN not implemented') diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 8915305..2605e68 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -1588,8 +1588,14 @@ else: context.load_cert_chain(CERTFILE) server = ThreadedEchoServer(context=context, chatty=False) with server: - s = context.wrap_socket(socket.socket()) + s = context.wrap_socket(socket.socket(), + do_handshake_on_connect=False) s.connect((HOST, server.port)) + # getpeercert() raise ValueError while the handshake isn't + # done. + with self.assertRaises(ValueError): + s.getpeercert() + s.do_handshake() cert = s.getpeercert() self.assertTrue(cert, "Can't get peer certificate.") cipher = s.cipher() diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py index 34b9364..c3292c4 100644 --- a/Lib/test/test_webbrowser.py +++ b/Lib/test/test_webbrowser.py @@ -158,7 +158,7 @@ class OperaCommandTest(CommandTestMixin, unittest.TestCase): options=['-remote'], arguments=['openURL({},new-window)'.format(URL)]) - def test_open_new(self): + def test_open_new_tab(self): self._test('open_new_tab', options=['-remote'], arguments=['openURL({},new-page)'.format(URL)]) |