File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ def handler(request: httpx2.Request) -> httpx2.Response: # noqa: ARG001
351351 )
352352 with pytest .raises (ResponseTooLargeError ) as caught :
353353 async with client .stream ("GET" , "https://example.test/x" ):
354- pass
354+ pytest . fail ( "unreachable" ) # pragma: no cover
355355 assert caught .value .limit == 10 # noqa: PLR2004 — mirrors max_error_body_bytes above
356356 assert caught .value .content_length == 200 # noqa: PLR2004 — len(body) above
357357 await client .aclose ()
@@ -368,7 +368,7 @@ def handler(request: httpx2.Request) -> httpx2.Response: # noqa: ARG001
368368 )
369369 with pytest .raises (NotFoundError ) as caught :
370370 async with client .stream ("GET" , "https://example.test/x" ):
371- pass
371+ pytest . fail ( "unreachable" ) # pragma: no cover
372372 assert caught .value .response .content == body
373373 await client .aclose ()
374374
@@ -382,7 +382,7 @@ def handler(request: httpx2.Request) -> httpx2.Response: # noqa: ARG001
382382 client = AsyncClient (httpx2_client = httpx2 .AsyncClient (transport = httpx2 .MockTransport (handler )))
383383 with pytest .raises (InternalServerError ) as caught :
384384 async with client .stream ("GET" , "https://example.test/x" ):
385- pass
385+ pytest . fail ( "unreachable" ) # pragma: no cover
386386 assert caught .value .response .content == body
387387 await client .aclose ()
388388
Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ def handler(request: httpx2.Request) -> httpx2.Response: # noqa: ARG001
316316
317317 client = Client (httpx2_client = httpx2 .Client (transport = httpx2 .MockTransport (handler )), max_error_body_bytes = 10 )
318318 with pytest .raises (ResponseTooLargeError ) as caught , client .stream ("GET" , "https://example.test/x" ):
319- pass
319+ pytest . fail ( "unreachable" ) # pragma: no cover
320320 assert caught .value .limit == 10 # noqa: PLR2004 — mirrors max_error_body_bytes above
321321 assert caught .value .content_length == 200 # noqa: PLR2004 — len(body) above
322322 client .close ()
@@ -330,7 +330,7 @@ def handler(request: httpx2.Request) -> httpx2.Response: # noqa: ARG001
330330
331331 client = Client (httpx2_client = httpx2 .Client (transport = httpx2 .MockTransport (handler )), max_error_body_bytes = 1000 )
332332 with pytest .raises (NotFoundError ) as caught , client .stream ("GET" , "https://example.test/x" ):
333- pass
333+ pytest . fail ( "unreachable" ) # pragma: no cover
334334 assert caught .value .response .content == body
335335 client .close ()
336336
@@ -343,6 +343,6 @@ def handler(request: httpx2.Request) -> httpx2.Response: # noqa: ARG001
343343
344344 client = Client (httpx2_client = httpx2 .Client (transport = httpx2 .MockTransport (handler )))
345345 with pytest .raises (InternalServerError ) as caught , client .stream ("GET" , "https://example.test/x" ):
346- pass
346+ pytest . fail ( "unreachable" ) # pragma: no cover
347347 assert caught .value .response .content == body
348348 client .close ()
You can’t perform that action at this time.
0 commit comments