Skip to content

Commit b1e11c3

Browse files
authored
bpo-40443: Remove unused imports in tests (GH-19804)
1 parent 57572b1 commit b1e11c3

18 files changed

+2
-20
lines changed

Lib/distutils/tests/test_build_clib.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from distutils.command.build_clib import build_clib
99
from distutils.errors import DistutilsSetupError
1010
from distutils.tests import support
11-
from distutils.spawn import find_executable
1211

1312
class BuildCLibTestCase(support.TempdirManager,
1413
support.LoggingSilencer,

Lib/distutils/tests/test_config_cmd.py

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def test_dump_file(self):
3939

4040
@unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
4141
def test_search_cpp(self):
42-
import shutil
4342
cmd = missing_compiler_executable(['preprocessor'])
4443
if cmd is not None:
4544
self.skipTest('The %r command is not found' % cmd)

Lib/distutils/tests/test_dist.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from unittest import mock
1010

11-
from distutils.dist import Distribution, fix_help_options, DistributionMetadata
11+
from distutils.dist import Distribution, fix_help_options
1212
from distutils.cmd import Command
1313

1414
from test.support import (

Lib/distutils/tests/test_spawn.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import os
33
import stat
44
import sys
5-
import unittest
6-
from unittest import mock
5+
import unittest.mock
76
from test.support import run_unittest, unix_shell
87
from test import support as test_support
98

Lib/test/test_array.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import operator
1111
import struct
1212
import sys
13-
import warnings
1413

1514
import array
1615
from array import _array_reconstructor as array_reconstructor

Lib/test/test_asyncio/test_base_events.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import concurrent.futures
44
import errno
55
import math
6-
import os
76
import socket
87
import sys
98
import threading

Lib/test/test_asyncio/test_server.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import threading
44
import unittest
55

6-
from test import support
76
from test.support import socket_helper
87
from test.test_asyncio import utils as test_utils
98
from test.test_asyncio import functional as func_tests

Lib/test/test_asyncio/test_sslproto.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import logging
44
import socket
5-
import sys
65
from test import support
76
import unittest
87
import weakref

Lib/test/test_call.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import datetime
21
import unittest
32
from test.support import cpython_only
43
try:

Lib/test/test_code.py

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@
130130
import threading
131131
import unittest
132132
import weakref
133-
import opcode
134133
try:
135134
import ctypes
136135
except ImportError:

Lib/test/test_compileall.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import time
1212
import unittest
1313
import io
14-
import errno
1514

1615
from unittest import mock, skipUnless
1716
try:

Lib/test/test_flufl.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import __future__
22
import unittest
3-
import sys
43
from test import support
54

65

Lib/test/test_fractions.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import functools
1010
import sys
1111
import unittest
12-
import warnings
1312
from copy import copy, deepcopy
1413
from pickle import dumps, loads
1514
F = fractions.Fraction

Lib/test/test_fstring.py

-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
import ast
1111
import types
1212
import decimal
13-
import sys
1413
import unittest
15-
from test import support
1614

1715
a_global = 'global variable'
1816

Lib/test/test_hashlib.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import array
1010
from binascii import unhexlify
11-
import functools
1211
import hashlib
1312
import importlib
1413
import itertools

Lib/test/test_ipaddress.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import unittest
88
import re
99
import contextlib
10-
import functools
1110
import operator
1211
import pickle
1312
import ipaddress

Lib/test/test_logging.py

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import queue
3737
import random
3838
import re
39-
import signal
4039
import socket
4140
import struct
4241
import sys

Lib/test/test_named_expressions.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import unittest
32

43
GLOBAL_VAR = None

0 commit comments

Comments
 (0)