https://github.com/python/cpython/commit/c608477532c56decd70afd5c5390973bda6df58f
commit: c608477532c56decd70afd5c5390973bda6df58f
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2024-06-17T21:05:56+02:00
summary:
gh-120417: Remove unused imports in tests (part 1) (#120629)
files:
M Lib/test/_test_embed_set_config.py
M Lib/test/support/__init__.py
M Lib/test/test___all__.py
M Lib/test/test_call.py
M Lib/test/test_capi/test_list.py
M Lib/test/test_capi/test_misc.py
M Lib/test/test_capi/test_structmembers.py
M Lib/test/test_concurrent_futures/executor.py
M Lib/test/test_ctypes/test_generated_structs.py
M Lib/test/test_ctypes/test_structures.py
diff --git a/Lib/test/_test_embed_set_config.py
b/Lib/test/_test_embed_set_config.py
index 5ff521892cb6fe..23423d5b7a583d 100644
--- a/Lib/test/_test_embed_set_config.py
+++ b/Lib/test/_test_embed_set_config.py
@@ -6,7 +6,6 @@
# (before the site module is run).
import _testinternalcapi
-import os
import sys
import unittest
from test import support
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index adc6362e20df00..a045c88d7f4af0 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -4,7 +4,6 @@
raise ImportError('support must be imported from the test package')
import contextlib
-import dataclasses
import functools
import _opcode
import os
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 19dcbb207e914a..b40622efe4611e 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -3,7 +3,6 @@
from test.support import warnings_helper
import os
import sys
-import types
if support.check_sanitizer(address=True, memory=True):
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index 7ea27929138da3..504f8800a00aa5 100644
--- a/Lib/test/test_call.py
+++ b/Lib/test/test_call.py
@@ -1,6 +1,6 @@
import unittest
from test.support import (cpython_only, is_wasi, requires_limited_api,
Py_DEBUG,
- set_recursion_limit, skip_on_s390x, import_helper)
+ set_recursion_limit, skip_on_s390x)
try:
import _testcapi
except ImportError:
@@ -14,7 +14,6 @@
import itertools
import gc
import contextlib
-import sys
import types
diff --git a/Lib/test/test_capi/test_list.py b/Lib/test/test_capi/test_list.py
index 0896a971f5c727..83e41205bc9d12 100644
--- a/Lib/test/test_capi/test_list.py
+++ b/Lib/test/test_capi/test_list.py
@@ -1,5 +1,3 @@
-import gc
-import weakref
import unittest
from test.support import import_helper
from collections import UserList
diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py
index 0dc0b530aec971..9de97c0c2c776a 100644
--- a/Lib/test/test_capi/test_misc.py
+++ b/Lib/test/test_capi/test_misc.py
@@ -17,7 +17,6 @@
import time
import types
import unittest
-import warnings
import weakref
import operator
from test import support
diff --git a/Lib/test/test_capi/test_structmembers.py
b/Lib/test/test_capi/test_structmembers.py
index 08ca1f828529cf..6b27dc512a7d15 100644
--- a/Lib/test/test_capi/test_structmembers.py
+++ b/Lib/test/test_capi/test_structmembers.py
@@ -1,6 +1,5 @@
import unittest
from test.support import import_helper
-from test.support import warnings_helper
# Skip this test if the _testcapi module isn't available.
import_helper.import_module('_testcapi')
diff --git a/Lib/test/test_concurrent_futures/executor.py
b/Lib/test/test_concurrent_futures/executor.py
index 3049bb74861439..4160656cb133ab 100644
--- a/Lib/test/test_concurrent_futures/executor.py
+++ b/Lib/test/test_concurrent_futures/executor.py
@@ -1,6 +1,5 @@
import threading
import time
-import unittest
import weakref
from concurrent import futures
from test import support
diff --git a/Lib/test/test_ctypes/test_generated_structs.py
b/Lib/test/test_ctypes/test_generated_structs.py
index f93371c067e8bd..cbd73c4e911e4e 100644
--- a/Lib/test/test_ctypes/test_generated_structs.py
+++ b/Lib/test/test_ctypes/test_generated_structs.py
@@ -14,10 +14,9 @@
import re
from dataclasses import dataclass
from functools import cached_property
-import sys
import ctypes
-from ctypes import Structure, Union, _SimpleCData
+from ctypes import Structure, Union
from ctypes import sizeof, alignment, pointer, string_at
_ctypes_test = import_helper.import_module("_ctypes_test")
diff --git a/Lib/test/test_ctypes/test_structures.py
b/Lib/test/test_ctypes/test_structures.py
index 7650c80273f812..6cc09c8f2b5b59 100644
--- a/Lib/test/test_ctypes/test_structures.py
+++ b/Lib/test/test_ctypes/test_structures.py
@@ -2,7 +2,7 @@
import struct
import sys
import unittest
-from ctypes import (CDLL, Array, Structure, Union, POINTER, sizeof, byref,
alignment,
+from ctypes import (CDLL, Structure, Union, POINTER, sizeof, byref, alignment,
c_void_p, c_char, c_wchar, c_byte, c_ubyte,
c_uint8, c_uint16, c_uint32,
c_short, c_ushort, c_int, c_uint,
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]