@@ -139,7 +139,7 @@ def test_jedi_completion(config, workspace):
139139
140140 assert items
141141 labels = [i ['label' ] for i in items ]
142- assert 'isabs (path)' in labels
142+ assert 'isfile (path)' in labels
143143
144144 # Test we don't throw with big character
145145 pylsp_jedi_completions (config , doc , {'line' : 1 , 'character' : 1000 })
@@ -175,7 +175,11 @@ def test_jedi_completion_with_fuzzy_enabled(config, workspace):
175175 items = pylsp_jedi_completions (config , doc , com_position )
176176
177177 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
179183
180184 # Test we don't throw with big character
181185 pylsp_jedi_completions (config , doc , {'line' : 1 , 'character' : 1000 })
@@ -196,7 +200,7 @@ def test_jedi_completion_resolve_at_most(config, workspace):
196200 config .update ({'plugins' : {'jedi_completion' : {'resolve_at_most' : math .inf }}})
197201 items = pylsp_jedi_completions (config , doc , com_position )
198202 labels = {i ['label' ] for i in items }
199- assert 'isabs (path)' in labels
203+ assert 'isfile (path)' in labels
200204
201205
202206def test_rope_completion (config , workspace ):
@@ -360,7 +364,10 @@ def test_snippet_parsing(config, workspace):
360364 'completion' : {'completionItem' : {'snippetSupport' : True }}}
361365 config .update ({'plugins' : {'jedi_completion' : {'include_params' : True }}})
362366 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'
364371 assert completions [0 ]['insertText' ] == out
365372
366373
@@ -407,11 +414,11 @@ def test_multistatement_snippet(config, workspace):
407414 completions = pylsp_jedi_completions (config , doc , position )
408415 assert completions [0 ]['insertText' ] == 'date'
409416
410- document = 'from datetime import date ; a = date '
417+ document = 'from math import fmod ; a = fmod '
411418 doc = Document (DOC_URI , workspace , document )
412419 position = {'line' : 0 , 'character' : len (document )}
413420 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'
415422
416423
417424def test_jedi_completion_extra_paths (tmpdir , workspace ):
0 commit comments