Make sure the output of `IPCompleter.all_completions` does not have duplicated prefixes.
(self)
| 468 | reason="Parso does not yet parse 3.13", |
| 469 | ) |
| 470 | def test_all_completions_dups(self): |
| 471 | """ |
| 472 | Make sure the output of `IPCompleter.all_completions` does not have |
| 473 | duplicated prefixes. |
| 474 | """ |
| 475 | ip = get_ipython() |
| 476 | c = ip.Completer |
| 477 | ip.ex("class TestClass():\n\ta=1\n\ta1=2") |
| 478 | for jedi_status in [True, False]: |
| 479 | with provisionalcompleter(): |
| 480 | ip.Completer.use_jedi = jedi_status |
| 481 | matches = c.all_completions("TestCl") |
| 482 | assert matches == ["TestClass"], (jedi_status, matches) |
| 483 | matches = c.all_completions("TestClass.") |
| 484 | assert len(matches) > 2, (jedi_status, matches) |
| 485 | matches = c.all_completions("TestClass.a") |
| 486 | if jedi_status: |
| 487 | assert matches == ["TestClass.a", "TestClass.a1"], jedi_status |
| 488 | else: |
| 489 | assert matches == [".a", ".a1"], jedi_status |
| 490 | |
| 491 | @pytest.mark.xfail( |
| 492 | sys.version_info.releaselevel in ("alpha",), |
nothing calls this directly
no test coverage detected