mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
change tests that provided wrong instance information
This commit is contained in:
@@ -148,6 +148,8 @@ class BaseDefinition(object):
|
|||||||
stripped = stripped.parent
|
stripped = stripped.parent
|
||||||
if isinstance(stripped, pr.Name):
|
if isinstance(stripped, pr.Name):
|
||||||
stripped = stripped.parent
|
stripped = stripped.parent
|
||||||
|
if isinstance(stripped, iterable.Array):
|
||||||
|
return 'instance'
|
||||||
return type(stripped).__name__.lower().replace('wrapper', '')
|
return type(stripped).__name__.lower().replace('wrapper', '')
|
||||||
|
|
||||||
def _path(self):
|
def _path(self):
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ func()
|
|||||||
assert []
|
assert []
|
||||||
|
|
||||||
def focus_return():
|
def focus_return():
|
||||||
#? list
|
#? list()
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ def listen(arg):
|
|||||||
x
|
x
|
||||||
|
|
||||||
listen(['' for x in [1]])
|
listen(['' for x in [1]])
|
||||||
#? str()
|
#? str
|
||||||
([str for x in []])[0]
|
([str for x in []])[0]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ def fu(a, b, c, *args, **kwargs):
|
|||||||
|
|
||||||
exe = fu(list, c=set, b=3, d='')
|
exe = fu(list, c=set, b=3, d='')
|
||||||
|
|
||||||
#? list()
|
#? list
|
||||||
exe[0]
|
exe[0]
|
||||||
#? int()
|
#? int()
|
||||||
exe[1]
|
exe[1]
|
||||||
@@ -63,7 +63,7 @@ def fu2(a, b, c, *args, **kwargs):
|
|||||||
|
|
||||||
exe = fu2(list, c=set, b=3, d='str')
|
exe = fu2(list, c=set, b=3, d='str')
|
||||||
|
|
||||||
#? list()
|
#? list
|
||||||
exe[0]
|
exe[0]
|
||||||
#? int()
|
#? int()
|
||||||
exe[1]
|
exe[1]
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ def both():
|
|||||||
"""
|
"""
|
||||||
return 23
|
return 23
|
||||||
|
|
||||||
#? str(), int()
|
#? str() int()
|
||||||
both()
|
both()
|
||||||
|
|
||||||
class Test(object):
|
class Test(object):
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ exe = args_func(1, "", list)
|
|||||||
exe[0]
|
exe[0]
|
||||||
#? tuple()
|
#? tuple()
|
||||||
exe[1]
|
exe[1]
|
||||||
#? list()
|
#? list
|
||||||
exe[1][1]
|
exe[1][1]
|
||||||
|
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ def fu(a=1, b="", *args, **kwargs):
|
|||||||
|
|
||||||
exe = fu(list, 1, "", c=set, d="")
|
exe = fu(list, 1, "", c=set, d="")
|
||||||
|
|
||||||
#? list()
|
#? list
|
||||||
exe[0]
|
exe[0]
|
||||||
#? int()
|
#? int()
|
||||||
exe[1]
|
exe[1]
|
||||||
@@ -316,7 +316,7 @@ exe[2]
|
|||||||
exe[2][0]
|
exe[2][0]
|
||||||
#? dict()
|
#? dict()
|
||||||
exe[3]
|
exe[3]
|
||||||
#? set()
|
#? set
|
||||||
exe[3]['c']
|
exe[3]['c']
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import datetime
|
|||||||
|
|
||||||
def fooooo(obj):
|
def fooooo(obj):
|
||||||
if isinstance(obj, datetime.datetime):
|
if isinstance(obj, datetime.datetime):
|
||||||
#? datetime.datetime
|
#? datetime.datetime()
|
||||||
obj
|
obj
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ def fooooo2(obj):
|
|||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
#? int() datetime.datetime
|
#? int() datetime.datetime()
|
||||||
fooooo2('')
|
fooooo2('')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ class A(object):
|
|||||||
|
|
||||||
def before(self):
|
def before(self):
|
||||||
self.b = 3
|
self.b = 3
|
||||||
# TODO should this be so?
|
# TODO should this be so? include entries after cursor?
|
||||||
#? int() str() list()
|
#? int() str() list
|
||||||
self.b
|
self.b
|
||||||
self.b = list
|
self.b = list
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ import weakref
|
|||||||
#? int()
|
#? int()
|
||||||
weakref.proxy(1)
|
weakref.proxy(1)
|
||||||
|
|
||||||
#? weakref.ref
|
#? weakref.ref()
|
||||||
weakref.ref(1)
|
weakref.ref(1)
|
||||||
#? int()
|
#? int()
|
||||||
weakref.ref(1)()
|
weakref.ref(1)()
|
||||||
|
|||||||
Reference in New Issue
Block a user