Explorar o código

integration tests: don't shadow real error when screenshot fails (#1608)

Masen Furer hai 1 ano
pai
achega
8c4183f500
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      integration/conftest.py

+ 6 - 3
integration/conftest.py

@@ -51,6 +51,9 @@ def pytest_exception_interact(node, call, report):
         str(node.nodeid).strip().replace(" ", "_").replace(":", "_"),
         str(node.nodeid).strip().replace(" ", "_").replace(":", "_"),
     )
     )
 
 
-    DISPLAY.waitgrab().save(
-        (Path(screenshot_dir) / safe_filename).with_suffix(".png"),
-    )
+    try:
+        DISPLAY.waitgrab().save(
+            (Path(screenshot_dir) / safe_filename).with_suffix(".png"),
+        )
+    except Exception as e:
+        print(f"Failed to take screenshot for {node}: {e}")