Skip to content
Snippets Groups Projects
Commit de37c242 authored by Martin Vejnár's avatar Martin Vejnár Committed by GitHub
Browse files

Merge pull request #20 from Ry4an/master

Tweak test harness to handle failures correctly
parents d883c7cf 98dc8c16
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ def _main(): ...@@ -72,7 +72,7 @@ def _main():
dumped = toml.dumps(parsed) dumped = toml.dumps(parsed)
parsed2 = toml.loads(dumped) parsed2 = toml.loads(dumped)
if parsed != parsed2: if parsed != parsed2:
failed.append((fname, None)) failed.append((fname, parsed, parsed2, None))
continue continue
with open(os.path.join(top, fname), 'rb') as fin: with open(os.path.join(top, fname), 'rb') as fin:
...@@ -90,7 +90,11 @@ def _main(): ...@@ -90,7 +90,11 @@ def _main():
succeeded.append(fname) succeeded.append(fname)
for f, parsed, bench, e in failed: for f, parsed, bench, e in failed:
print('failed: {}\n{}\n{}'.format(f, json.dumps(parsed, indent=4), json.dumps(bench, indent=4))) try:
print('failed: {}\n{}\n{}'.format(f, json.dumps(parsed, indent=4), json.dumps(bench, indent=4)))
except TypeError:
print('failed: {}\n{}\n{}'.format(f, parsed, bench))
if e: if e:
traceback.print_exception(*e) traceback.print_exception(*e)
print('succeeded: {0}'.format(len(succeeded))) print('succeeded: {0}'.format(len(succeeded)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment