aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDelan Azabani <dazabani@igalia.com>2025-04-08 19:19:09 +0800
committerDelan Azabani <dazabani@igalia.com>2025-04-08 19:25:56 +0800
commit4f20ea40283ecd8c0d79b5351a0eb6738284e9d6 (patch)
tree3e4181b687afd9e286b910effc22a0f92b2e943a
parent3b1373e3ed0ae68aa81b1a97dd5ed9e6edf8db89 (diff)
downloadservo-devtools-testing.tar.gz
servo-devtools-testing.zip
Print the assertion when it failsdevtools-testing
Co-authored-by: Aria Edmonds <aria@ar1as.space> Signed-off-by: Delan Azabani <dazabani@igalia.com>
-rw-r--r--python/servo/devtools_tests.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/python/servo/devtools_tests.py b/python/servo/devtools_tests.py
index 2a305e656a4..cd4c6374876 100644
--- a/python/servo/devtools_tests.py
+++ b/python/servo/devtools_tests.py
@@ -21,6 +21,7 @@ import subprocess
import sys
import time
from threading import Thread
+from typing import Optional
def run_tests(script_path):
@@ -100,10 +101,14 @@ def sources_test(client, base_url):
def on_source_resource(data):
for [resource_type, sources] in data["array"]:
- # FIXME: If these assertions fail, we just see TimeoutError with no further information
- assert resource_type == "source"
- assert [source["url"] for source in sources] == [f"{base_url}/classic.js", f"{base_url}/test.html", "https://servo.org/js/load-table.js"]
- done.set_result(True)
+ try:
+ assert resource_type == "source"
+ assert [source["url"] for source in sources] == [f"{base_url}/classic.js", f"{base_url}/test.html", "https://servo.org/js/load-table.js"]
+ done.set_result(None)
+ except Exception as e:
+ # Raising here does nothing, for some reason.
+ # Send the exception back so it can be raised.
+ done.set_result(e)
client.add_event_listener(
target["actor"],
@@ -112,5 +117,7 @@ def sources_test(client, base_url):
)
watcher.watch_resources([Resources.SOURCE])
- assert done.result(1)
+ result: Optional[Exception] = done.result(1)
+ if result:
+ raise result
client.disconnect()