Add better testing for camera gallery functions

This commit is contained in:
Julian Stirling 2026-06-21 22:48:09 +01:00
parent 03d74bb044
commit 0e24bb01f4
3 changed files with 145 additions and 10 deletions

View file

@ -24,6 +24,21 @@ REPO_ROOT = os.path.dirname(THIS_DIR)
SIM_CONFIG = os.path.join(REPO_ROOT, "ofm_config_simulation.json")
@pytest.fixture(autouse=True)
def restore_root_logger():
"""Restore the logging level of the root logger after each test.
As we change the root logging level if any code runs ``configure_logging``
this can make logs leak between tests.
"""
root = logging.getLogger()
old_level = root.level
yield
root.setLevel(old_level)
@pytest.fixture
def simulation_test_env():
"""Yield a server with the configuration from the simulation json."""