From 0284ba94b6f1ea5485b02d7caf52dcae9c4d48ae Mon Sep 17 00:00:00 2001
From: Emanuele Aina <emanuele.aina@collabora.com>
Date: Fri, 9 Jul 2021 02:02:10 +0200
Subject: [PATCH] test_urls: Collect broken URLs in a list

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
---
 scripts/test_urls.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/test_urls.py b/scripts/test_urls.py
index 1a984259c..b029c03a3 100755
--- a/scripts/test_urls.py
+++ b/scripts/test_urls.py
@@ -81,7 +81,7 @@ headers={
     "User-Agent" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36",
     }
 
-broken = 0
+broken = []
 for url in urls:
     print("%s : " %(url), end='')
     sys.stdout.flush()
@@ -106,10 +106,10 @@ for url in urls:
     end = time.perf_counter()
 
     if not status:
-        broken += 1
+        broken.append(url)
     print(url, "OK" if status else "FAIL", f"{end - start:0.4f}s")
 
-print("Found %d broken URLs in %d tested" %(broken, len(urls)))
+print(f"Found {len(broken)} broken URLs in {len(urls)} tested")
 
 if broken:
     sys.exit(1)
-- 
GitLab