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

Method test_deduplicate_completions

tests/test_completer.py:569–590  ·  view source on GitHub ↗

Test that completions are correctly deduplicated (even if ranges are not the same)

(self)

Source from the content-addressed store, hash-verified

567 strict=True,
568 )
569 def test_deduplicate_completions(self):
570 """
571 Test that completions are correctly deduplicated (even if ranges are not the same)
572 """
573 ip = get_ipython()
574 ip.ex(
575 textwrap.dedent(
576 """
577 class Z:
578 zoo = 1
579 """
580 )
581 )
582 with provisionalcompleter():
583 ip.Completer.use_jedi = True
584 l = list(
585 _deduplicate_completions("Z.z", ip.Completer.completions("Z.z", 3))
586 )
587 ip.Completer.use_jedi = False
588
589 assert len(l) == 1, "Completions (Z.z<tab>) correctly deduplicate: %s " % l
590 assert l[0].text == "zoo" # and not `it.accumulate`
591
592 @pytest.mark.xfail(
593 sys.version_info.releaselevel in ("alpha",),

Callers

nothing calls this directly

Calls 5

get_ipythonFunction · 0.90
provisionalcompleterFunction · 0.90
_deduplicate_completionsFunction · 0.90
exMethod · 0.80
completionsMethod · 0.80

Tested by

no test coverage detected