mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-20 10:28:26 +08:00
tests added / error catch
This commit is contained in:
@@ -96,3 +96,19 @@ u1.real
|
||||
(u1).real
|
||||
#? []
|
||||
u1.upper
|
||||
|
||||
# -----------------
|
||||
# should fail
|
||||
# -----------------
|
||||
(f, g) = (1,)
|
||||
#? ['imag']
|
||||
f.imag
|
||||
#? []
|
||||
g.upper
|
||||
|
||||
(f1, g1) = 1
|
||||
#? []
|
||||
f1.
|
||||
#? []
|
||||
g1.
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ class TestClass(object):
|
||||
#? ['var_class', 'var_inst', 'var_local']
|
||||
self.var_
|
||||
|
||||
def ret(self, a1):
|
||||
return a1
|
||||
|
||||
inst = TestClass(1)
|
||||
|
||||
#? ['var_class', 'var_inst', 'var_local']
|
||||
@@ -17,3 +20,6 @@ inst.var
|
||||
|
||||
#? ['var_class']
|
||||
TestClass.var_class
|
||||
|
||||
#? ['real']
|
||||
TestClass().ret(1).real
|
||||
|
||||
@@ -35,7 +35,7 @@ def completion_test(source):
|
||||
completions = functions.complete(source, line_nr, 999,
|
||||
completion_test_dir)
|
||||
except:
|
||||
print 'test: %s' % line
|
||||
print 'test @%s: %s' % (line_nr, line)
|
||||
print traceback.format_exc()
|
||||
fails += 1
|
||||
else:
|
||||
@@ -43,7 +43,7 @@ def completion_test(source):
|
||||
# TODO remove set! duplicates should not be normal
|
||||
comp_str = str(sorted(set([str(c) for c in completions])))
|
||||
if comp_str != correct:
|
||||
print 'Solution on %s not correct, received %s, wanted %s'\
|
||||
print 'Solution on @%s not correct, received %s, wanted %s'\
|
||||
% (line_nr, comp_str, correct)
|
||||
#print [(c.name, c.name.parent) for c in completions]
|
||||
fails += 1
|
||||
|
||||
Reference in New Issue
Block a user