From 13da56f3fdef90b56587a09be5273324100b0f86 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Sun, 27 Jul 2025 10:40:45 +0100 Subject: [PATCH] Fixes for the background detect as required by code review --- tests/test_background_detectors.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_background_detectors.py b/tests/test_background_detectors.py index b98c607c..4fc2f395 100644 --- a/tests/test_background_detectors.py +++ b/tests/test_background_detectors.py @@ -1,7 +1,6 @@ -"""Test the scan planning algorithms of the Microscope. +"""Test the background detection algorithms. -As well as low level function by function tests, this test suite also provides tests -that simulate scanning a sample, checking that the expected path is followed. +This tests both the base class an individual algorithms. """ import re @@ -10,7 +9,6 @@ import pytest from pydantic import BaseModel import numpy as np -# Just for testing importing as from openflexure_microscope_server.background_detect import ( MissingBackgroundDataError, BackgroundDetectAlgorithm, @@ -154,6 +152,9 @@ def test_colour_channel_luv_save_load(background_image, sample_image): sample, _ = cc_luv2.image_is_sample(sample_image) assert sample + # Remove the 2nd detector so we don't accidentally use it! + del cc_luv2 + # One final test that None can be set explicitly to background data as this will # happen if loading with background detect not saved. cc_luv3 = ColourChannelDetectLUV()