@@ -139,7 +139,7 @@ def test_jedi_completion(config, workspace):
139
139
140
140
assert items
141
141
labels = [i ['label' ] for i in items ]
142
- assert 'isabs (path)' in labels
142
+ assert 'isfile (path)' in labels
143
143
144
144
# Test we don't throw with big character
145
145
pylsp_jedi_completions (config , doc , {'line' : 1 , 'character' : 1000 })
@@ -175,7 +175,11 @@ def test_jedi_completion_with_fuzzy_enabled(config, workspace):
175
175
items = pylsp_jedi_completions (config , doc , com_position )
176
176
177
177
assert items
178
- assert items [0 ]['label' ] == 'commonprefix(list)'
178
+
179
+ expected = 'commonprefix(m)'
180
+ if JEDI_VERSION == '0.18.0' :
181
+ expected = 'commonprefix(list)'
182
+ assert items [0 ]['label' ] == expected
179
183
180
184
# Test we don't throw with big character
181
185
pylsp_jedi_completions (config , doc , {'line' : 1 , 'character' : 1000 })
@@ -196,7 +200,7 @@ def test_jedi_completion_resolve_at_most(config, workspace):
196
200
config .update ({'plugins' : {'jedi_completion' : {'resolve_at_most' : math .inf }}})
197
201
items = pylsp_jedi_completions (config , doc , com_position )
198
202
labels = {i ['label' ] for i in items }
199
- assert 'isabs (path)' in labels
203
+ assert 'isfile (path)' in labels
200
204
201
205
202
206
def test_rope_completion (config , workspace ):
@@ -360,7 +364,10 @@ def test_snippet_parsing(config, workspace):
360
364
'completion' : {'completionItem' : {'snippetSupport' : True }}}
361
365
config .update ({'plugins' : {'jedi_completion' : {'include_params' : True }}})
362
366
completions = pylsp_jedi_completions (config , doc , completion_position )
363
- out = 'divmod(${1:a}, ${2:b})$0'
367
+
368
+ out = 'divmod(${1:x}, ${2:y})$0'
369
+ if JEDI_VERSION == '0.18.0' :
370
+ out = 'divmod(${1:a}, ${2:b})$0'
364
371
assert completions [0 ]['insertText' ] == out
365
372
366
373
@@ -407,11 +414,11 @@ def test_multistatement_snippet(config, workspace):
407
414
completions = pylsp_jedi_completions (config , doc , position )
408
415
assert completions [0 ]['insertText' ] == 'date'
409
416
410
- document = 'from datetime import date ; a = date '
417
+ document = 'from math import fmod ; a = fmod '
411
418
doc = Document (DOC_URI , workspace , document )
412
419
position = {'line' : 0 , 'character' : len (document )}
413
420
completions = pylsp_jedi_completions (config , doc , position )
414
- assert completions [0 ]['insertText' ] == 'date (${1:year }, ${2:month}, ${3:day })$0'
421
+ assert completions [0 ]['insertText' ] == 'fmod (${1:x }, ${2:y })$0'
415
422
416
423
417
424
def test_jedi_completion_extra_paths (tmpdir , workspace ):
0 commit comments