File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
13import contextlib
24import socket
5+ import sys
36from unittest import mock
47
8+ if sys .version_info < (3 , 11 ):
9+ from exceptiongroup import BaseExceptionGroup # noqa: A004
10+
511import httpx
612import pytest
713
@@ -414,7 +420,7 @@ def _walk(e: BaseException | None) -> bool:
414420 if isinstance (e , RuntimeError ) and "cancel scope" in str (e ).lower ():
415421 return True
416422 if isinstance (e , BaseExceptionGroup ):
417- if any (_walk (child ) for child in e .exceptions ):
423+ if any (_walk (child ) for child in e .exceptions ): # type: ignore
418424 return True
419425 return _walk (e .__cause__ ) or _walk (e .__context__ )
420426
@@ -438,10 +444,10 @@ async def test_unreachable_streamable_http_error_is_catchable() -> None:
438444 async with ClientSessionGroup () as group :
439445 try :
440446 await group .connect_to_server (server_params )
441- except BaseException as inner : # noqa: BLE001
447+ except BaseException as inner :
442448 # Expected post-fix: real ConnectError lands here.
443449 caught = inner
444- except BaseException as outer : # noqa: BLE001
450+ except BaseException as outer :
445451 # If we land here, the error escaped past the inner handler --
446452 # that is the regression case (masking RuntimeError surfacing
447453 # from __aexit__ instead of the real ConnectError propagating).
You can’t perform that action at this time.
0 commit comments