thanks to ast.literal_eval the order how test results are defined, doesn't matter anymore

This commit is contained in:
David Halter
2012-08-31 17:58:24 +02:00
parent 469388d72d
commit dcc3b54715
2 changed files with 4 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ arr.count(1)
# -----------------
dic = {}
#? ['clear', 'copy']
#? ['copy', 'clear']
dic.c
dic2 = dict(a=1, b=2)

View File

@@ -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