From dcc3b54715a0d1a3b271119733878e58876f93a8 Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 31 Aug 2012 17:58:24 +0200 Subject: [PATCH] thanks to ast.literal_eval the order how test results are defined, doesn't matter anymore --- test/completion/types.py | 2 +- test/run.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/completion/types.py b/test/completion/types.py index 0f509598..1dfc11b2 100644 --- a/test/completion/types.py +++ b/test/completion/types.py @@ -44,7 +44,7 @@ arr.count(1) # ----------------- dic = {} -#? ['clear', 'copy'] +#? ['copy', 'clear'] dic.c dic2 = dict(a=1, b=2) diff --git a/test/run.py b/test/run.py index 84c2b0ab..cec724dc 100755 --- a/test/run.py +++ b/test/run.py @@ -7,7 +7,7 @@ import traceback os.chdir(os.path.dirname(os.path.abspath(__file__)) + '/..') sys.path.append('.') -from _compatibility import unicode, BytesIO, reduce +from _compatibility import unicode, BytesIO, reduce, literal_eval import functions import debug @@ -32,8 +32,8 @@ def run_completion_test(correct, source, line_nr, line, path): return 1 else: # TODO remove set! duplicates should not be normal - comp_str = str(sorted(set([c.word for c in completions]))) - if comp_str != correct: + comp_str = set([c.word for c in completions]) + if comp_str != set(literal_eval(correct)): print('Solution @%s not right, received %s, wanted %s'\ % (line_nr - 1, comp_str, correct)) return 1