forked from VimPlug/jedi
Fixes to get the tests passing for 3.10
This commit is contained in:
@@ -232,6 +232,7 @@ def a():
|
|||||||
#?
|
#?
|
||||||
# str literals in comment """ upper
|
# str literals in comment """ upper
|
||||||
|
|
||||||
|
# python >= 3.11
|
||||||
def completion_in_comment():
|
def completion_in_comment():
|
||||||
#? ['Exception', 'ExceptionGroup']
|
#? ['Exception', 'ExceptionGroup']
|
||||||
# might fail because the comment is not a leaf: Exception
|
# might fail because the comment is not a leaf: Exception
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ if x:
|
|||||||
#? ['else']
|
#? ['else']
|
||||||
else
|
else
|
||||||
|
|
||||||
|
# python >= 3.11
|
||||||
try:
|
try:
|
||||||
pass
|
pass
|
||||||
#? ['except', 'Exception', 'ExceptionGroup']
|
#? ['except', 'Exception', 'ExceptionGroup']
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# python >= 3.11
|
||||||
class Foo:
|
class Foo:
|
||||||
bar = 1
|
bar = 1
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#? ['raise']
|
#? ['raise']
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
# python >= 3.11
|
||||||
#? ['Exception', 'ExceptionGroup']
|
#? ['Exception', 'ExceptionGroup']
|
||||||
except
|
except
|
||||||
|
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ def z(bam, bar=2, *, bas=1):
|
|||||||
#? 7 ['bar=', 'baz=']
|
#? 7 ['bar=', 'baz=']
|
||||||
x(1, ba)
|
x(1, ba)
|
||||||
|
|
||||||
|
# python >= 3.11
|
||||||
|
|
||||||
#? 14 ['baz=']
|
#? 14 ['baz=']
|
||||||
x(1, bar=2, ba)
|
x(1, bar=2, ba)
|
||||||
#? 7 ['bar=', 'baz=']
|
#? 7 ['bar=', 'baz=']
|
||||||
|
|||||||
@@ -583,6 +583,7 @@ b = Builder()
|
|||||||
b.add_x(2)
|
b.add_x(2)
|
||||||
#? Builder()
|
#? Builder()
|
||||||
b.add_x(2).add_y(5)
|
b.add_x(2).add_y(5)
|
||||||
|
# python >= 3.11
|
||||||
#? Builder()
|
#? Builder()
|
||||||
b.add_x(2).add_not_implemented(5)
|
b.add_x(2).add_not_implemented(5)
|
||||||
#? Builder()
|
#? Builder()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# non array
|
# non array
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|
||||||
|
# python >= 3.12
|
||||||
#? ['imag']
|
#? ['imag']
|
||||||
int.imag
|
int.imag
|
||||||
|
|
||||||
|
|||||||
@@ -188,11 +188,15 @@ def test_functions_should_have_params(Script):
|
|||||||
assert c.get_signatures()
|
assert c.get_signatures()
|
||||||
|
|
||||||
|
|
||||||
def test_hashlib_params(Script):
|
def test_hashlib_params(Script, environment):
|
||||||
script = Script('from hashlib import sha256')
|
script = Script('from hashlib import sha256')
|
||||||
c, = script.complete()
|
c, = script.complete()
|
||||||
sig, = c.get_signatures()
|
sig, = c.get_signatures()
|
||||||
assert [p.name for p in sig.params] == ['data', 'usedforsecurity', 'string']
|
if environment.version_info >= (3, 13):
|
||||||
|
wanted = ['data', 'usedforsecurity', 'string']
|
||||||
|
else:
|
||||||
|
wanted = ['string', 'usedforsecurity']
|
||||||
|
assert [p.name for p in sig.params] == wanted
|
||||||
|
|
||||||
|
|
||||||
def test_signature_params(Script):
|
def test_signature_params(Script):
|
||||||
|
|||||||
Reference in New Issue
Block a user