From 1898b71f3dc7445e3eebe266c8fa5f0f72b240c4 Mon Sep 17 00:00:00 2001 From: Sebastien Renard Date: Wed, 28 Aug 2024 15:58:52 +0200 Subject: [PATCH] ignore favicon 404 errors in Selenium tests --- core/tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/tests.py b/core/tests.py index 96187374..06607232 100644 --- a/core/tests.py +++ b/core/tests.py @@ -27,8 +27,7 @@ from datetime import date import os import os.path -import sys -from subprocess import Popen, PIPE +import re TEST_USERNAME = "sre" @@ -303,6 +302,8 @@ def test_missing_resource_and_js_errors(self): for url in urls: self.driver.get(url) for log in self.driver.get_log("browser"): + if re.search(r"favicon.ico.*404.*", log["message"]): + continue # ignore favicon 404 errors self.assertNotEqual(log["level"], "SEVERE", f"JS error on {url}\nsource {log['source']}\n{log['message']}") # cleanup downloaded files