diff --git a/tests/hardware_specific_tests/picamera2/cam_test_utils.py b/tests/hardware_specific_tests/picamera2/cam_test_utils.py index ebe86980..73033dc7 100644 --- a/tests/hardware_specific_tests/picamera2/cam_test_utils.py +++ b/tests/hardware_specific_tests/picamera2/cam_test_utils.py @@ -34,4 +34,4 @@ def camera_test_client(settings_folder: Optional[str] = None): temporary directory will be used as the settings folder. """ with camera_test_env(settings_folder=settings_folder) as env: - return env.get_thing_client("camera") + yield env.get_thing_client("camera") diff --git a/tests/hardware_specific_tests/picamera2/conftest.py b/tests/hardware_specific_tests/picamera2/conftest.py index 63b3500f..cc40566f 100644 --- a/tests/hardware_specific_tests/picamera2/conftest.py +++ b/tests/hardware_specific_tests/picamera2/conftest.py @@ -4,18 +4,18 @@ import pytest import labthings_fastapi as lt -from .cam_test_utils import camera_test_client_and_server +from .cam_test_utils import camera_test_env @pytest.fixture def picamera_test_env() -> lt.ThingClient: """Initialise a test environment with only a StreamingPiCamera2 Thing.""" - with camera_test_client_and_server() as env: + with camera_test_env() as env: yield env @pytest.fixture def picamera_client() -> lt.ThingClient: """Initialise a test picamera_client (in a LabThings test env).""" - with camera_test_client_and_server() as env: - return env.get_thing_client["camera"] + with camera_test_env() as env: + yield env.get_thing_client("camera") diff --git a/tests/hardware_specific_tests/picamera2/test_calibration.py b/tests/hardware_specific_tests/picamera2/test_calibration.py index f02e363a..768461f9 100644 --- a/tests/hardware_specific_tests/picamera2/test_calibration.py +++ b/tests/hardware_specific_tests/picamera2/test_calibration.py @@ -10,7 +10,7 @@ from .cam_test_utils import camera_test_client def test_calibration(picamera_test_env): """Check that full auto calibrate completes and set the expected values.""" - picamera_client, server = picamera_test_env.get_thing_client["camera"] + picamera_client = picamera_test_env.get_thing_client("camera") picamera_thing = picamera_test_env.get_thing_by_type(StreamingPiCamera2) # Check the calibration_required property used by the calibration wizard assert picamera_thing.calibration_required