diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 767f049b0d717a..c101fe980ceed5 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -48,7 +48,7 @@ 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 fe690934292a86..49d5dbb8940a96 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 24e472b5fee828..0df084e17a3c8e 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -8,7 +8,6 @@ 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 3a4937c3bf5faf..3fcb694198a53a 100644 --- a/Lib/test/test_capi/test_misc.py +++ b/Lib/test/test_capi/test_misc.py @@ -9,7 +9,6 @@ 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 bea7303805567f..a6ce9c2570cb62 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 3e2a127de728cd..3257aa3cc118fc 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 eef439412528d3..53163d7528b64a 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -5,7 +5,6 @@ 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 e2fedc9735079f..7a143f44640137 100644 --- a/Lib/test/test_cppext.py +++ b/Lib/test/test_cppext.py @@ -7,7 +7,6 @@ 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 111c4af1ea7cfe..1fb1d2f9efad2b 100644 --- a/Lib/test/test_importlib/builtin/test_finder.py +++ b/Lib/test/test_importlib/builtin/test_finder.py @@ -4,7 +4,6 @@ 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 a7c6245825ff86..64c8a5485106e3 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 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 469dcdbd09eaf7..971cc28b6d3e26 100644 --- a/Lib/test/test_importlib/frozen/test_finder.py +++ b/Lib/test/test_importlib/frozen/test_finder.py @@ -2,11 +2,8 @@ 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 4f1af454b52c71..1112c0664ad477 100644 --- a/Lib/test/test_importlib/frozen/test_loader.py +++ b/Lib/test/test_importlib/frozen/test_loader.py @@ -3,9 +3,7 @@ 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 a14163919af677..858b37effc64bd 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 6a06313319dbcd..e52829e628038a 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 @@ 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 12db7c7d352a2f..8c06c4da1f5cba 100644 --- a/Lib/test/test_importlib/source/test_finder.py +++ b/Lib/test/test_importlib/source/test_finder.py @@ -10,7 +10,6 @@ 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 ecf2c47c462e23..2a35f3dcb7210c 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 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 46cd2b696d4cc8..6469aad7130fce 100644 --- a/Lib/test/test_importlib/test_main.py +++ b/Lib/test/test_importlib/test_main.py @@ -4,7 +4,6 @@ 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 65428c3d3ead9b..9b3bef02c66820 100644 --- a/Lib/test/test_importlib/test_namespace_pkgs.py +++ b/Lib/test/test_importlib/test_namespace_pkgs.py @@ -6,7 +6,6 @@ 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 68de4a66f3c703..5072be86cfd112 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -13,7 +13,6 @@ 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 40b8aa1787fe08..a7586b3d95dc14 100644 --- a/Lib/test/test_importlib/test_windows.py +++ b/Lib/test/test_importlib/test_windows.py @@ -5,7 +5,6 @@ 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 076ace3d930857..da5197dbfacb39 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 36f0b8a31a3715..878a21a629f3cc 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -23,7 +23,6 @@ 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 db551b7890ca3e..15e3f62ef66a4b 100644 --- a/Lib/test/test_unittest/test_result.py +++ b/Lib/test/test_unittest/test_result.py @@ -6,7 +6,6 @@ import traceback import unittest -from unittest import mock from unittest.util import strclass from test.test_unittest.support import BufferedWriter