Skip to content

Commit 70960b6

Browse files
VitaliyaIoffeTotktonada
authored andcommitted
Add error log for files with non-unicode symbol
If temporary test result file contains non-unicode symbol, it will raise additional logging 'TAP13 parse failed' and will fail the test. Closes: #293
1 parent b15160f commit 70960b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,12 @@ def tap_parse_print_yaml(self, yml):
341341

342342
def check_tap_output(self):
343343
""" Returns is_tap, is_ok """
344-
with open(self.tmp_result, 'r') as f:
345-
content = f.read()
346-
tap = pytap13.TAP13()
347344
try:
345+
with open(self.tmp_result, 'r') as f:
346+
content = f.read()
347+
tap = pytap13.TAP13()
348348
tap.parse(content)
349-
except ValueError as e:
349+
except (ValueError, UnicodeDecodeError) as e:
350350
color_stdout('\nTAP13 parse failed (%s).\n' % str(e),
351351
schema='error')
352352
color_stdout('\nNo result file (%s) found.\n' % self.result,

0 commit comments

Comments
 (0)