diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-03-10 16:20:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 16:20:11 (GMT) |
commit | 6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97 (patch) | |
tree | bcd064ca27a9256c4d14aeccbac5bad0cf802c4d | |
parent | f537b2a4fb86445ee3bd6ca7f10bc9d3a9f37da5 (diff) | |
download | cpython-6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97.zip cpython-6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97.tar.gz cpython-6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97.tar.bz2 |
bpo-46198: rename duplicate tests and remove unused code (GH-30297)
-rw-r--r-- | Lib/test/datetimetester.py | 4 | ||||
-rw-r--r-- | Lib/test/support/__init__.py | 6 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_sslproto.py | 1 | ||||
-rw-r--r-- | Lib/test/test_codecs.py | 2 | ||||
-rw-r--r-- | Lib/test/test_compile.py | 2 | ||||
-rw-r--r-- | Lib/test/test_dict.py | 2 | ||||
-rw-r--r-- | Lib/test/test_email/test__header_value_parser.py | 2 | ||||
-rw-r--r-- | Lib/test/test_enum.py | 2 | ||||
-rw-r--r-- | Lib/test/test_pty.py | 1 | ||||
-rw-r--r-- | Lib/test/test_tabnanny.py | 1 |
10 files changed, 8 insertions, 15 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 810478c..df3764d 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1864,8 +1864,6 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase): def test_fromisoformat_fails_typeerror(self): # Test that fromisoformat fails when passed the wrong type - import io - bad_types = [b'2009-03-01', None, io.StringIO('2009-03-01')] for bad_type in bad_types: with self.assertRaises(TypeError): @@ -3988,8 +3986,6 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase): def test_fromisoformat_fails_typeerror(self): # Test the fromisoformat fails when passed the wrong type - import io - bad_types = [b'12:30:45', None, io.StringIO('12:30:45')] for bad_type in bad_types: diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 865fb97..c7bee8b 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1442,9 +1442,6 @@ class PythonSymlink: self._platform_specific() - def _platform_specific(self): - pass - if sys.platform == "win32": def _platform_specific(self): import glob @@ -1472,6 +1469,9 @@ class PythonSymlink: self._env["PYTHONHOME"] = os.path.dirname(self.real) if sysconfig.is_python_build(True): self._env["PYTHONPATH"] = STDLIB_DIR + else: + def _platform_specific(self): + pass def __enter__(self): os.symlink(self.real, self.link) diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 6e8de7c..4095b4d 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -2,7 +2,6 @@ import logging import socket -from test import support import unittest import weakref from unittest import mock diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 8118ec6..5853e08 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -36,7 +36,7 @@ def coding_checker(self, coder): # On small versions of Windows like Windows IoT or Windows Nano Server not all codepages are present def is_code_page_present(cp): from ctypes import POINTER, WINFUNCTYPE, WinDLL - from ctypes.wintypes import BOOL, UINT, BYTE, WCHAR, UINT, DWORD + from ctypes.wintypes import BOOL, BYTE, WCHAR, UINT, DWORD MAX_LEADBYTES = 12 # 5 ranges, 2 bytes ea., 0 term. MAX_DEFAULTCHAR = 2 # single or double byte diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 79046b8..8499d28 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1189,7 +1189,7 @@ class TestExpressionStackSize(unittest.TestCase): kwargs = (f'a{i}=x' for i in range(self.N)) self.check_stack_size("f(" + ", ".join(kwargs) + ")") - def test_func_args(self): + def test_meth_args(self): self.check_stack_size("o.m(" + "x, " * self.N + ")") def test_meth_kwargs(self): diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index e60ae43..5b8baaf 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -1455,7 +1455,7 @@ class DictTest(unittest.TestCase): self.assertTrue(gc.is_tracked(next(it))) @support.cpython_only - def test_dict_items_result_gc(self): + def test_dict_items_result_gc_reversed(self): # Same as test_dict_items_result_gc above, but reversed. it = reversed({None: []}.items()) gc.collect() diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py index 1bdcfa1..854f2ff 100644 --- a/Lib/test/test_email/test__header_value_parser.py +++ b/Lib/test/test_email/test__header_value_parser.py @@ -395,7 +395,7 @@ class TestParser(TestParserMixin, TestEmailBase): [errors.InvalidHeaderDefect], '') - def test_get_unstructured_invalid_ew(self): + def test_get_unstructured_invalid_ew2(self): self._test_get_x(self._get_unst, '=?utf-8?q?=somevalue?=', '=?utf-8?q?=somevalue?=', diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index b8a7914..f2572b2 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -3708,7 +3708,7 @@ class TestVerify(unittest.TestCase): triple = 3 value = 4 -class TestHelpers(unittest.TestCase): +class TestInternals(unittest.TestCase): sunder_names = '_bad_', '_good_', '_what_ho_' dunder_names = '__mal__', '__bien__', '__que_que__' diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index 0781cde..fa0dbcc 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -17,7 +17,6 @@ import io # readline import unittest import struct -import tty import fcntl import warnings diff --git a/Lib/test/test_tabnanny.py b/Lib/test/test_tabnanny.py index 59fdfc5..e0a82e9 100644 --- a/Lib/test/test_tabnanny.py +++ b/Lib/test/test_tabnanny.py @@ -4,7 +4,6 @@ Glossary: * errored : Whitespace related problems present in file. """ from unittest import TestCase, mock -from unittest import mock import errno import os import tabnanny |