Skip to content

Commit

Permalink
Add error log for files with non-unicode symbol
Browse files Browse the repository at this point in the history
If temporary test result file contains non-unicode symbol, it will raise
additional logging 'TAP13 parse failed' and will fail the test.

Closes: #293
  • Loading branch information
VitaliyaIoffe authored and Totktonada committed Jun 10, 2021
1 parent b15160f commit 70960b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,12 @@ def tap_parse_print_yaml(self, yml):

def check_tap_output(self):
""" Returns is_tap, is_ok """
with open(self.tmp_result, 'r') as f:
content = f.read()
tap = pytap13.TAP13()
try:
with open(self.tmp_result, 'r') as f:
content = f.read()
tap = pytap13.TAP13()
tap.parse(content)
except ValueError as e:
except (ValueError, UnicodeDecodeError) as e:
color_stdout('\nTAP13 parse failed (%s).\n' % str(e),
schema='error')
color_stdout('\nNo result file (%s) found.\n' % self.result,
Expand Down

0 comments on commit 70960b6

Please sign in to comment.