File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
- import lazy_loader as lazy
1
+ from lazy_loader import lazy_import
2
2
3
- __getattr__ , __lazy_dir__ , __all__ = lazy .attach (
4
- __name__ , submod_attrs = {"some_func" : ["some_func" ]}
5
- )
3
+ with lazy_import ():
4
+ from . import some_func # noqa: F401
Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ def test_attach_same_module_and_attr_name():
92
92
93
93
# Grab attribute twice, to ensure that importing it does not
94
94
# override function by module
95
- assert isinstance (fake_pkg .some_func , types .FunctionType )
96
- assert isinstance (fake_pkg .some_func , types .FunctionType )
95
+ assert isinstance (fake_pkg .some_func , types .ModuleType )
96
+ assert isinstance (fake_pkg .some_func , types .ModuleType )
97
97
98
98
# Ensure imports from submodule still work
99
99
from fake_pkg .some_func import some_func
You can’t perform that action at this time.
0 commit comments