From 882414596d9ae5ce302cc07e60480c938b0658ce Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Fri, 20 Feb 2026 16:20:33 +0000 Subject: [PATCH] Fix smart scan tests --- tests/unit_tests/test_smart_scan.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit_tests/test_smart_scan.py b/tests/unit_tests/test_smart_scan.py index a41d96d5..f89010e3 100644 --- a/tests/unit_tests/test_smart_scan.py +++ b/tests/unit_tests/test_smart_scan.py @@ -324,6 +324,9 @@ def _run_only_outer_scan( assert smart_scan_thing._scan_lock.locked() mocker.patch.object(smart_scan_thing, "_run_scan", side_effect=check_locked) + mock_save_logs = mocker.patch( + "openflexure_microscope_server.scan_directories.save_invocation_logs" + ) if adjust_initial_state is not None: adjust_initial_state(smart_scan_thing) @@ -336,6 +339,7 @@ def _run_only_outer_scan( exec_info = e assert not smart_scan_thing._scan_lock.locked() + assert mock_save_logs.call_count >= 1 # Return the mock thing for further state testing, and the # exec_info of any uncaught exceptions that were raised