mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-30 08:44:21 +08:00
Fix a few tests that failed, because they were not correct python (the context was wrong).
This commit is contained in:
@@ -38,7 +38,7 @@ exe[1]
|
||||
#? set
|
||||
exe[2]
|
||||
#? []
|
||||
exe[3][0]
|
||||
exe[3][0].
|
||||
#? str()
|
||||
exe[4]['d']
|
||||
|
||||
@@ -70,7 +70,7 @@ exe[1]
|
||||
#? set
|
||||
exe[2]
|
||||
#? []
|
||||
exe[3][0]
|
||||
exe[3][0].
|
||||
#? str()
|
||||
exe[4]['d']
|
||||
|
||||
|
||||
@@ -62,14 +62,14 @@ class B():
|
||||
p = property(t)
|
||||
|
||||
#? []
|
||||
B().r()
|
||||
B().r().
|
||||
#? int()
|
||||
B().r
|
||||
|
||||
#? str()
|
||||
B().p
|
||||
#? []
|
||||
B().p()
|
||||
B().p().
|
||||
|
||||
class PropClass():
|
||||
def __init__(self, a):
|
||||
|
||||
@@ -368,12 +368,12 @@ def nested_args2(*args, **kwargs):
|
||||
#? int()
|
||||
nested_args('', 1, 1.0, list)
|
||||
#? []
|
||||
nested_args('')
|
||||
nested_args('').
|
||||
|
||||
#? int()
|
||||
nested_args2('', 1, 1.0)
|
||||
#? []
|
||||
nested_args2('')
|
||||
nested_args2('').
|
||||
|
||||
# -----------------
|
||||
# nested **kwargs
|
||||
@@ -397,9 +397,9 @@ nested_kw(a=3.0, b=1)
|
||||
#? int()
|
||||
nested_kw(b=1, a=r"")
|
||||
#? []
|
||||
nested_kw(1, '')
|
||||
nested_kw(1, '').
|
||||
#? []
|
||||
nested_kw(a='')
|
||||
nested_kw(a='').
|
||||
|
||||
#? int()
|
||||
nested_kw2(b=1)
|
||||
@@ -408,9 +408,9 @@ nested_kw2(b=1, c=1.0)
|
||||
#? int()
|
||||
nested_kw2(c=1.0, b=1)
|
||||
#? []
|
||||
nested_kw2('')
|
||||
nested_kw2('').
|
||||
#? []
|
||||
nested_kw2(a='')
|
||||
nested_kw2(a='').
|
||||
#? []
|
||||
nested_kw2('', b=1).
|
||||
|
||||
@@ -430,14 +430,14 @@ nested_both('', b=1, c=1.0, list)
|
||||
nested_both('', c=1.0, b=1, list)
|
||||
|
||||
#? []
|
||||
nested_both('')
|
||||
nested_both('').
|
||||
|
||||
#? int()
|
||||
nested_both2('', b=1, c=1.0)
|
||||
#? int()
|
||||
nested_both2('', c=1.0, b=1)
|
||||
#? []
|
||||
nested_both2('')
|
||||
nested_both2('').
|
||||
|
||||
# -----------------
|
||||
# nested *args/**kwargs with a default arg
|
||||
@@ -464,7 +464,7 @@ nested_def2('', b=1, c=1.0)[1]
|
||||
#? int()
|
||||
nested_def2('', c=1.0, b=1)[1]
|
||||
#? []
|
||||
nested_def2('')[1]
|
||||
nested_def2('')[1].
|
||||
|
||||
# -----------------
|
||||
# magic methods
|
||||
|
||||
@@ -22,7 +22,7 @@ def gen_ret(value):
|
||||
next(gen_ret(1))
|
||||
|
||||
#? []
|
||||
next(gen_ret())
|
||||
next(gen_ret()).
|
||||
|
||||
# generators evaluate to true if cast by bool.
|
||||
a = ''
|
||||
@@ -42,7 +42,7 @@ def get(param):
|
||||
yield ""
|
||||
|
||||
#? []
|
||||
get()[0]
|
||||
get()[0].
|
||||
|
||||
# -----------------
|
||||
# __iter__
|
||||
|
||||
@@ -86,8 +86,8 @@ from os import path
|
||||
|
||||
# should not return a function, because `a` is a function above
|
||||
def f(b, a): return a
|
||||
#? ['in', 'is', 'and', 'if', 'or', 'not']
|
||||
f(b=3)
|
||||
#? []
|
||||
f(b=3).
|
||||
|
||||
# -----------------
|
||||
# closure
|
||||
|
||||
Reference in New Issue
Block a user