Clean up tests

This commit is contained in:
Savannah Ostrowski 2025-11-07 09:04:35 -08:00
parent 16d138113e
commit 6fc5f688ec
1 changed files with 9 additions and 4 deletions

View File

@ -98,15 +98,20 @@ def test_request_validation_error_includes_endpoint_context():
def test_response_validation_error_includes_endpoint_context():
captured_exception.exception = None
try:
client.get("/items/")
except ResponseValidationError as exc:
error_str = str(exc)
assert "get_item" in error_str
assert "/items/" in error_str
except Exception:
pass
assert captured_exception.exception is not None
error_str = str(captured_exception.exception)
assert "get_item" in error_str
assert "/items/" in error_str
def test_websocket_validation_error_includes_endpoint_context():
captured_exception.exception = None
try:
with client.websocket_connect("/ws/invalid"):
pass # pragma: no cover