Skip to content

Commit 8ea0525

Browse files
vstinnerestyxx
authored andcommitted
pythongh-120417: Remove unused imports in tests (part 2) (python#120630)
1 parent 15a194d commit 8ea0525

File tree

10 files changed

+5
-15
lines changed

10 files changed

+5
-15
lines changed

Lib/test/test_dbm_sqlite3.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import sys
2-
import test.support
32
import unittest
43
from contextlib import closing
54
from functools import partial
65
from pathlib import Path
7-
from test.support import cpython_only, import_helper, os_helper
6+
from test.support import import_helper, os_helper
87

98
dbm_sqlite3 = import_helper.import_module("dbm.sqlite3")
109
# N.B. The test will fail on some platforms without sqlite3

Lib/test/test_decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from types import MethodType
2+
33

44
def funcattrs(**kwds):
55
def decorate(func):

Lib/test/test_email/test_headerregistry.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from test.test_email import TestEmailBase, parameterize
88
from email import headerregistry
99
from email.headerregistry import Address, Group
10-
from email.header import decode_header
1110
from test.support import ALWAYS_EQ
1211

1312

Lib/test/test_email/test_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import test.support
44
import time
55
import unittest
6-
import sys
7-
import os.path
8-
import zoneinfo
6+
97

108
class DateTimeTests(unittest.TestCase):
119

Lib/test/test_ensurepip.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import test.support
77
import unittest
88
import unittest.mock
9-
from importlib.resources.abc import Traversable
109
from pathlib import Path
1110

1211
import ensurepip

Lib/test/test_fractions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Tests for Lib/fractions.py."""
22

3-
import cmath
43
from decimal import Decimal
54
from test.support import requires_IEEE_754
65
import math

Lib/test/test_frame.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import copy
2-
import gc
32
import operator
43
import re
54
import sys
65
import textwrap
76
import threading
8-
import types
97
import unittest
108
import weakref
119
try:
@@ -14,7 +12,7 @@
1412
_testcapi = None
1513

1614
from test import support
17-
from test.support import import_helper, threading_helper, Py_GIL_DISABLED
15+
from test.support import import_helper, threading_helper
1816
from test.support.script_helper import assert_python_ok
1917

2018

Lib/test/test_free_threading/test_str.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
import unittest
32

43
from itertools import cycle

Lib/test/test_free_threading/test_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from threading import Thread
66
from unittest import TestCase
77

8-
from test.support import threading_helper, import_helper
8+
from test.support import threading_helper
99

1010

1111

Lib/test/test_fstring.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import types
1515
import decimal
1616
import unittest
17-
import warnings
1817
from test import support
1918
from test.support.os_helper import temp_cwd
2019
from test.support.script_helper import assert_python_failure, assert_python_ok

0 commit comments

Comments
 (0)