From 8c4183f500c50c79ad10ed2e824f30318c88e458 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Wed, 16 Aug 2023 13:05:36 -0700 Subject: [PATCH] integration tests: don't shadow real error when screenshot fails (#1608) --- integration/conftest.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/integration/conftest.py b/integration/conftest.py index cb0704635..92e0613fb 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -51,6 +51,9 @@ def pytest_exception_interact(node, call, report): 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}")