aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_string/test_string.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_string/test_string.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_string/test_string.py')
-rw-r--r--Lib/test/test_string/test_string.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_string/test_string.py b/Lib/test/test_string/test_string.py
index f6d112d8a93..5394fe4e12c 100644
--- a/Lib/test/test_string/test_string.py
+++ b/Lib/test/test_string/test_string.py
@@ -2,6 +2,14 @@ import unittest
import string
from string import Template
import types
+from test.support import cpython_only
+from test.support.import_helper import ensure_lazy_imports
+
+
+class LazyImportTest(unittest.TestCase):
+ @cpython_only
+ def test_lazy_import(self):
+ ensure_lazy_imports("base64", {"re", "collections"})
class ModuleTest(unittest.TestCase):