File: test_precedence.py

package info (click to toggle)
python-jedi 0.19.1%2Bds1-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,680 kB
  • sloc: python: 28,783; makefile: 172; ansic: 13
file content (16 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from jedi.inference.compiled import CompiledValue

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):
    script = Script(source)
    node = script._module_node.children[0]
    first, = script._get_module_context().infer_node(node)
    assert isinstance(first, CompiledValue) and first.get_safe_value() is True