gh-118761: Add test_lazy_import for more modules (#133057)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Daniel Hollas 2025-05-05 23:46:05 +01:00 committed by GitHub
parent b1aa515bd6
commit cae660d6dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 139 additions and 11 deletions

View file

@ -6,7 +6,8 @@ import unittest.mock
from functools import partial
from test import support
from test.support import os_helper
from test.support import cpython_only, os_helper
from test.support.import_helper import ensure_lazy_imports
# TODO:
@ -931,6 +932,10 @@ class MiscTestCase(unittest.TestCase):
support.check__all__(self, gettext,
not_exported={'c2py', 'ENOENT'})
@cpython_only
def test_lazy_import(self):
ensure_lazy_imports("gettext", {"re", "warnings", "locale"})
if __name__ == '__main__':
unittest.main()