Data dir in cam_test_utils

This commit is contained in:
jaknapper 2026-05-13 16:09:34 +01:00
parent 3bbea44eaf
commit 817c53d1df
2 changed files with 39 additions and 44 deletions

View file

@ -1,5 +1,6 @@
"""Utilities to help with testing the camera."""
import tempfile
from contextlib import contextmanager
from typing import Optional
@ -23,7 +24,14 @@ def camera_test_env(settings_folder: Optional[str] = None):
"camera": StreamingPiCamera2,
"bg_channel_deviations_luv": ChannelDeviationLUV,
}
with LabThingsTestEnv(things=thing_conf, settings_folder=settings_folder) as env:
app_config = {
"data_folder": tempfile.mkdtemp(),
}
with LabThingsTestEnv(
things=thing_conf,
settings_folder=settings_folder,
application_config=app_config,
) as env:
yield env