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}")