diff options
author | Victor Stinner <vstinner@python.org> | 2023-06-06 20:50:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 20:50:43 (GMT) |
commit | ae319e4b43dc0d9d94d36bdcdbc5443364398c29 (patch) | |
tree | aef03900c10c94d8cc3848a3f5e9a5c3d6bcaf81 /Lib | |
parent | d3a0eacbf382288a487d40f16d63abfeb2125e1a (diff) | |
download | cpython-ae319e4b43dc0d9d94d36bdcdbc5443364398c29.zip cpython-ae319e4b43dc0d9d94d36bdcdbc5443364398c29.tar.gz cpython-ae319e4b43dc0d9d94d36bdcdbc5443364398c29.tar.bz2 |
gh-105407: Remove unused imports in tests (#105408)
Diffstat (limited to 'Lib')
23 files changed, 2 insertions, 35 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 767f049..c101fe9 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -48,7 +48,7 @@ import multiprocessing.heap import multiprocessing.managers import multiprocessing.pool import multiprocessing.queues -from multiprocessing.connection import wait, AuthenticationError +from multiprocessing.connection import wait from multiprocessing import util diff --git a/Lib/test/test_asyncio/test_eager_task_factory.py b/Lib/test/test_asyncio/test_eager_task_factory.py index fe69093..49d5dbb 100644 --- a/Lib/test/test_asyncio/test_eager_task_factory.py +++ b/Lib/test/test_asyncio/test_eager_task_factory.py @@ -2,17 +2,11 @@ import asyncio import contextvars -import gc -import time import unittest -from types import GenericAlias from unittest import mock -from asyncio import base_events from asyncio import tasks from test.test_asyncio import utils as test_utils -from test.test_asyncio.test_tasks import get_innermost_context -from test import support MOCK_ANY = mock.ANY diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index 24e472b..0df084e 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -8,7 +8,6 @@ import locale import sys import datetime import os -import warnings # From https://en.wikipedia.org/wiki/Leap_year_starting_on_Saturday result_0_02_text = """\ diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py index 3a4937c..3fcb694 100644 --- a/Lib/test/test_capi/test_misc.py +++ b/Lib/test/test_capi/test_misc.py @@ -9,7 +9,6 @@ import importlib.util import os import pickle import random -import subprocess import sys import textwrap import threading diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index bea7303..a6ce9c2 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -3,7 +3,7 @@ # Licensed to the PSF under a contributor agreement. from test import support, test_tools -from test.support import import_helper, os_helper +from test.support import os_helper from unittest import TestCase import collections import inspect diff --git a/Lib/test/test_compiler_assemble.py b/Lib/test/test_compiler_assemble.py index 3e2a127..3257aa3 100644 --- a/Lib/test/test_compiler_assemble.py +++ b/Lib/test/test_compiler_assemble.py @@ -1,5 +1,3 @@ - -import ast import types from test.support.bytecode_helper import AssemblerTestCase diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index eef4394..53163d7 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -5,7 +5,6 @@ import os import pathlib import textwrap import unittest -import warnings from test import support from test.support import os_helper diff --git a/Lib/test/test_cppext.py b/Lib/test/test_cppext.py index e2fedc9..7a143f4 100644 --- a/Lib/test/test_cppext.py +++ b/Lib/test/test_cppext.py @@ -7,7 +7,6 @@ import unittest import subprocess import sysconfig from test import support -from test.support import os_helper MS_WINDOWS = (sys.platform == 'win32') diff --git a/Lib/test/test_importlib/builtin/test_finder.py b/Lib/test/test_importlib/builtin/test_finder.py index 111c4af..1fb1d2f 100644 --- a/Lib/test/test_importlib/builtin/test_finder.py +++ b/Lib/test/test_importlib/builtin/test_finder.py @@ -4,7 +4,6 @@ machinery = util.import_importlib('importlib.machinery') import sys import unittest -import warnings @unittest.skipIf(util.BUILTINS.good_name is None, 'no reasonable builtin module') diff --git a/Lib/test/test_importlib/extension/test_loader.py b/Lib/test/test_importlib/extension/test_loader.py index a7c6245..64c8a54 100644 --- a/Lib/test/test_importlib/extension/test_loader.py +++ b/Lib/test/test_importlib/extension/test_loader.py @@ -1,4 +1,3 @@ -from warnings import catch_warnings from test.test_importlib import abc, util machinery = util.import_importlib('importlib.machinery') @@ -10,7 +9,6 @@ import unittest import warnings import importlib.util import importlib -from test.support.script_helper import assert_python_failure class LoaderTests: diff --git a/Lib/test/test_importlib/frozen/test_finder.py b/Lib/test/test_importlib/frozen/test_finder.py index 469dcdb..971cc28 100644 --- a/Lib/test/test_importlib/frozen/test_finder.py +++ b/Lib/test/test_importlib/frozen/test_finder.py @@ -2,11 +2,8 @@ from test.test_importlib import abc, util machinery = util.import_importlib('importlib.machinery') -import _imp -import marshal import os.path import unittest -import warnings from test.support import import_helper, REPO_ROOT, STDLIB_DIR diff --git a/Lib/test/test_importlib/frozen/test_loader.py b/Lib/test/test_importlib/frozen/test_loader.py index 4f1af45..1112c06 100644 --- a/Lib/test/test_importlib/frozen/test_loader.py +++ b/Lib/test/test_importlib/frozen/test_loader.py @@ -3,9 +3,7 @@ from test.test_importlib import abc, util machinery = util.import_importlib('importlib.machinery') from test.support import captured_stdout, import_helper, STDLIB_DIR -import _imp import contextlib -import marshal import os.path import types import unittest diff --git a/Lib/test/test_importlib/import_/test___loader__.py b/Lib/test/test_importlib/import_/test___loader__.py index a141639..858b37e 100644 --- a/Lib/test/test_importlib/import_/test___loader__.py +++ b/Lib/test/test_importlib/import_/test___loader__.py @@ -1,8 +1,5 @@ from importlib import machinery -import sys -import types import unittest -import warnings from test.test_importlib import util diff --git a/Lib/test/test_importlib/source/test_case_sensitivity.py b/Lib/test/test_importlib/source/test_case_sensitivity.py index 6a06313..e52829e 100644 --- a/Lib/test/test_importlib/source/test_case_sensitivity.py +++ b/Lib/test/test_importlib/source/test_case_sensitivity.py @@ -9,7 +9,6 @@ machinery = util.import_importlib('importlib.machinery') import os from test.support import os_helper import unittest -import warnings @util.case_insensitive_tests diff --git a/Lib/test/test_importlib/source/test_finder.py b/Lib/test/test_importlib/source/test_finder.py index 12db7c7..8c06c4d 100644 --- a/Lib/test/test_importlib/source/test_finder.py +++ b/Lib/test/test_importlib/source/test_finder.py @@ -10,7 +10,6 @@ import sys import tempfile from test.support.import_helper import make_legacy_pyc import unittest -import warnings class FinderTests(abc.FinderTests): diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py index ecf2c47..2a35f3d 100644 --- a/Lib/test/test_importlib/test_api.py +++ b/Lib/test/test_importlib/test_api.py @@ -10,7 +10,6 @@ from test.support import import_helper from test.support import os_helper import types import unittest -import warnings class ImportModuleTests: diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py index 46cd2b6..6469aad 100644 --- a/Lib/test/test_importlib/test_main.py +++ b/Lib/test/test_importlib/test_main.py @@ -4,7 +4,6 @@ import unittest import warnings import importlib.metadata import contextlib -import itertools try: import pyfakefs.fake_filesystem_unittest as ffs diff --git a/Lib/test/test_importlib/test_namespace_pkgs.py b/Lib/test/test_importlib/test_namespace_pkgs.py index 65428c3..9b3bef0 100644 --- a/Lib/test/test_importlib/test_namespace_pkgs.py +++ b/Lib/test/test_importlib/test_namespace_pkgs.py @@ -6,7 +6,6 @@ import os import sys import tempfile import unittest -import warnings from test.test_importlib import util diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index 68de4a6..5072be8 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -13,7 +13,6 @@ import time import shutil import threading import unittest -from unittest import mock from test.support import verbose from test.support.import_helper import forget, mock_register_at_fork from test.support.os_helper import (TESTFN, unlink, rmtree) diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py index 40b8aa1..a7586b3 100644 --- a/Lib/test/test_importlib/test_windows.py +++ b/Lib/test/test_importlib/test_windows.py @@ -5,7 +5,6 @@ import os import re import sys import unittest -import warnings from test.support import import_helper from contextlib import contextmanager from test.test_importlib.util import temp_module diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 076ace3..da5197d 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -1,4 +1,3 @@ -import contextlib import collections.abc import io import os diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 36f0b8a..878a21a 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -23,7 +23,6 @@ from shutil import (make_archive, unregister_unpack_format, get_unpack_formats, SameFileError, _GiveupOnFastCopy) import tarfile -import warnings import zipfile try: import posix diff --git a/Lib/test/test_unittest/test_result.py b/Lib/test/test_unittest/test_result.py index db551b7..15e3f62 100644 --- a/Lib/test/test_unittest/test_result.py +++ b/Lib/test/test_unittest/test_result.py @@ -6,7 +6,6 @@ from test.support import warnings_helper, captured_stdout import traceback import unittest -from unittest import mock from unittest.util import strclass from test.test_unittest.support import BufferedWriter |