File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -442,18 +442,14 @@ async def test_unreachable_streamable_http_error_is_catchable() -> None:
442442
443443 caught : BaseException | None = None
444444
445- try :
446- async with ClientSessionGroup () as group :
447- try :
448- await group .connect_to_server (server_params )
449- except BaseException as inner :
450- # Expected post-fix: real ConnectError lands here.
451- caught = inner
452- except BaseException as outer : # pragma: no cover
453- # If we land here, the error escaped past the inner handler -- # pragma: no cover
454- # that is the regression case (masking RuntimeError surfacing # pragma: no cover
455- # from __aexit__ instead of the real ConnectError propagating). # pragma: no cover
456- caught = outer # pragma: no cover
445+ async with ClientSessionGroup () as group :
446+ try :
447+ await group .connect_to_server (server_params )
448+ except BaseException as inner :
449+ # Pre-fix #915: the real ConnectError was masked by an anyio
450+ # cancel-scope RuntimeError raised during __aexit__ teardown.
451+ # Post-fix: the real exception propagates here and is catchable.
452+ caught = inner
457453
458454 assert caught is not None , (
459455 "Expected to catch a connection error against an unreachable "
You can’t perform that action at this time.
0 commit comments