mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Remove the word 'class' from annotation_string
Currently, 'foo(x: int)' results with annotation_string="<class 'int'>". Change this to 'int'.
This commit is contained in:
committed by
Dave Halter
parent
c4cf0d78e1
commit
1874e9be81
@@ -342,7 +342,7 @@ def test_completion_params():
|
||||
|
||||
@pytest.mark.skipif('py_version < 33', reason='inspect.signature was created in 3.3.')
|
||||
def test_completion_param_annotations():
|
||||
# Need to define this function not directly in Python. Otherwise Jedi is to
|
||||
# Need to define this function not directly in Python. Otherwise Jedi is too
|
||||
# clever and uses the Python code instead of the signature object.
|
||||
code = 'def foo(a: 1, b: str, c: int = 1.0) -> bytes: pass'
|
||||
exec_(code, locals())
|
||||
@@ -354,6 +354,10 @@ def test_completion_param_annotations():
|
||||
assert [d.name for d in b.infer()] == ['str']
|
||||
assert {d.name for d in c.infer()} == {'int', 'float'}
|
||||
|
||||
assert a.description == 'param a: 1'
|
||||
assert b.description == 'param b: str'
|
||||
assert c.description == 'param c: int=1.0'
|
||||
|
||||
d, = jedi.Interpreter('foo()', [locals()]).infer()
|
||||
assert d.name == 'bytes'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user