mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Fixed pytest fixtures for test_api
This commit is contained in:
@@ -306,18 +306,6 @@ def test_goto_follow_builtin_imports(Script):
|
|||||||
assert d.in_builtin_module() is True
|
assert d.in_builtin_module() is True
|
||||||
|
|
||||||
|
|
||||||
def test_file_fuzzy_completion(Script, tmp_path):
|
|
||||||
folder0 = tmp_path / "inference"
|
|
||||||
folder0.mkdir()
|
|
||||||
file0_path0 = folder0 / "sys_path.py"
|
|
||||||
file0_path0.write_text('\n')
|
|
||||||
file0_path1 = folder0 / "syntax_tree.py"
|
|
||||||
file0_path1.write_text('\n')
|
|
||||||
script = Script('"{}/yt'.format(folder0))
|
|
||||||
assert ['syntax_tree.py"',
|
|
||||||
'sys_path.py"'] == [comp.name for comp in script.completions(fuzzy=True)]
|
|
||||||
|
|
||||||
|
|
||||||
def test_fuzzy_completion(Script):
|
def test_fuzzy_completion(Script):
|
||||||
script = Script('string = "hello"\nstring.upper')
|
script = Script('string = "hello"\nstring.upper')
|
||||||
assert ['isupper',
|
assert ['isupper',
|
||||||
@@ -331,6 +319,19 @@ def test_math_fuzzy_completion(Script):
|
|||||||
assert ['copysign', 'log', 'log10', 'log1p',
|
assert ['copysign', 'log', 'log10', 'log1p',
|
||||||
'log2'] == [comp.name for comp in script.completions(fuzzy=True)]
|
'log2'] == [comp.name for comp in script.completions(fuzzy=True)]
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info < (3, 3),
|
||||||
|
reason="requires python3.3 or higher")
|
||||||
|
def test_file_fuzzy_completion(Script, tmp_path):
|
||||||
|
folder0 = tmp_path / "inference"
|
||||||
|
folder0.mkdir()
|
||||||
|
file0_path0 = folder0 / "sys_path.py"
|
||||||
|
file0_path0.write_text('\n')
|
||||||
|
file0_path1 = folder0 / "syntax_tree.py"
|
||||||
|
file0_path1.write_text('\n')
|
||||||
|
script = Script('"{}/yt'.format(folder0))
|
||||||
|
assert ['syntax_tree.py"',
|
||||||
|
'sys_path.py"'] == [comp.name for comp in script.completions(fuzzy=True)]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(sys.version_info > (2, 7),
|
@pytest.mark.skipif(sys.version_info > (2, 7),
|
||||||
reason="requires python3.3 or higher")
|
reason="requires python3.3 or higher")
|
||||||
@@ -339,4 +340,16 @@ def test_math_fuzzy_completion(Script):
|
|||||||
assert ['copysign', 'log', 'log10',
|
assert ['copysign', 'log', 'log10',
|
||||||
'log1p'] == [comp.name for comp in script.completions(fuzzy=True)]
|
'log1p'] == [comp.name for comp in script.completions(fuzzy=True)]
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info > (2, 7),
|
||||||
|
reason="requires python3.3 or higher")
|
||||||
|
def test_file_fuzzy_completion(Script, tmp_path):
|
||||||
|
folder0 = tmp_path / u"inference"
|
||||||
|
folder0.mkdir()
|
||||||
|
file0_path0 = folder0 / u"sys_path.py"
|
||||||
|
file0_path0.write_text('\n')
|
||||||
|
file0_path1 = folder0 / u"syntax_tree.py"
|
||||||
|
file0_path1.write_text('\n')
|
||||||
|
script = Script('"{}/yt'.format(folder0))
|
||||||
|
assert ['syntax_tree.py"',
|
||||||
|
'sys_path.py"'] == [comp.name for comp in script.completions(fuzzy=True)]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user