ci: add strict-no-cover to detect unnecessary coverage pragmas (#1897)

This commit is contained in:
Max Isbey 2026-01-23 20:00:20 +00:00 • committed by GitHub
commit a7ddfdae07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -97,8 +97,7 @@ async def test_request_cancellation():
)
# Give cancellation time to process
# TODO(Marcelo): Drop the pragma once https://github.com/coveragepy/coveragepy/issues/1987 is fixed.
with anyio.fail_after(1): # pragma: no cover
with anyio.fail_after(1): # pragma: no branch
await ev_cancelled.wait()
@ -149,8 +148,7 @@ async def test_response_id_type_mismatch_string_to_int():
tg.start_soon(mock_server)
tg.start_soon(make_request, client_session)
# TODO(Marcelo): Drop the pragma once https://github.com/coveragepy/coveragepy/issues/1987 is fixed.
with anyio.fail_after(2): # pragma: no cover
with anyio.fail_after(2): # pragma: no branch
await ev_response_received.wait()
assert len(result_holder) == 1
@ -205,8 +203,7 @@ async def test_error_response_id_type_mismatch_string_to_int():
tg.start_soon(mock_server)
tg.start_soon(make_request, client_session)
# TODO(Marcelo): Drop the pragma once https://github.com/coveragepy/coveragepy/issues/1987 is fixed.
with anyio.fail_after(2): # pragma: no cover
with anyio.fail_after(2): # pragma: no branch
await ev_error_received.wait()
assert len(error_holder) == 1
@ -260,8 +257,7 @@ async def test_response_id_non_numeric_string_no_match():
tg.start_soon(mock_server)
tg.start_soon(make_request, client_session)
# TODO(Marcelo): Drop the pragma once https://github.com/coveragepy/coveragepy/issues/1987 is fixed.
with anyio.fail_after(2): # pragma: no cover
with anyio.fail_after(2): # pragma: no branch
await ev_timeout.wait()
@ -305,8 +301,7 @@ async def test_connection_closed():
tg.start_soon(make_request, client_session)
tg.start_soon(mock_server)
# TODO(Marcelo): Drop the pragma once https://github.com/coveragepy/coveragepy/issues/1987 is fixed.
with anyio.fail_after(1): # pragma: no cover
with anyio.fail_after(1):
await ev_closed.wait()
with anyio.fail_after(1): # pragma: no cover
with anyio.fail_after(1): # pragma: no branch
await ev_response.wait()