Test that files are not suggested during attribute/method completion.
(code)
| 2694 | ], |
| 2695 | ) |
| 2696 | def test_no_file_completions_in_attr_access(code): |
| 2697 | """Test that files are not suggested during attribute/method completion.""" |
| 2698 | with TemporaryWorkingDirectory(): |
| 2699 | open(".hidden", "w", encoding="utf-8").close() |
| 2700 | offset = len(code) |
| 2701 | for use_jedi in (True, False): |
| 2702 | with provisionalcompleter(), jedi_status(use_jedi): |
| 2703 | completions = list(ip.Completer.completions(text=code, offset=offset)) |
| 2704 | matches = [c for c in completions if c.text.lstrip(".") == "hidden"] |
| 2705 | assert ( |
| 2706 | len(matches) == 0 |
| 2707 | ), f"File '.hidden' should not appear in attribute completion" |
| 2708 | |
| 2709 | |
| 2710 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…