mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-105407: Remove unused imports in tests (#105408)
This commit is contained in:
parent
d3a0eacbf3
commit
ae319e4b43
23 changed files with 2 additions and 35 deletions
|
@ -48,7 +48,7 @@ import multiprocessing.heap
|
||||||
import multiprocessing.managers
|
import multiprocessing.managers
|
||||||
import multiprocessing.pool
|
import multiprocessing.pool
|
||||||
import multiprocessing.queues
|
import multiprocessing.queues
|
||||||
from multiprocessing.connection import wait, AuthenticationError
|
from multiprocessing.connection import wait
|
||||||
|
|
||||||
from multiprocessing import util
|
from multiprocessing import util
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,11 @@
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import contextvars
|
import contextvars
|
||||||
import gc
|
|
||||||
import time
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from types import GenericAlias
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
from asyncio import base_events
|
|
||||||
from asyncio import tasks
|
from asyncio import tasks
|
||||||
from test.test_asyncio import utils as test_utils
|
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
|
MOCK_ANY = mock.ANY
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import locale
|
||||||
import sys
|
import sys
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
import warnings
|
|
||||||
|
|
||||||
# From https://en.wikipedia.org/wiki/Leap_year_starting_on_Saturday
|
# From https://en.wikipedia.org/wiki/Leap_year_starting_on_Saturday
|
||||||
result_0_02_text = """\
|
result_0_02_text = """\
|
||||||
|
|
|
@ -9,7 +9,6 @@ import importlib.util
|
||||||
import os
|
import os
|
||||||
import pickle
|
import pickle
|
||||||
import random
|
import random
|
||||||
import subprocess
|
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
import threading
|
import threading
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Licensed to the PSF under a contributor agreement.
|
# Licensed to the PSF under a contributor agreement.
|
||||||
|
|
||||||
from test import support, test_tools
|
from test import support, test_tools
|
||||||
from test.support import import_helper, os_helper
|
from test.support import os_helper
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
import collections
|
import collections
|
||||||
import inspect
|
import inspect
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
import ast
|
|
||||||
import types
|
import types
|
||||||
|
|
||||||
from test.support.bytecode_helper import AssemblerTestCase
|
from test.support.bytecode_helper import AssemblerTestCase
|
||||||
|
|
|
@ -5,7 +5,6 @@ import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import textwrap
|
import textwrap
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
from test import support
|
from test import support
|
||||||
from test.support import os_helper
|
from test.support import os_helper
|
||||||
|
|
|
@ -7,7 +7,6 @@ import unittest
|
||||||
import subprocess
|
import subprocess
|
||||||
import sysconfig
|
import sysconfig
|
||||||
from test import support
|
from test import support
|
||||||
from test.support import os_helper
|
|
||||||
|
|
||||||
|
|
||||||
MS_WINDOWS = (sys.platform == 'win32')
|
MS_WINDOWS = (sys.platform == 'win32')
|
||||||
|
|
|
@ -4,7 +4,6 @@ machinery = util.import_importlib('importlib.machinery')
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(util.BUILTINS.good_name is None, 'no reasonable builtin module')
|
@unittest.skipIf(util.BUILTINS.good_name is None, 'no reasonable builtin module')
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from warnings import catch_warnings
|
|
||||||
from test.test_importlib import abc, util
|
from test.test_importlib import abc, util
|
||||||
|
|
||||||
machinery = util.import_importlib('importlib.machinery')
|
machinery = util.import_importlib('importlib.machinery')
|
||||||
|
@ -10,7 +9,6 @@ import unittest
|
||||||
import warnings
|
import warnings
|
||||||
import importlib.util
|
import importlib.util
|
||||||
import importlib
|
import importlib
|
||||||
from test.support.script_helper import assert_python_failure
|
|
||||||
|
|
||||||
|
|
||||||
class LoaderTests:
|
class LoaderTests:
|
||||||
|
|
|
@ -2,11 +2,8 @@ from test.test_importlib import abc, util
|
||||||
|
|
||||||
machinery = util.import_importlib('importlib.machinery')
|
machinery = util.import_importlib('importlib.machinery')
|
||||||
|
|
||||||
import _imp
|
|
||||||
import marshal
|
|
||||||
import os.path
|
import os.path
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
from test.support import import_helper, REPO_ROOT, STDLIB_DIR
|
from test.support import import_helper, REPO_ROOT, STDLIB_DIR
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@ from test.test_importlib import abc, util
|
||||||
machinery = util.import_importlib('importlib.machinery')
|
machinery = util.import_importlib('importlib.machinery')
|
||||||
|
|
||||||
from test.support import captured_stdout, import_helper, STDLIB_DIR
|
from test.support import captured_stdout, import_helper, STDLIB_DIR
|
||||||
import _imp
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import marshal
|
|
||||||
import os.path
|
import os.path
|
||||||
import types
|
import types
|
||||||
import unittest
|
import unittest
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
from importlib import machinery
|
from importlib import machinery
|
||||||
import sys
|
|
||||||
import types
|
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
from test.test_importlib import util
|
from test.test_importlib import util
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ machinery = util.import_importlib('importlib.machinery')
|
||||||
import os
|
import os
|
||||||
from test.support import os_helper
|
from test.support import os_helper
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
|
|
||||||
@util.case_insensitive_tests
|
@util.case_insensitive_tests
|
||||||
|
|
|
@ -10,7 +10,6 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from test.support.import_helper import make_legacy_pyc
|
from test.support.import_helper import make_legacy_pyc
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
|
|
||||||
class FinderTests(abc.FinderTests):
|
class FinderTests(abc.FinderTests):
|
||||||
|
|
|
@ -10,7 +10,6 @@ from test.support import import_helper
|
||||||
from test.support import os_helper
|
from test.support import os_helper
|
||||||
import types
|
import types
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
|
|
||||||
class ImportModuleTests:
|
class ImportModuleTests:
|
||||||
|
|
|
@ -4,7 +4,6 @@ import unittest
|
||||||
import warnings
|
import warnings
|
||||||
import importlib.metadata
|
import importlib.metadata
|
||||||
import contextlib
|
import contextlib
|
||||||
import itertools
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pyfakefs.fake_filesystem_unittest as ffs
|
import pyfakefs.fake_filesystem_unittest as ffs
|
||||||
|
|
|
@ -6,7 +6,6 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
|
|
||||||
from test.test_importlib import util
|
from test.test_importlib import util
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ import time
|
||||||
import shutil
|
import shutil
|
||||||
import threading
|
import threading
|
||||||
import unittest
|
import unittest
|
||||||
from unittest import mock
|
|
||||||
from test.support import verbose
|
from test.support import verbose
|
||||||
from test.support.import_helper import forget, mock_register_at_fork
|
from test.support.import_helper import forget, mock_register_at_fork
|
||||||
from test.support.os_helper import (TESTFN, unlink, rmtree)
|
from test.support.os_helper import (TESTFN, unlink, rmtree)
|
||||||
|
|
|
@ -5,7 +5,6 @@ import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
|
||||||
from test.support import import_helper
|
from test.support import import_helper
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from test.test_importlib.util import temp_module
|
from test.test_importlib.util import temp_module
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import contextlib
|
|
||||||
import collections.abc
|
import collections.abc
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -23,7 +23,6 @@ from shutil import (make_archive,
|
||||||
unregister_unpack_format, get_unpack_formats,
|
unregister_unpack_format, get_unpack_formats,
|
||||||
SameFileError, _GiveupOnFastCopy)
|
SameFileError, _GiveupOnFastCopy)
|
||||||
import tarfile
|
import tarfile
|
||||||
import warnings
|
|
||||||
import zipfile
|
import zipfile
|
||||||
try:
|
try:
|
||||||
import posix
|
import posix
|
||||||
|
|
|
@ -6,7 +6,6 @@ from test.support import warnings_helper, captured_stdout
|
||||||
|
|
||||||
import traceback
|
import traceback
|
||||||
import unittest
|
import unittest
|
||||||
from unittest import mock
|
|
||||||
from unittest.util import strclass
|
from unittest.util import strclass
|
||||||
from test.test_unittest.support import BufferedWriter
|
from test.test_unittest.support import BufferedWriter
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue