Skip to content

Commit

Permalink
Fix #18. (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
thoward27 authored Jan 7, 2020
1 parent c06ae65 commit 8be2f56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grade/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def run(self, test) -> Result:
# setUpClass failed.
tests = [m for t in test for m in t.getTests()]
results.data['tests'] = [
{'name': t.__qualname__, 'max_score': 0, 'score': '0', 'output': [f'{e[0]}: {e[1]}' for e in results.errors]} for
k, t in tests]
{'name': t.__qualname__, 'max_score': 0, 'score': '0', 'output': ';\n'.join([f'{e[0]}: {e[1]}' for e in results.errors])}
for k, t in tests]

return results
4 changes: 4 additions & 0 deletions test/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def test_json_successful(self):
self.assertIn('visibility', results)

self.assertIn('execution_time', results)

self.assertIsInstance(results['tests'][0]['output'], str)
return

def test_markdown_successful(self):
Expand Down Expand Up @@ -149,3 +151,5 @@ def test_results(self):
results = json.loads(results.json)

self.assertEqual(len(results['tests']), 1)
self.assertIsInstance(results['tests'][0]['output'], str)
self.assertNotEqual(results['tests'][0]['output'], '')

0 comments on commit 8be2f56

Please sign in to comment.