[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-06-26 08:08:32 +00:00 committed by Daniel Han
commit 1e9d4cfe29

View file

@ -88,15 +88,19 @@ def _status_app(status):
async def app(scope, receive, send):
await send({"type": "http.response.start", "status": status, "headers": []})
await send({"type": "http.response.body", "body": b""})
return app
# ── status/progress poll: quiet on success, logged on error ────────────
def test_success_poll_200_suppressed(logs):
# The high-frequency /api/export/status poll (838x in a real run) is silenced.
for _ in range(5):
_run(LoggingMiddleware(_status_app(200))(_scope("/api/export/status"), _noop_receive, _send))
_run(
LoggingMiddleware(_status_app(200))(_scope("/api/export/status"), _noop_receive, _send)
)
assert logs.events == []
@ -108,7 +112,11 @@ def test_success_poll_error_is_still_logged(logs):
def test_load_progress_poll_suppressed(logs):
_run(LoggingMiddleware(_status_app(200))(_scope("/api/inference/load-progress"), _noop_receive, _send))
_run(
LoggingMiddleware(_status_app(200))(
_scope("/api/inference/load-progress"), _noop_receive, _send
)
)
assert logs.events == []