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

Method test_custom_completion_ordering

tests/test_completer.py:289–301  ·  view source on GitHub ↗

Test that errors from custom attribute completers are silenced.

(self)

Source from the content-addressed store, hash-verified

287 ip.complete("x.")
288
289 def test_custom_completion_ordering(self):
290 """Test that errors from custom attribute completers are silenced."""
291 ip = get_ipython()
292
293 _, matches = ip.complete("in")
294 assert matches.index("input") < matches.index("int")
295
296 def complete_example(a):
297 return ["example2", "example1"]
298
299 ip.Completer.custom_completers.add_re("ex*", complete_example)
300 _, matches = ip.complete("ex")
301 assert matches.index("example2") < matches.index("example1")
302
303 def test_unicode_completions(self):
304 ip = get_ipython()

Callers

nothing calls this directly

Calls 4

get_ipythonFunction · 0.90
indexMethod · 0.80
add_reMethod · 0.80
completeMethod · 0.45

Tested by

no test coverage detected