|
23 | 23 | # Local imports
|
24 | 24 | from spyder.config.base import running_in_ci, running_in_ci_with_conda
|
25 | 25 | from spyder.config.utils import is_anaconda
|
26 |
| -from spyder.plugins.completion.api import ( |
27 |
| - CompletionRequestTypes, CompletionItemKind) |
28 |
| -from spyder.plugins.completion.providers.kite.providers.document import ( |
29 |
| - KITE_COMPLETION) |
30 | 26 | from spyder.plugins.completion.providers.kite.utils.status import (
|
31 | 27 | check_if_kite_installed, check_if_kite_running)
|
32 | 28 | from spyder.py3compat import PY2
|
@@ -1068,55 +1064,6 @@ def test_text_snippet_completions(completions_codeeditor, qtbot):
|
1068 | 1064 | code_editor.toggle_code_snippets(True)
|
1069 | 1065 |
|
1070 | 1066 |
|
1071 |
| -@pytest.mark.slow |
1072 |
| -@pytest.mark.order(1) |
1073 |
| -@flaky(max_runs=5) |
1074 |
| -def test_kite_textEdit_completions(mock_completions_codeeditor, qtbot): |
1075 |
| - """Test textEdit completions such as those returned by the Kite provider. |
1076 |
| -
|
1077 |
| - This mocks out the completions response, and does not test the Kite |
1078 |
| - provider directly. |
1079 |
| - """ |
1080 |
| - code_editor, mock_response = mock_completions_codeeditor |
1081 |
| - completion = code_editor.completion_widget |
1082 |
| - |
1083 |
| - code_editor.toggle_automatic_completions(False) |
1084 |
| - code_editor.toggle_code_snippets(False) |
1085 |
| - |
1086 |
| - # Set cursor to start |
1087 |
| - code_editor.go_to_line(1) |
1088 |
| - |
1089 |
| - qtbot.keyClicks(code_editor, 'my_dict.') |
1090 |
| - |
1091 |
| - # Complete my_dict. -> my_dict["dict-key"] |
1092 |
| - mock_response.side_effect = lambda lang, method, params: {'params': [{ |
1093 |
| - 'kind': CompletionItemKind.TEXT, |
1094 |
| - 'label': '["dict-key"]', |
1095 |
| - 'textEdit': { |
1096 |
| - 'newText': '["dict-key"]', |
1097 |
| - 'range': { |
1098 |
| - 'start': 7, |
1099 |
| - 'end': 8, |
1100 |
| - }, |
1101 |
| - }, |
1102 |
| - 'filterText': '', |
1103 |
| - 'sortText': '', |
1104 |
| - 'documentation': '', |
1105 |
| - 'provider': KITE_COMPLETION, |
1106 |
| - }]} if method == CompletionRequestTypes.DOCUMENT_COMPLETION else None |
1107 |
| - with qtbot.waitSignal(completion.sig_show_completions, |
1108 |
| - timeout=10000) as sig: |
1109 |
| - qtbot.keyPress(code_editor, Qt.Key_Tab, delay=300) |
1110 |
| - mock_response.side_effect = None |
1111 |
| - |
1112 |
| - assert '["dict-key"]' in [x['label'] for x in sig.args[0]] |
1113 |
| - qtbot.keyPress(code_editor, Qt.Key_Enter, delay=300) |
1114 |
| - assert code_editor.toPlainText() == 'my_dict["dict-key"]\n' |
1115 |
| - |
1116 |
| - code_editor.toggle_automatic_completions(True) |
1117 |
| - code_editor.toggle_code_snippets(True) |
1118 |
| - |
1119 |
| - |
1120 | 1067 | @pytest.mark.slow
|
1121 | 1068 | @pytest.mark.order(1)
|
1122 | 1069 | @flaky(max_runs=5)
|
|
0 commit comments