MCPcopy Index your code
hub / github.com/ipython/ipython / test_no_file_completions_in_attr_access

Function test_no_file_completions_in_attr_access

tests/test_completer.py:2696–2707  ·  view source on GitHub ↗

Test that files are not suggested during attribute/method completion.

(code)

Source from the content-addressed store, hash-verified

2694 ],
2695)
2696def test_no_file_completions_in_attr_access(code):
2697 """Test that files are not suggested during attribute/method completion."""
2698 with TemporaryWorkingDirectory():
2699 open(".hidden", "w", encoding="utf-8").close()
2700 offset = len(code)
2701 for use_jedi in (True, False):
2702 with provisionalcompleter(), jedi_status(use_jedi):
2703 completions = list(ip.Completer.completions(text=code, offset=offset))
2704 matches = [c for c in completions if c.text.lstrip(".") == "hidden"]
2705 assert (
2706 len(matches) == 0
2707 ), f"File '.hidden' should not appear in attribute completion"
2708
2709
2710@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

provisionalcompleterFunction · 0.90
jedi_statusFunction · 0.85
completionsMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…