From 1d55b146bd2c25cde3328062657bb08997bdc175 Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas@kluyver.me.uk>
Date: Wed, 22 Nov 2023 11:12:52 +0000
Subject: [PATCH] Move assert into test function, smaller stack trace on
 failure

---
 tests/test_reference_runs/test_pre_deployment.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/test_reference_runs/test_pre_deployment.py b/tests/test_reference_runs/test_pre_deployment.py
index 986ca64c5..97c768ef3 100644
--- a/tests/test_reference_runs/test_pre_deployment.py
+++ b/tests/test_reference_runs/test_pre_deployment.py
@@ -175,7 +175,7 @@ def validate_hdf5_files(
             if comparison.found_differences():
                 ok = False
 
-    assert ok, "HDF5 files changed - see details above"
+    return ok
 
 
 def slurm_watcher(test_key: str, std_out: str):
@@ -333,9 +333,9 @@ def test_xfel_calibrate(test_key: str, val_dict: dict, release_test_config: Tupl
 
     # Stop tests at this point, if desired.
     if not skip_numerical_validation:
-        validate_hdf5_files(
+        assert validate_hdf5_files(
             test_key,
             out_folder,
             reference_folder,
             cal_type,
-        )
+        ), "HDF5 files changed - see details above"
-- 
GitLab