mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Fix some test imports
This commit is contained in:
@@ -9,7 +9,7 @@ import pytest
|
|||||||
from jedi.evaluate import compiled
|
from jedi.evaluate import compiled
|
||||||
from jedi.evaluate.compiled.access import DirectObjectAccess
|
from jedi.evaluate.compiled.access import DirectObjectAccess
|
||||||
from jedi.evaluate.helpers import execute_evaluated
|
from jedi.evaluate.helpers import execute_evaluated
|
||||||
from jedi.evaluate.gradual.conversion import stub_to_python_context_set
|
from jedi.evaluate.gradual.conversion import _stub_to_python_context_set
|
||||||
|
|
||||||
|
|
||||||
def test_simple(evaluator, environment):
|
def test_simple(evaluator, environment):
|
||||||
@@ -35,7 +35,7 @@ def test_next_docstr(evaluator):
|
|||||||
next_ = compiled.builtin_from_name(evaluator, u'next')
|
next_ = compiled.builtin_from_name(evaluator, u'next')
|
||||||
assert next_.tree_node is not None
|
assert next_.tree_node is not None
|
||||||
assert next_.py__doc__() == '' # It's a stub
|
assert next_.py__doc__() == '' # It's a stub
|
||||||
for non_stub in stub_to_python_context_set(next_):
|
for non_stub in _stub_to_python_context_set(next_):
|
||||||
assert non_stub.py__doc__() == next.__doc__
|
assert non_stub.py__doc__() == next.__doc__
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from jedi._compatibility import find_module_py33, find_module
|
|||||||
from jedi.evaluate import compiled
|
from jedi.evaluate import compiled
|
||||||
from jedi.evaluate import imports
|
from jedi.evaluate import imports
|
||||||
from jedi.api.project import Project
|
from jedi.api.project import Project
|
||||||
from jedi.evaluate.gradual.conversion import stub_to_python_context_set
|
from jedi.evaluate.gradual.conversion import _stub_to_python_context_set
|
||||||
from ..helpers import cwd_at, get_example_dir, test_dir, root_dir
|
from ..helpers import cwd_at, get_example_dir, test_dir, root_dir
|
||||||
|
|
||||||
THIS_DIR = os.path.dirname(__file__)
|
THIS_DIR = os.path.dirname(__file__)
|
||||||
@@ -301,7 +301,7 @@ def test_compiled_import_none(monkeypatch, Script):
|
|||||||
def_, = script.goto_definitions()
|
def_, = script.goto_definitions()
|
||||||
assert def_.type == 'module'
|
assert def_.type == 'module'
|
||||||
context, = def_._name.infer()
|
context, = def_._name.infer()
|
||||||
assert not stub_to_python_context_set(context)
|
assert not _stub_to_python_context_set(context)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from operator import ge, lt
|
from operator import ge, lt
|
||||||
|
|
||||||
from jedi.evaluate.gradual.conversion import stub_to_python_context_set
|
from jedi.evaluate.gradual.conversion import _stub_to_python_context_set
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
@@ -28,7 +28,7 @@ def test_compiled_signature(Script, environment, code, sig, names, op, version):
|
|||||||
|
|
||||||
d, = Script(code).goto_definitions()
|
d, = Script(code).goto_definitions()
|
||||||
context, = d._name.infer()
|
context, = d._name.infer()
|
||||||
compiled, = stub_to_python_context_set(context)
|
compiled, = _stub_to_python_context_set(context)
|
||||||
signature, = compiled.get_signatures()
|
signature, = compiled.get_signatures()
|
||||||
assert signature.to_string() == sig
|
assert signature.to_string() == sig
|
||||||
assert [n.string_name for n in signature.get_param_names()] == names
|
assert [n.string_name for n in signature.get_param_names()] == names
|
||||||
|
|||||||
Reference in New Issue
Block a user