Skip to content

Commit 37f2966

Browse files
committed
Tests: Improve robustness and logging
- Add exception logging in jedi_completion plugin. - Explicitly disable pylsp_rope in autoimport notebook tests to prevent interference. - Make flake8 argument assertions more flexible to accommodate local configurations. Signed-off-by: Matěj Cepl <[email protected]>
1 parent 5097d3c commit 37f2966

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

pylsp/plugins/jedi_completion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def _resolve_completion(completion, d, markup_kind: str, signature_config: dict)
230230
signature_config=signature_config,
231231
)
232232
except Exception:
233+
log.exception("Failed to format docstring")
233234
docs = ""
234235
completion["documentation"] = docs
235236
return completion

test/plugins/test_autoimport.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ def test_autoimport_code_actions_and_completions_for_notebook_document(
288288
"enabled": True,
289289
"completions": {"enabled": True},
290290
},
291+
"pylsp_rope": {
292+
"enabled": False,
293+
},
291294
}
292295
}
293296
},

test/plugins/test_flake8_lint.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@ def test_flake8_multiline(workspace) -> None:
195195
call_args = popen_mock.call_args[0][0]
196196

197197
init_file = os.path.join("blah", "__init__.py")
198-
assert call_args == [
198+
for arg in [
199199
"flake8",
200200
"-",
201201
"--exclude=blah/,file_2.py",
202202
"--stdin-display-name",
203203
init_file,
204-
]
204+
]:
205+
assert arg in call_args
205206

206207
os.unlink(os.path.join(workspace.root_path, "setup.cfg"))
207208

0 commit comments

Comments
 (0)