mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
A CompiledInstance is not really compiled, it's an instance of a compiled class value
This commit is contained in:
@@ -9,6 +9,7 @@ import pytest
|
||||
from jedi.inference import compiled
|
||||
from jedi.inference.compiled.access import DirectObjectAccess
|
||||
from jedi.inference.gradual.conversion import _stub_to_python_value_set
|
||||
from jedi.inference.syntax_tree import _infer_comparison_part
|
||||
|
||||
|
||||
def test_simple(inference_state, environment):
|
||||
@@ -169,3 +170,15 @@ def test_qualified_names(same_process_inference_state, obj, expected_names):
|
||||
DirectObjectAccess(same_process_inference_state, obj)
|
||||
)
|
||||
assert o.get_qualified_names() == tuple(expected_names)
|
||||
|
||||
|
||||
def test_operation(Script, inference_state, create_compiled_object):
|
||||
#b = create_simple_object(inference_state, 'bool')._compiled_obj
|
||||
b = create_compiled_object(bool)
|
||||
true, = _infer_comparison_part(
|
||||
inference_state, b.parent_context,
|
||||
left=list(b.execute_with_values())[0],
|
||||
operator='is not',
|
||||
right=b,
|
||||
)
|
||||
assert true.py__name__() == 'bool'
|
||||
|
||||
Reference in New Issue
Block a user