MCPcopy Create free account
hub / github.com/ipython/ipython / test_set_custom_completer

Function test_set_custom_completer

IPython/core/tests/test_interactiveshell.py:1027–1042  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1025
1026
1027def test_set_custom_completer():
1028 num_completers = len(ip.Completer.matchers)
1029
1030 def foo(*args, **kwargs):
1031 return "I'm a completer!"
1032
1033 ip.set_custom_completer(foo, 0)
1034
1035 # check that we've really added a new completer
1036 assert len(ip.Completer.matchers) == num_completers + 1
1037
1038 # check that the first completer is the function we defined
1039 assert ip.Completer.matchers[0]() == "I'm a completer!"
1040
1041 # clean up
1042 ip.Completer.custom_matchers.pop()

Callers

nothing calls this directly

Calls 2

set_custom_completerMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected