mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[TEMP] debug tests on windows using modern technology (print statements)
This commit is contained in:
parent
7ac428e9c4
commit
6515e2fefd
2 changed files with 4 additions and 0 deletions
|
|
@ -130,12 +130,15 @@ def _find_modules(self, path: str, prefix: str) -> list[str]:
|
||||||
for segment in path.split('.'):
|
for segment in path.split('.'):
|
||||||
modules = [mod_info for mod_info in modules
|
modules = [mod_info for mod_info in modules
|
||||||
if mod_info.ispkg and mod_info.name == segment]
|
if mod_info.ispkg and mod_info.name == segment]
|
||||||
|
print(f"{segment=}, {modules=}") # TEMPORARY -- debugging tests on windows
|
||||||
if is_stdlib_import is None:
|
if is_stdlib_import is None:
|
||||||
# Top-level import decide if we import from stdlib or not
|
# Top-level import decide if we import from stdlib or not
|
||||||
is_stdlib_import = all(
|
is_stdlib_import = all(
|
||||||
self._is_stdlib_module(mod_info) for mod_info in modules
|
self._is_stdlib_module(mod_info) for mod_info in modules
|
||||||
)
|
)
|
||||||
modules = self.iter_submodules(modules)
|
modules = self.iter_submodules(modules)
|
||||||
|
modules = list(modules) # TEMPORARY -- debugging tests on windows
|
||||||
|
print(f"segment=last, {modules=}") # TEMPORARY -- debugging tests on windows
|
||||||
|
|
||||||
module_names = [module.name for module in modules]
|
module_names = [module.name for module in modules]
|
||||||
if is_stdlib_import:
|
if is_stdlib_import:
|
||||||
|
|
|
||||||
|
|
@ -1139,6 +1139,7 @@ def test_already_imported_custom_module_no_other_suggestions(self):
|
||||||
self.assertEqual(output, "import mymodule.foo")
|
self.assertEqual(output, "import mymodule.foo")
|
||||||
|
|
||||||
del sys.modules["mymodule"]
|
del sys.modules["mymodule"]
|
||||||
|
print(f"{dir1=}, {dir2=}") # TEMPORARY -- debugging tests on windows
|
||||||
# mymodule not imported anymore -> suggest dir2 submodules
|
# mymodule not imported anymore -> suggest dir2 submodules
|
||||||
events = code_to_events("import mymodule.\t\n")
|
events = code_to_events("import mymodule.\t\n")
|
||||||
reader = self.prepare_reader(events, namespace={})
|
reader = self.prepare_reader(events, namespace={})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue