1
0
forked from VimPlug/jedi
Files
jedi-fork/test/test_inference/test_precedence.py
2019-08-20 09:09:19 +02:00

19 lines
649 B
Python

from jedi.inference.compiled import CompiledObject
import pytest
@pytest.mark.parametrize('source', [
pytest.param('1 == 1'),
pytest.param('1.0 == 1'),
# Unfortunately for now not possible, because it's a typeshed object.
pytest.param('... == ...', marks=pytest.mark.xfail),
])
def test_equals(Script, environment, source):
if environment.version_info.major < 3:
pytest.skip("Ellipsis does not exists in 2")
script = Script(source)
node = script._module_node.children[0]
first, = script._get_module_context().infer_node(node)
assert isinstance(first, CompiledObject) and first.get_safe_value() is True