Skip to content

Commit a368054

Browse files
committed
fix: try this
Signed-off-by: Samantha Coyle <sam@diagrid.io>
1 parent 1aaad1d commit a368054

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/issues/test_streamable_http_405_get_stream.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,9 @@ async def test_streamable_http_client_context_manager_exception_exit_is_covered(
133133
raise RuntimeError("boom")
134134

135135
exc = excinfo.value
136-
if hasattr(exc, "exceptions"):
137-
excs = cast(_ExceptionGroupWithExceptions, exc).exceptions
138-
else:
139-
excs = (exc,)
140-
136+
# anyio always wraps exceptions in an ExceptionGroup
137+
assert hasattr(exc, "exceptions")
138+
excs = cast(_ExceptionGroupWithExceptions, exc).exceptions
141139
assert any(isinstance(inner, RuntimeError) and str(inner) == "boom" for inner in excs)
142140

143141

0 commit comments

Comments
 (0)