We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a7a4f2 commit c0323ccCopy full SHA for c0323cc
1 file changed
Lib/test/test_import/test_lazy_imports.py
@@ -386,6 +386,11 @@ def test_dunder_lazy_import(self):
386
import test.test_import.data.lazy_imports.dunder_lazy_import
387
self.assertNotIn("test.test_import.data.lazy_imports.basic2", sys.modules)
388
389
+ def test_dunder_lazy_import_with_custom_filter(self):
390
+ sys.set_lazy_imports_filter(lambda importer, imported, fromlist: False)
391
+ import test.test_import.data.lazy_imports.dunder_lazy_import
392
+ self.assertIn("test.test_import.data.lazy_imports.basic2", sys.modules)
393
+
394
def test_dunder_lazy_import_used(self):
395
"""Using __lazy_import__ result should trigger module load."""
396
import test.test_import.data.lazy_imports.dunder_lazy_import_used
0 commit comments