Skip to content

Commit 6515e2f

Browse files
committed
[TEMP] debug tests on windows using modern technology (print statements)
1 parent 7ac428e commit 6515e2f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Lib/_pyrepl/_module_completer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,15 @@ def _find_modules(self, path: str, prefix: str) -> list[str]:
130130
for segment in path.split('.'):
131131
modules = [mod_info for mod_info in modules
132132
if mod_info.ispkg and mod_info.name == segment]
133+
print(f"{segment=}, {modules=}") # TEMPORARY -- debugging tests on windows
133134
if is_stdlib_import is None:
134135
# Top-level import decide if we import from stdlib or not
135136
is_stdlib_import = all(
136137
self._is_stdlib_module(mod_info) for mod_info in modules
137138
)
138139
modules = self.iter_submodules(modules)
140+
modules = list(modules) # TEMPORARY -- debugging tests on windows
141+
print(f"segment=last, {modules=}") # TEMPORARY -- debugging tests on windows
139142

140143
module_names = [module.name for module in modules]
141144
if is_stdlib_import:

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ def test_already_imported_custom_module_no_other_suggestions(self):
11391139
self.assertEqual(output, "import mymodule.foo")
11401140

11411141
del sys.modules["mymodule"]
1142+
print(f"{dir1=}, {dir2=}") # TEMPORARY -- debugging tests on windows
11421143
# mymodule not imported anymore -> suggest dir2 submodules
11431144
events = code_to_events("import mymodule.\t\n")
11441145
reader = self.prepare_reader(events, namespace={})

0 commit comments

Comments
 (0)