summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-30 01:48:37 +0200
committerGitHub <noreply@github.com>2020-04-30 01:48:37 +0200
commit57572b103ebd8732ac21922f0051a7f140d0e405 (patch)
treea8e74f2774656002b1c6247bd5f0b4ca98e99140
parent69e802ed812e38cb68a4ab74af64b4f719b6cc78 (diff)
downloadcpython-git-57572b103ebd8732ac21922f0051a7f140d0e405.tar.gz
bpo-40443: Remove unused imports in tests (GH-19805)
-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 fd33d6529b..a4d2cdc090 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 43d30bae84..191494481e 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 998f1e0dc3..7664b38a72 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 4d5fb6bc61..f7bd401804 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 f3a6e586c3..10559deb6b 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 4817d761a2..1bfbcb853c 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 93f8d44ec6..de209da41a 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 5a2fb8b372..5b5477d14d 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 606e57003e..b5a16f9cb6 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 aff8dd72b7..e7468cae7b 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 69d5de2e1b..fcc706ede5 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 56a1c9c612..b7f950f813 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 b01e2188e1..568cbfb5e4 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 ec361178e6..8b41930734 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 f191d3bb9e..cab8de0f5e 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 3bacd672d4..b913569585 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 0b267f4a97..ac166ced38 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