Skip to content

Commit 2d3c110

Browse files
committed
Use assert_never for timeout match fallback
1 parent b4355ac commit 2d3c110

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ log_cli = true
333333
[tool.coverage]
334334
run.branch = true
335335
report.exclude_also = [
336+
"case _ as unreachable:\n\\s*assert_never\\(",
336337
"if TYPE_CHECKING:",
337338
]
338339
report.show_missing = true

src/vws/transports.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""HTTP transport implementations for VWS clients."""
22

33
from collections.abc import Awaitable
4-
from typing import Protocol, Self, runtime_checkable
4+
from typing import Protocol, Self, assert_never, runtime_checkable
55

66
import httpx
77
import requests
@@ -164,8 +164,8 @@ def __call__(
164164
write=None,
165165
pool=None,
166166
)
167-
case _: # pragma: no cover
168-
raise AssertionError
167+
case _ as unreachable:
168+
assert_never(unreachable) # pyrefly: ignore[bad-argument-type] # ty: ignore[type-assertion-failure]
169169

170170
httpx_response = self._client.request(
171171
method=method,
@@ -289,8 +289,8 @@ async def __call__(
289289
write=None,
290290
pool=None,
291291
)
292-
case _: # pragma: no cover
293-
raise AssertionError
292+
case _ as unreachable:
293+
assert_never(unreachable) # pyrefly: ignore[bad-argument-type] # ty: ignore[type-assertion-failure]
294294

295295
httpx_response = await self._client.request(
296296
method=method,

0 commit comments

Comments
 (0)