summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-30 00:21:30 (GMT)
committerGitHub <noreply@github.com>2020-04-30 00:21:30 (GMT)
commitb1e11c31c523dc082985e9de779ceeb47224e536 (patch)
treea4f356df1e0228266e885c6ecb5e5dce52baef80
parent57572b103ebd8732ac21922f0051a7f140d0e405 (diff)
downloadcpython-b1e11c31c523dc082985e9de779ceeb47224e536.zip
cpython-b1e11c31c523dc082985e9de779ceeb47224e536.tar.gz
cpython-b1e11c31c523dc082985e9de779ceeb47224e536.tar.bz2
bpo-40443: Remove unused imports in tests (GH-19804)
-rw-r--r--Lib/distutils/tests/test_build_clib.py1
-rw-r--r--Lib/distutils/tests/test_config_cmd.py1
-rw-r--r--Lib/distutils/tests/test_dist.py2
-rw-r--r--Lib/distutils/tests/test_spawn.py3
-rw-r--r--Lib/test/test_array.py1
-rw-r--r--Lib/test/test_asyncio/test_base_events.py1
-rw-r--r--Lib/test/test_asyncio/test_server.py1
-rw-r--r--Lib/test/test_asyncio/test_sslproto.py1
-rw-r--r--Lib/test/test_call.py1
-rw-r--r--Lib/test/test_code.py1
-rw-r--r--Lib/test/test_compileall.py1
-rw-r--r--Lib/test/test_flufl.py1
-rw-r--r--Lib/test/test_fractions.py1
-rw-r--r--Lib/test/test_fstring.py2
-rw-r--r--Lib/test/test_hashlib.py1
-rw-r--r--Lib/test/test_ipaddress.py1
-rw-r--r--Lib/test/test_logging.py1
-rw-r--r--Lib/test/test_named_expressions.py1
18 files changed, 2 insertions, 20 deletions
diff --git a/Lib/distutils/tests/test_build_clib.py b/Lib/distutils/tests/test_build_clib.py
index 85d0990..abd8313 100644
--- a/Lib/distutils/tests/test_build_clib.py
+++ b/Lib/distutils/tests/test_build_clib.py
@@ -8,7 +8,6 @@ from test.support import run_unittest, missing_compiler_executable
from distutils.command.build_clib import build_clib
from distutils.errors import DistutilsSetupError
from distutils.tests import support
-from distutils.spawn import find_executable
class BuildCLibTestCase(support.TempdirManager,
support.LoggingSilencer,
diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/distutils/tests/test_config_cmd.py
index 8bd2c94..9aeab07 100644
--- a/Lib/distutils/tests/test_config_cmd.py
+++ b/Lib/distutils/tests/test_config_cmd.py
@@ -39,7 +39,6 @@ class ConfigTestCase(support.LoggingSilencer,
@unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
def test_search_cpp(self):
- import shutil
cmd = missing_compiler_executable(['preprocessor'])
if cmd is not None:
self.skipTest('The %r command is not found' % cmd)
diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py
index cc34725..60956da 100644
--- a/Lib/distutils/tests/test_dist.py
+++ b/Lib/distutils/tests/test_dist.py
@@ -8,7 +8,7 @@ import textwrap
from unittest import mock
-from distutils.dist import Distribution, fix_help_options, DistributionMetadata
+from distutils.dist import Distribution, fix_help_options
from distutils.cmd import Command
from test.support import (
diff --git a/Lib/distutils/tests/test_spawn.py b/Lib/distutils/tests/test_spawn.py
index 73b0f5c..cf1faad 100644
--- a/Lib/distutils/tests/test_spawn.py
+++ b/Lib/distutils/tests/test_spawn.py
@@ -2,8 +2,7 @@
import os
import stat
import sys
-import unittest
-from unittest import mock
+import unittest.mock
from test.support import run_unittest, unix_shell
from test import support as test_support
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 5f612fb..f731b70 100644
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -10,7 +10,6 @@ import pickle
import operator
import struct
import sys
-import warnings
import array
from array import _array_reconstructor as array_reconstructor
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 4adcbf4..533d5cc 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -3,7 +3,6 @@
import concurrent.futures
import errno
import math
-import os
import socket
import sys
import threading
diff --git a/Lib/test/test_asyncio/test_server.py b/Lib/test/test_asyncio/test_server.py
index 006ead2..2de4dca 100644
--- a/Lib/test/test_asyncio/test_server.py
+++ b/Lib/test/test_asyncio/test_server.py
@@ -3,7 +3,6 @@ import time
import threading
import unittest
-from test import support
from test.support import socket_helper
from test.test_asyncio import utils as test_utils
from test.test_asyncio import functional as func_tests
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
index c716eac..948820c 100644
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -2,7 +2,6 @@
import logging
import socket
-import sys
from test import support
import unittest
import weakref
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index b3077ad..451a717 100644
--- a/Lib/test/test_call.py
+++ b/Lib/test/test_call.py
@@ -1,4 +1,3 @@
-import datetime
import unittest
from test.support import cpython_only
try:
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 7bb824e..ac3dde7 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -130,7 +130,6 @@ import sys
import threading
import unittest
import weakref
-import opcode
try:
import ctypes
except ImportError:
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
index cb59fd7..7267894 100644
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -11,7 +11,6 @@ import tempfile
import time
import unittest
import io
-import errno
from unittest import mock, skipUnless
try:
diff --git a/Lib/test/test_flufl.py b/Lib/test/test_flufl.py
index b714428..2228585 100644
--- a/Lib/test/test_flufl.py
+++ b/Lib/test/test_flufl.py
@@ -1,6 +1,5 @@
import __future__
import unittest
-import sys
from test import support
diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py
index c748533..0845f79 100644
--- a/Lib/test/test_fractions.py
+++ b/Lib/test/test_fractions.py
@@ -9,7 +9,6 @@ import fractions
import functools
import sys
import unittest
-import warnings
from copy import copy, deepcopy
from pickle import dumps, loads
F = fractions.Fraction
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index 4c240f3..fe465b7 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -10,9 +10,7 @@
import ast
import types
import decimal
-import sys
import unittest
-from test import support
a_global = 'global variable'
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 31d8e55..f9fe7e3 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -8,7 +8,6 @@
import array
from binascii import unhexlify
-import functools
import hashlib
import importlib
import itertools
diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py
index bbb3fc8..6d5814c 100644
--- a/Lib/test/test_ipaddress.py
+++ b/Lib/test/test_ipaddress.py
@@ -7,7 +7,6 @@
import unittest
import re
import contextlib
-import functools
import operator
import pickle
import ipaddress
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index e1d0eb8..4cc45f7 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -36,7 +36,6 @@ import os
import queue
import random
import re
-import signal
import socket
import struct
import sys
diff --git a/Lib/test/test_named_expressions.py b/Lib/test/test_named_expressions.py
index 3ae557f..c813830 100644
--- a/Lib/test/test_named_expressions.py
+++ b/Lib/test/test_named_expressions.py
@@ -1,4 +1,3 @@
-import os
import unittest
GLOBAL_VAR = None