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

Function test_undefined_variables

tests/test_completer.py:2568–2579  ·  view source on GitHub ↗
(use_jedi, evaluation, code, insert_text)

Source from the content-addressed store, hash-verified

2566 ],
2567)
2568def test_undefined_variables(use_jedi, evaluation, code, insert_text):
2569 offset = len(code)
2570 ip.Completer.use_jedi = use_jedi
2571 ip.Completer.evaluation = evaluation
2572
2573 with provisionalcompleter():
2574 completions = list(ip.Completer.completions(text=code, offset=offset))
2575 insert_texts = insert_text if isinstance(insert_text, list) else [insert_text]
2576 for text in insert_texts:
2577 match = [c for c in completions if c.text.lstrip(".") == text]
2578 message_on_fail = f"{text} not found among {[c.text for c in completions]}"
2579 assert len(match) == 1, message_on_fail
2580
2581
2582@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

provisionalcompleterFunction · 0.90
completionsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…