mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
16 lines
475 B
Python
16 lines
475 B
Python
import pytest
|
|
|
|
from jedi.evaluate.gradual.conversion import stub_to_actual_context_set
|
|
|
|
|
|
def test_compiled_signature(Script):
|
|
code = 'import math; math.cos'
|
|
sig = 'cos(x, /)'
|
|
d, = Script(code).goto_definitions()
|
|
context, = d._name.infer()
|
|
compiled, = stub_to_actual_context_set(context)
|
|
signature, = compiled.get_signatures()
|
|
assert signature.to_string() == sig
|
|
assert signature.get_param_names() == []
|
|
assert signature.annotation is None
|