aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorDaniel Hollas <daniel.hollas@bristol.ac.uk>2025-05-05 23:46:05 +0100
committerGitHub <noreply@github.com>2025-05-05 22:46:05 +0000
commitcae660d6dc0d7ba3f66970ef2f2faf1b93869e91 (patch)
treeb6eac99337845902bf11faa148c37fea83a3075c /Lib/test/test_threading.py
parentb1aa515bd6b645202eda4ca07e85d92e19b1534d (diff)
downloadcpython-cae660d6dc0d7ba3f66970ef2f2faf1b93869e91.tar.gz
cpython-cae660d6dc0d7ba3f66970ef2f2faf1b93869e91.zip
gh-118761: Add test_lazy_import for more modules (#133057)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 814c00ca0fd..4ab38c2598b 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -5,7 +5,7 @@ Tests for the threading module.
import test.support
from test.support import threading_helper, requires_subprocess, requires_gil_enabled
from test.support import verbose, cpython_only, os_helper
-from test.support.import_helper import import_module
+from test.support.import_helper import ensure_lazy_imports, import_module
from test.support.script_helper import assert_python_ok, assert_python_failure
from test.support import force_not_colorized
@@ -121,6 +121,10 @@ class ThreadTests(BaseTestCase):
maxDiff = 9999
@cpython_only
+ def test_lazy_import(self):
+ ensure_lazy_imports("threading", {"functools", "warnings"})
+
+ @cpython_only
def test_name(self):
def func(): pass