Make WPT results output more useful

Before when a subtest failed, the text of the failed assertion was not
printed. This changes makes sure that it is printed in both the console
and the aggregated test output.

Also fix a couple typing errors.
This commit is contained in:
Martin Robinson 2023-04-25 13:13:27 +02:00
parent 7114b31cf7
commit 379b3d03c8
2 changed files with 13 additions and 9 deletions

View file

@ -93,7 +93,8 @@ class UnexpectedResult():
# Test names sometimes contain control characters, which we want
# to be printed in their raw form, and not their interpreted form.
first_line += f" {result.path.encode('unicode-escape').decode('utf-8')}"
title = result.subtest if isinstance(result, UnexpectedSubtestResult) else result.path
first_line += f" {title.encode('unicode-escape').decode('utf-8')}"
if isinstance(result, UnexpectedResult) and result.issues:
first_line += f" ({', '.join([f'#{bug}' for bug in result.issues])})"