[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2022-09-14 07:24:50 +00:00
parent 5a085ed4cd
commit dda712c4ff
1 changed files with 3 additions and 5 deletions

View File

@ -623,7 +623,7 @@ def insert_missing_modules(modules: Dict[str, ModuleType], module_name: str) ->
# doc="Empty module created by pytest's importmode=importlib.",
# )
# modules[module_name] = module
# Instead of raising ModuleNotFoundError, replace with dummy directly.
if not sys.meta_path:
module = ModuleType(
@ -631,11 +631,9 @@ def insert_missing_modules(modules: Dict[str, ModuleType], module_name: str) ->
doc="Empty module created by pytest's importmode=importlib.",
)
modules[module_name] = module
else:
else:
importlib.import_module(module_name)
module_parts.pop(-1)
module_name = ".".join(module_parts)