File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
tests/packages/cmake_generated/src/cmake_generated/nested1 Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11"""Try to open both generated and static files from various parts of the package."""
22import sys
33from importlib.resources import files, read_text
4+ from types import ModuleType
45
56from .. import __version__
67
78try:
89 from .. import nested2
9- except ImportError:
10+ except ImportError as e :
1011 nested2 = None
12+ import_error = e.msg
13+ else:
14+ import_error = None
1115
1216def cmake_generated_static_data():
1317 return read_text("cmake_generated", "static_data").rstrip()
@@ -33,5 +37,7 @@ def cmake_generated_namespace_generated_data():
3337nested_data = "success"
3438
3539def nested2_check():
36- if nested2 is not None:
37- return "success"
40+ if import_error is not None:
41+ return import_error
42+ assert isinstance(nested2, ModuleType)
43+ return "success"
You can’t perform that action at this time.
0 commit comments