From d2ad20e0f8b508e277f7a79c6b0eed3458694422 Mon Sep 17 00:00:00 2001 From: Gabriel20xx Date: Tue, 1 Sep 2026 11:23:21 +0200 Subject: [PATCH] Fix ty type error in authclient test: HTTPError needs a Message, not None urllib.error.HTTPError's stub declares hdrs: Message (non-optional); passing None works at runtime but fails strict type checking. Heretic's lint workflow runs ty over its full tree including the vendored shared/ snapshot, which is what caught this - construct an empty Message() instead, identical runtime behavior. Co-Authored-By: Claude Sonnet 5 --- packages/python-backend/tests/test_authclient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/python-backend/tests/test_authclient.py b/packages/python-backend/tests/test_authclient.py index 7106154..f636ee5 100644 --- a/packages/python-backend/tests/test_authclient.py +++ b/packages/python-backend/tests/test_authclient.py @@ -2,6 +2,7 @@ import io import json import unittest import urllib.error +from email.message import Message from unittest.mock import patch from shared_backend.authclient import ( @@ -37,7 +38,7 @@ def _fake_http_error(status: int, payload: dict) -> urllib.error.HTTPError: url="http://authguard.example/api/session/validate", code=status, msg="error", - hdrs=None, + hdrs=Message(), fp=io.BytesIO(body), )