summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-29 23:48:37 (GMT)
committerGitHub <noreply@github.com>2020-04-29 23:48:37 (GMT)
commit57572b103ebd8732ac21922f0051a7f140d0e405 (patch)
treea8e74f2774656002b1c6247bd5f0b4ca98e99140 /Lib/test
parent69e802ed812e38cb68a4ab74af64b4f719b6cc78 (diff)
downloadcpython-57572b103ebd8732ac21922f0051a7f140d0e405.zip
cpython-57572b103ebd8732ac21922f0051a7f140d0e405.tar.gz
cpython-57572b103ebd8732ac21922f0051a7f140d0e405.tar.bz2
bpo-40443: Remove unused imports in tests (GH-19805)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_parser.py1
-rw-r--r--Lib/test/test_peg_parser.py3
-rw-r--r--Lib/test/test_platform.py1
-rw-r--r--Lib/test/test_positional_only_arg.py1
-rw-r--r--Lib/test/test_pstats.py1
-rw-r--r--Lib/test/test_re.py2
-rw-r--r--Lib/test/test_regrtest.py1
-rw-r--r--Lib/test/test_string_literals.py2
-rw-r--r--Lib/test/test_support.py1
-rw-r--r--Lib/test/test_syntax.py1
-rw-r--r--Lib/test/test_tempfile.py1
-rw-r--r--Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py1
-rw-r--r--Lib/test/test_tools/test_lll.py1
-rw-r--r--Lib/test/test_tools/test_pathfix.py2
-rw-r--r--Lib/test/test_typing.py2
-rw-r--r--Lib/test/test_unparse.py1
-rw-r--r--Lib/test/test_uuid.py2
17 files changed, 4 insertions, 20 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index fd33d65..a4d2cdc 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -8,7 +8,6 @@ import pickle
import unittest
import operator
import struct
-import sys
from test import support
from test.support.script_helper import assert_python_failure
from test.support.script_helper import assert_python_ok
diff --git a/Lib/test/test_peg_parser.py b/Lib/test/test_peg_parser.py
index 43d30ba..1914944 100644
--- a/Lib/test/test_peg_parser.py
+++ b/Lib/test/test_peg_parser.py
@@ -1,9 +1,6 @@
import ast
-import os
-import sys
import _peg_parser as peg_parser
import unittest
-from pathlib import PurePath
from typing import Any, Union, Iterable, Tuple
from textwrap import dedent
from test import support
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index 998f1e0..7664b38 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -3,7 +3,6 @@ import platform
import subprocess
import sys
import unittest
-import collections
from unittest import mock
from test import support
diff --git a/Lib/test/test_positional_only_arg.py b/Lib/test/test_positional_only_arg.py
index 4d5fb6b..f7bd401 100644
--- a/Lib/test/test_positional_only_arg.py
+++ b/Lib/test/test_positional_only_arg.py
@@ -3,7 +3,6 @@
import dis
import pickle
import unittest
-import sys
from test.support import check_syntax_error, use_old_parser
diff --git a/Lib/test/test_pstats.py b/Lib/test/test_pstats.py
index f3a6e58..10559de 100644
--- a/Lib/test/test_pstats.py
+++ b/Lib/test/test_pstats.py
@@ -5,7 +5,6 @@ from io import StringIO
from pstats import SortKey
import pstats
-import time
import cProfile
class AddCallersTestCase(unittest.TestCase):
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 4817d76..1bfbcb8 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -2217,7 +2217,7 @@ class ExternalTests(unittest.TestCase):
def test_re_tests(self):
're_tests test suite'
- from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
+ from test.re_tests import tests, FAIL, SYNTAX_ERROR
for t in tests:
pattern = s = outcome = repl = expected = None
if len(t) == 5:
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index 93f8d44..de209da 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -5,7 +5,6 @@ Note: test_regrtest cannot be run twice in parallel.
"""
import contextlib
-import faulthandler
import glob
import io
import os.path
diff --git a/Lib/test/test_string_literals.py b/Lib/test/test_string_literals.py
index 5a2fb8b..5b5477d 100644
--- a/Lib/test/test_string_literals.py
+++ b/Lib/test/test_string_literals.py
@@ -33,7 +33,7 @@ import shutil
import tempfile
import unittest
import warnings
-from test.support import check_syntax_warning, use_old_parser
+from test.support import use_old_parser
TEMPLATE = r"""# coding: %s
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 606e570..b5a16f9 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -1,4 +1,3 @@
-import contextlib
import errno
import importlib
import io
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index aff8dd7..e7468ca 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -644,7 +644,6 @@ Corner-cases that used to crash:
"""
import re
-import sys
import unittest
from test import support
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index 69d5de2..fcc706e 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -4,7 +4,6 @@ import errno
import io
import os
import pathlib
-import signal
import sys
import re
import warnings
diff --git a/Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py b/Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py
index 56a1c9c..b7f950f 100644
--- a/Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py
+++ b/Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py
@@ -1,4 +1,3 @@
-import itertools
import textwrap
import unittest
import sys
diff --git a/Lib/test/test_tools/test_lll.py b/Lib/test/test_tools/test_lll.py
index b01e218..568cbfb 100644
--- a/Lib/test/test_tools/test_lll.py
+++ b/Lib/test/test_tools/test_lll.py
@@ -1,7 +1,6 @@
"""Tests for the lll script in the Tools/script directory."""
import os
-import sys
import tempfile
from test import support
from test.test_tools import skip_if_missing, import_tool
diff --git a/Lib/test/test_tools/test_pathfix.py b/Lib/test/test_tools/test_pathfix.py
index ec36117..8b41930 100644
--- a/Lib/test/test_tools/test_pathfix.py
+++ b/Lib/test/test_tools/test_pathfix.py
@@ -3,7 +3,7 @@ import subprocess
import sys
import unittest
from test import support
-from test.test_tools import import_tool, scriptsdir, skip_if_missing
+from test.test_tools import scriptsdir, skip_if_missing
# need Tools/script/ directory: skip if run on Python installed on the system
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index f191d3b..cab8de0 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -3,7 +3,7 @@ import collections
import pickle
import re
import sys
-from unittest import TestCase, main, skipUnless, SkipTest, skip
+from unittest import TestCase, main, skipUnless, skip
from copy import copy, deepcopy
from typing import Any, NoReturn
diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py
index 3bacd67..b913569 100644
--- a/Lib/test/test_unparse.py
+++ b/Lib/test/test_unparse.py
@@ -6,7 +6,6 @@ import pathlib
import random
import tokenize
import ast
-import sys
def read_pyfile(filename):
diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py
index 0b267f4..ac166ce 100644
--- a/Lib/test/test_uuid.py
+++ b/Lib/test/test_uuid.py
@@ -6,8 +6,6 @@ import copy
import io
import os
import pickle
-import shutil
-import subprocess
import sys
import weakref
from unittest import mock