bpo-40443: Remove unused imports in tests (GH-19804) · python/cpython@b1e11c3 (original) (raw)

18 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
8 8 from distutils.command.build_clib import build_clib
9 9 from distutils.errors import DistutilsSetupError
10 10 from distutils.tests import support
11 -from distutils.spawn import find_executable
12 11
13 12 class BuildCLibTestCase(support.TempdirManager,
14 13 support.LoggingSilencer,
Original file line number Diff line number Diff line change
@@ -39,7 +39,6 @@ def test_dump_file(self):
39 39
40 40 @unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
41 41 def test_search_cpp(self):
42 -import shutil
43 42 cmd = missing_compiler_executable(['preprocessor'])
44 43 if cmd is not None:
45 44 self.skipTest('The %r command is not found' % cmd)
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
8 8
9 9 from unittest import mock
10 10
11 -from distutils.dist import Distribution, fix_help_options, DistributionMetadata
11 +from distutils.dist import Distribution, fix_help_options
12 12 from distutils.cmd import Command
13 13
14 14 from test.support import (
Original file line number Diff line number Diff line change
@@ -2,8 +2,7 @@
2 2 import os
3 3 import stat
4 4 import sys
5 -import unittest
6 -from unittest import mock
5 +import unittest.mock
7 6 from test.support import run_unittest, unix_shell
8 7 from test import support as test_support
9 8
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
10 10 import operator
11 11 import struct
12 12 import sys
13 -import warnings
14 13
15 14 import array
16 15 from array import _array_reconstructor as array_reconstructor
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
3 3 import concurrent.futures
4 4 import errno
5 5 import math
6 -import os
7 6 import socket
8 7 import sys
9 8 import threading
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
3 3 import threading
4 4 import unittest
5 5
6 -from test import support
7 6 from test.support import socket_helper
8 7 from test.test_asyncio import utils as test_utils
9 8 from test.test_asyncio import functional as func_tests
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
2 2
3 3 import logging
4 4 import socket
5 -import sys
6 5 from test import support
7 6 import unittest
8 7 import weakref
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
1 -import datetime
2 1 import unittest
3 2 from test.support import cpython_only
4 3 try:
Original file line number Diff line number Diff line change
@@ -130,7 +130,6 @@
130 130 import threading
131 131 import unittest
132 132 import weakref
133 -import opcode
134 133 try:
135 134 import ctypes
136 135 except ImportError:
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
11 11 import time
12 12 import unittest
13 13 import io
14 -import errno
15 14
16 15 from unittest import mock, skipUnless
17 16 try:
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
1 1 import __future__
2 2 import unittest
3 -import sys
4 3 from test import support
5 4
6 5
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
9 9 import functools
10 10 import sys
11 11 import unittest
12 -import warnings
13 12 from copy import copy, deepcopy
14 13 from pickle import dumps, loads
15 14 F = fractions.Fraction
Original file line number Diff line number Diff line change
@@ -10,9 +10,7 @@
10 10 import ast
11 11 import types
12 12 import decimal
13 -import sys
14 13 import unittest
15 -from test import support
16 14
17 15 a_global = 'global variable'
18 16
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
8 8
9 9 import array
10 10 from binascii import unhexlify
11 -import functools
12 11 import hashlib
13 12 import importlib
14 13 import itertools
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
7 7 import unittest
8 8 import re
9 9 import contextlib
10 -import functools
11 10 import operator
12 11 import pickle
13 12 import ipaddress
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@
36 36 import queue
37 37 import random
38 38 import re
39 -import signal
40 39 import socket
41 40 import struct
42 41 import sys
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
1 -import os
2 1 import unittest
3 2
4 3 GLOBAL_VAR = None