Skip to content

Commit 94c6066

Browse files
gh-155727: Ignore internal imports in test_attribute_completion (GH-155730)
Reader.run_hooks() imports _pyrepl._threading_handler lazily, and the test counted it as a module imported by the completer.
1 parent 3c414a5 commit 94c6066

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,10 @@ def test_attribute_completion(self):
14671467
reader = self.prepare_reader(events, namespace={})
14681468
output = reader.readline()
14691469
self.assertEqual(output, expected)
1470-
new_imports = sys.modules.keys() - _imported
1470+
# The reader imports its own helpers lazily.
1471+
new_imports = {name for name in
1472+
sys.modules.keys() - _imported
1473+
if not name.startswith('_pyrepl.')}
14711474
self.assertEqual(new_imports, expected_imports)
14721475

14731476
@patch.dict(sys.modules)

0 commit comments

Comments
 (0)