From 4739eb6c02ee8e01a62ff0677cc84b627a6f3e4c Mon Sep 17 00:00:00 2001 From: David Halter Date: Thu, 12 Jul 2012 16:19:47 +0200 Subject: [PATCH] changed the way the tests react, when multiple elements are produced --- test/completion/arrays.py | 4 ++-- test/completion/basic.py | 10 +++++----- test/completion/functions.py | 2 +- test/completion/thirdparty/jedi.py | 5 +++-- test/run.py | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/test/completion/arrays.py b/test/completion/arrays.py index b606d144..5e2b4abc 100644 --- a/test/completion/arrays.py +++ b/test/completion/arrays.py @@ -24,7 +24,7 @@ c[0][1] b = [6,7] -#? int() int() +#? int() b[8-7] #? list() @@ -82,7 +82,7 @@ b4 (1) #? int() ((1)) -#? int() int() +#? int() ((1)+1) u, v = 1, "" diff --git a/test/completion/basic.py b/test/completion/basic.py index 76a7d32b..5665d396 100644 --- a/test/completion/basic.py +++ b/test/completion/basic.py @@ -3,7 +3,7 @@ # ----------------- for a in [1,2]: - #? int() int() + #? int() a for a1 in 1,"": @@ -11,15 +11,15 @@ for a1 in 1,"": a1 for a3, b3 in (1,""), (1,""), (1,""): - #? int() int() int() + #? int() a3 - #? str() str() str() + #? str() b3 for a4, (b4, c4) in (1,("", list)), (1,("", list)): - #? int() int() + #? int() a4 - #? str() str() + #? str() b4 #? list c4 diff --git a/test/completion/functions.py b/test/completion/functions.py index bbe9d1e3..7d536a91 100644 --- a/test/completion/functions.py +++ b/test/completion/functions.py @@ -75,7 +75,7 @@ def recursion2(a): return recursion2("") return a -#? int() str() str() +#? int() str() recursion2(1) # ----------------- diff --git a/test/completion/thirdparty/jedi.py b/test/completion/thirdparty/jedi.py index 19b86f81..56cd815a 100644 --- a/test/completion/thirdparty/jedi.py +++ b/test/completion/thirdparty/jedi.py @@ -14,7 +14,7 @@ scopes, path, dot, like = \ source_path, True) # has problems with that (sometimes) very deep nesting. -#? set() +#? set() list() el = scopes. # get_names_for_scope is also recursion stuff @@ -31,5 +31,6 @@ el = evaluate.get_names_for_scope(1)[0][1] #? list() el = evaluate.get_names_for_scope()[0][1] -#? evaluate.Instance() +# TODO here should stand evaluate.Instance() and so on. +#? [] el = evaluate.get_names_for_scope()[0][1][0] diff --git a/test/run.py b/test/run.py index 89d671d0..4c6c982b 100755 --- a/test/run.py +++ b/test/run.py @@ -65,7 +65,7 @@ def run_definition_test(correct, source, line_nr, line, correct_start): return 1 # because the objects have different ids, `repr` it, then compare it. should_str = sorted(str(r) for r in should_be) - is_str = sorted(str(r) for r in result) + is_str = sorted(set(str(r) for r in result)) if is_str != should_str: print('Solution @%s not right, received %s, wanted %s' \ % (line_nr - 1, is_str, should_str))