summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-06-17 19:05:37 (GMT)
committerGitHub <noreply@github.com>2024-06-17 19:05:37 (GMT)
commit5a8a979aeb7c9494949cbe5142d37dc5781a7bde (patch)
treea99d8ccb71de58e2f697ce8716016f8c63c66feb
parentf916b77fea9c6ce88d9be46aab2f3ff715a020f2 (diff)
downloadcpython-5a8a979aeb7c9494949cbe5142d37dc5781a7bde.zip
cpython-5a8a979aeb7c9494949cbe5142d37dc5781a7bde.tar.gz
cpython-5a8a979aeb7c9494949cbe5142d37dc5781a7bde.tar.bz2
gh-120417: Remove unused imports in tests (part 2) (#120630)
-rw-r--r--Lib/test/test_dbm_sqlite3.py3
-rw-r--r--Lib/test/test_decorators.py2
-rw-r--r--Lib/test/test_email/test_headerregistry.py1
-rw-r--r--Lib/test/test_email/test_utils.py4
-rw-r--r--Lib/test/test_ensurepip.py1
-rw-r--r--Lib/test/test_fractions.py1
-rw-r--r--Lib/test/test_frame.py4
-rw-r--r--Lib/test/test_free_threading/test_str.py1
-rw-r--r--Lib/test/test_free_threading/test_type.py2
-rw-r--r--Lib/test/test_fstring.py1
10 files changed, 5 insertions, 15 deletions
diff --git a/Lib/test/test_dbm_sqlite3.py b/Lib/test/test_dbm_sqlite3.py
index 7a49fd2..2e1f2d3 100644
--- a/Lib/test/test_dbm_sqlite3.py
+++ b/Lib/test/test_dbm_sqlite3.py
@@ -1,10 +1,9 @@
import sys
-import test.support
import unittest
from contextlib import closing
from functools import partial
from pathlib import Path
-from test.support import cpython_only, import_helper, os_helper
+from test.support import import_helper, os_helper
dbm_sqlite3 = import_helper.import_module("dbm.sqlite3")
# N.B. The test will fail on some platforms without sqlite3
diff --git a/Lib/test/test_decorators.py b/Lib/test/test_decorators.py
index 3a4fc95..78361be 100644
--- a/Lib/test/test_decorators.py
+++ b/Lib/test/test_decorators.py
@@ -1,5 +1,5 @@
import unittest
-from types import MethodType
+
def funcattrs(**kwds):
def decorate(func):
diff --git a/Lib/test/test_email/test_headerregistry.py b/Lib/test/test_email/test_headerregistry.py
index 5a608a0..4c0523f 100644
--- a/Lib/test/test_email/test_headerregistry.py
+++ b/Lib/test/test_email/test_headerregistry.py
@@ -7,7 +7,6 @@ from email.message import Message
from test.test_email import TestEmailBase, parameterize
from email import headerregistry
from email.headerregistry import Address, Group
-from email.header import decode_header
from test.support import ALWAYS_EQ
diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py
index 8556a93..4e6201e 100644
--- a/Lib/test/test_email/test_utils.py
+++ b/Lib/test/test_email/test_utils.py
@@ -3,9 +3,7 @@ from email import utils
import test.support
import time
import unittest
-import sys
-import os.path
-import zoneinfo
+
class DateTimeTests(unittest.TestCase):
diff --git a/Lib/test/test_ensurepip.py b/Lib/test/test_ensurepip.py
index a4b36a9..6d3c91b 100644
--- a/Lib/test/test_ensurepip.py
+++ b/Lib/test/test_ensurepip.py
@@ -6,7 +6,6 @@ import tempfile
import test.support
import unittest
import unittest.mock
-from importlib.resources.abc import Traversable
from pathlib import Path
import ensurepip
diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py
index 71865f6..5896692 100644
--- a/Lib/test/test_fractions.py
+++ b/Lib/test/test_fractions.py
@@ -1,6 +1,5 @@
"""Tests for Lib/fractions.py."""
-import cmath
from decimal import Decimal
from test.support import requires_IEEE_754
import math
diff --git a/Lib/test/test_frame.py b/Lib/test/test_frame.py
index aee8d37..42f9382 100644
--- a/Lib/test/test_frame.py
+++ b/Lib/test/test_frame.py
@@ -1,11 +1,9 @@
import copy
-import gc
import operator
import re
import sys
import textwrap
import threading
-import types
import unittest
import weakref
try:
@@ -14,7 +12,7 @@ except ImportError:
_testcapi = None
from test import support
-from test.support import import_helper, threading_helper, Py_GIL_DISABLED
+from test.support import import_helper, threading_helper
from test.support.script_helper import assert_python_ok
diff --git a/Lib/test/test_free_threading/test_str.py b/Lib/test/test_free_threading/test_str.py
index f5e93b7..72044e9 100644
--- a/Lib/test/test_free_threading/test_str.py
+++ b/Lib/test/test_free_threading/test_str.py
@@ -1,4 +1,3 @@
-import sys
import unittest
from itertools import cycle
diff --git a/Lib/test/test_free_threading/test_type.py b/Lib/test/test_free_threading/test_type.py
index 1e84b2d..7525979 100644
--- a/Lib/test/test_free_threading/test_type.py
+++ b/Lib/test/test_free_threading/test_type.py
@@ -5,7 +5,7 @@ from concurrent.futures import ThreadPoolExecutor
from threading import Thread
from unittest import TestCase
-from test.support import threading_helper, import_helper
+from test.support import threading_helper
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index 27c7f70..49c6f76 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -14,7 +14,6 @@ import re
import types
import decimal
import unittest
-import warnings
from test import support
from test.support.os_helper import temp_cwd
from test.support.script_helper import assert_python_failure, assert_python_ok