Skip to content

Commit 57572b1

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

17 files changed

+4
-20
lines changed

Lib/test/test_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import unittest
99
import operator
1010
import struct
11-
import sys
1211
from test import support
1312
from test.support.script_helper import assert_python_failure
1413
from test.support.script_helper import assert_python_ok

Lib/test/test_peg_parser.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import ast
2-
import os
3-
import sys
42
import _peg_parser as peg_parser
53
import unittest
6-
from pathlib import PurePath
74
from typing import Any, Union, Iterable, Tuple
85
from textwrap import dedent
96
from test import support

Lib/test/test_platform.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import subprocess
44
import sys
55
import unittest
6-
import collections
76
from unittest import mock
87

98
from test import support

Lib/test/test_positional_only_arg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import dis
44
import pickle
55
import unittest
6-
import sys
76

87
from test.support import check_syntax_error, use_old_parser
98

Lib/test/test_pstats.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from pstats import SortKey
66

77
import pstats
8-
import time
98
import cProfile
109

1110
class AddCallersTestCase(unittest.TestCase):

Lib/test/test_re.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ def test_re_benchmarks(self):
22172217

22182218
def test_re_tests(self):
22192219
're_tests test suite'
2220-
from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
2220+
from test.re_tests import tests, FAIL, SYNTAX_ERROR
22212221
for t in tests:
22222222
pattern = s = outcome = repl = expected = None
22232223
if len(t) == 5:

Lib/test/test_regrtest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"""
66

77
import contextlib
8-
import faulthandler
98
import glob
109
import io
1110
import os.path

Lib/test/test_string_literals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import tempfile
3434
import unittest
3535
import warnings
36-
from test.support import check_syntax_warning, use_old_parser
36+
from test.support import use_old_parser
3737

3838

3939
TEMPLATE = r"""# coding: %s

Lib/test/test_support.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import contextlib
21
import errno
32
import importlib
43
import io

Lib/test/test_syntax.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,6 @@
644644
"""
645645

646646
import re
647-
import sys
648647
import unittest
649648

650649
from test import support

0 commit comments

Comments
 (0)