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