Skip to content

Commit 6f262a5

Browse files
author
RJ Lopez
committed
test(client): add coverage pragmas for regression test branches
1 parent 21348a7 commit 6f262a5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/client/test_session_group.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from unittest import mock
77

88
if sys.version_info < (3, 11):
9-
from exceptiongroup import BaseExceptionGroup # noqa: A004
9+
from exceptiongroup import BaseExceptionGroup # pragma: no cover # noqa: A004
1010

1111
import httpx
1212
import pytest
@@ -418,10 +418,10 @@ def _walk(e: BaseException | None) -> bool:
418418
return False
419419
seen.add(id(e))
420420
if isinstance(e, RuntimeError) and "cancel scope" in str(e).lower():
421-
return True
421+
return True # pragma: no cover
422422
if isinstance(e, BaseExceptionGroup):
423-
if any(_walk(child) for child in e.exceptions): # type: ignore
424-
return True
423+
if any(_walk(child) for child in e.exceptions): # type: ignore # pragma: no cover
424+
return True # pragma: no cover
425425
return _walk(e.__cause__) or _walk(e.__context__)
426426

427427
return _walk(exc)
@@ -447,7 +447,7 @@ async def test_unreachable_streamable_http_error_is_catchable() -> None:
447447
except BaseException as inner:
448448
# Expected post-fix: real ConnectError lands here.
449449
caught = inner
450-
except BaseException as outer:
450+
except BaseException as outer: # pragma: no cover
451451
# If we land here, the error escaped past the inner handler --
452452
# that is the regression case (masking RuntimeError surfacing
453453
# from __aexit__ instead of the real ConnectError propagating).

0 commit comments

Comments
 (0)