From b46f8af8e70be616020d2c6ac6eb864a15c0ee03 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Fri, 9 Jan 2026 16:43:14 +0000 Subject: [PATCH] Bump labthings-fastapi to 0.0.14 and fix error types in unit tests --- pyproject.toml | 2 +- tests/unit_tests/test_stage.py | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d3d48bee..d70dbb2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ classifiers = [ "Operating System :: OS Independent", ] dependencies = [ - "labthings-fastapi==0.0.13", + "labthings-fastapi==0.0.14", "sangaboard", "camera-stage-mapping ~= 0.1.10", "opencv-python ~= 4.11.0", diff --git a/tests/unit_tests/test_stage.py b/tests/unit_tests/test_stage.py index 65b6ab63..aeedc0dc 100644 --- a/tests/unit_tests/test_stage.py +++ b/tests/unit_tests/test_stage.py @@ -3,7 +3,6 @@ import itertools import pytest -from httpx import HTTPStatusError from hypothesis import HealthCheck, given, settings from hypothesis import strategies as st @@ -155,10 +154,8 @@ def test_direction_errors_local_and_http(): assert stage_client.axis_inverted == {"x": True, "y": False, "z": False} # Can't set an arbitrary value via a client as read only: - with pytest.raises(HTTPStatusError) as excinfo: + with pytest.raises(lt.exceptions.ClientPropertyError): stage_client.axis_inverted = {"x": 2, "y": 1, "z": 1} - # Read only should set a 405 error code ... - assert excinfo.value.response.status_code == 405 # ... and should not modify the initial value assert stage_client.axis_inverted == {"x": True, "y": False, "z": False} @@ -166,10 +163,9 @@ def test_direction_errors_local_and_http(): # Should error if axis doesn't exist, this is a KeyError in the server with pytest.raises(KeyError): dummy_stage.invert_axis_direction(axis="theta") - # But a 422 over HTTP - with pytest.raises(HTTPStatusError) as excinfo: + # But a FailedToInvokeActionError over HTTP + with pytest.raises(lt.exceptions.FailedToInvokeActionError): stage_client.invert_axis_direction(axis="theta") - assert excinfo.value.response.status_code == 422 def _test_move_relative(dummy_stage, axis_inverted, path):