From d88540f2e0640a0417be76812346fe92b3b16760 Mon Sep 17 00:00:00 2001 From: matejcik Date: Tue, 18 Feb 2020 10:20:02 +0100 Subject: [PATCH] tests: do not error out when fixtures fail to download --- tests/ui_tests/report.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/ui_tests/report.py b/tests/ui_tests/report.py index 281cdb52dc..5d16f86ec2 100644 --- a/tests/ui_tests/report.py +++ b/tests/ui_tests/report.py @@ -7,7 +7,8 @@ from itertools import zip_longest from pathlib import Path import dominate -from dominate.tags import a, div, h1, h2, hr, i, img, p, table, td, th, tr +from dominate.tags import a, div, h1, h2, hr, i, img, p, strong, table, td, th, tr +from dominate.util import text from . import download @@ -102,19 +103,26 @@ def failed(fixture_test_path, test_name, actual_hash, expected_hash): recorded_path = fixture_test_path / "recorded" actual_path = fixture_test_path / "actual" + download_failed = False + if not recorded_path.exists(): recorded_path.mkdir() - download.fetch_recorded(expected_hash, recorded_path) + try: + download.fetch_recorded(expected_hash, recorded_path) + except Exception: + download_failed = True recorded_screens = sorted(recorded_path.iterdir()) actual_screens = sorted(actual_path.iterdir()) - if not recorded_screens: - return - with doc: _header(test_name, expected_hash, actual_hash) + if download_failed: + with p(): + strong("WARNING:") + text(" failed to download recorded fixtures. Is this a new test case?") + with table(border=1, width=600): with tr(): th("Expected")