diff --git a/tests/unit_tests/test_base_camera.py b/tests/unit_tests/test_base_camera.py index aba5b4ea..c8b64274 100644 --- a/tests/unit_tests/test_base_camera.py +++ b/tests/unit_tests/test_base_camera.py @@ -5,6 +5,8 @@ test_simulated_camera.py and for testing the consistency of camera APIs see test_cameras.py. """ +import tempfile + import numpy as np import pytest from PIL import Image @@ -19,7 +21,8 @@ from ..shared_utils.lt_test_utils import LabThingsTestEnv def test_env() -> LabThingsTestEnv: """Yield a test environment with the Simulated Camera and Dummy Stage.""" thing_conf = {"camera": SimulatedCamera, "stage": DummyStage} - with LabThingsTestEnv(things=thing_conf) as env: + app_config = {"data_folder": tempfile.gettempdir()} + with LabThingsTestEnv(things=thing_conf, application_config=app_config) as env: yield env diff --git a/tests/unit_tests/test_metadata.py b/tests/unit_tests/test_metadata.py index 7c5f87b6..4b158e5a 100644 --- a/tests/unit_tests/test_metadata.py +++ b/tests/unit_tests/test_metadata.py @@ -1,6 +1,7 @@ """Tests that captures have the expected metadata.""" import json +import tempfile from datetime import datetime from pathlib import Path @@ -99,7 +100,8 @@ def test_env() -> LabThingsTestEnv: "stage": DummyStage, "bg_channel_deviations_luv": ChannelDeviationLUV, } - with LabThingsTestEnv(things=thing_conf) as env: + app_config = {"data_folder": tempfile.gettempdir()} + with LabThingsTestEnv(things=thing_conf, application_config=app_config) as env: yield env diff --git a/tests/unit_tests/test_simulated_camera.py b/tests/unit_tests/test_simulated_camera.py index dd499fc9..8b76106c 100644 --- a/tests/unit_tests/test_simulated_camera.py +++ b/tests/unit_tests/test_simulated_camera.py @@ -1,6 +1,7 @@ """Test the functionality specific to the simulated camera.""" import logging +import tempfile import time import numpy as np @@ -27,7 +28,10 @@ def test_env() -> LabThingsTestEnv: "stage": DummyStage, "bg_channel_deviations_luv": ChannelDeviationLUV, } - with LabThingsTestEnv(things=thing_conf) as env: + + app_config = {"data_folder": tempfile.gettempdir()} + + with LabThingsTestEnv(things=thing_conf, application_config=app_config) as env: yield env diff --git a/tests/unit_tests/test_stage.py b/tests/unit_tests/test_stage.py index f922ef65..a699b65f 100644 --- a/tests/unit_tests/test_stage.py +++ b/tests/unit_tests/test_stage.py @@ -2,6 +2,7 @@ import itertools import logging +import tempfile import threading import time from dataclasses import dataclass @@ -176,7 +177,8 @@ def test_direction_inversion(dummy_stage): def test_direction_errors_local_and_http(): """Check for expected errors both locally and over http.""" thing_conf = {"camera": SimulatedCamera, "stage": DummyStage} - with LabThingsTestEnv(things=thing_conf) as test_env: + app_config = {"data_folder": tempfile.gettempdir()} + with LabThingsTestEnv(things=thing_conf, application_config=app_config) as test_env: dummy_stage = test_env.get_thing_by_type(DummyStage) stage_client = test_env.get_thing_client("stage")