Changes from review

This commit is contained in:
jaknapper 2026-05-14 10:52:33 +01:00
parent 5be8b0ecab
commit cbfbd84fa9
7 changed files with 14 additions and 21 deletions

View file

@ -5,8 +5,6 @@ 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
@ -21,8 +19,7 @@ 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}
app_config = {"data_folder": tempfile.gettempdir()}
with LabThingsTestEnv(things=thing_conf, application_config=app_config) as env:
with LabThingsTestEnv(things=thing_conf) as env:
yield env

View file

@ -1,7 +1,6 @@
"""Tests that captures have the expected metadata."""
import json
import tempfile
from datetime import datetime
from pathlib import Path
@ -100,8 +99,7 @@ def test_env() -> LabThingsTestEnv:
"stage": DummyStage,
"bg_channel_deviations_luv": ChannelDeviationLUV,
}
app_config = {"data_folder": tempfile.gettempdir()}
with LabThingsTestEnv(things=thing_conf, application_config=app_config) as env:
with LabThingsTestEnv(things=thing_conf) as env:
yield env

View file

@ -1,7 +1,6 @@
"""Test the functionality specific to the simulated camera."""
import logging
import tempfile
import time
import numpy as np
@ -29,9 +28,7 @@ def test_env() -> LabThingsTestEnv:
"bg_channel_deviations_luv": ChannelDeviationLUV,
}
app_config = {"data_folder": tempfile.gettempdir()}
with LabThingsTestEnv(things=thing_conf, application_config=app_config) as env:
with LabThingsTestEnv(things=thing_conf) as env:
yield env

View file

@ -2,7 +2,6 @@
import itertools
import logging
import tempfile
import threading
import time
from dataclasses import dataclass
@ -177,8 +176,7 @@ 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}
app_config = {"data_folder": tempfile.gettempdir()}
with LabThingsTestEnv(things=thing_conf, application_config=app_config) as test_env:
with LabThingsTestEnv(things=thing_conf) as test_env:
dummy_stage = test_env.get_thing_by_type(DummyStage)
stage_client = test_env.get_thing_client("stage")