From 9dc41a74bd4ed83d965d0999c4dc6778948c18f0 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 13 Apr 2024 12:08:35 -0300 Subject: [PATCH] Remove outdated comment Seems we need to insert missing modules when the modules are not part of a package or namespace package. --- src/_pytest/pathlib.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index 4cda4501a..83ad0152f 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -620,10 +620,6 @@ def _import_module_using_spec( :param insert_modules: If True, will call insert_missing_modules to create empty intermediate modules for made-up module names (when importing test files not reachable from sys.path). - Note: we can probably drop insert_missing_modules altogether: instead of - generating module names such as "src.tests.test_foo", which require intermediate - empty modules, we might just as well generate unique module names like - "src_tests_test_foo". """ # Checking with sys.meta_path first in case one of its hooks can import this module, # such as our own assertion-rewrite hook.