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 <noreply@anthropic.com>
This commit is contained in:
Gabriel20xxandClaude Sonnet 5 committed 2026-09-01 11:23:21 +02:00
1 parent 170076ef4d
commit d2ad20e0f8
1 file changed
+2 -1
@@ -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),
)