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:
1 parent
170076ef4d
commit
d2ad20e0f8
1 file changed
+2
-1
@@ -2,6 +2,7 @@ import io
|
|||||||
import json
|
import json
|
||||||
import unittest
|
import unittest
|
||||||
import urllib.error
|
import urllib.error
|
||||||
|
from email.message import Message
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from shared_backend.authclient import (
|
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",
|
url="http://authguard.example/api/session/validate",
|
||||||
code=status,
|
code=status,
|
||||||
msg="error",
|
msg="error",
|
||||||
hdrs=None,
|
hdrs=Message(),
|
||||||
fp=io.BytesIO(body),
|
fp=io.BytesIO(body),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user