[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
600d23286f
commit
1e9d4cfe29
1 changed files with 10 additions and 2 deletions
|
|
@ -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 == []
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue