Files
romm/backend/tests/endpoints/sockets
Sam Dornan 3a01f6d359 test(backend): stop the suite emitting warnings (#4597)
* test(backend): stop the suite emitting warnings

The backend suite reported 4838 warnings. Three sources, all now clear:

- 18 uses of the deprecated HTTP_422_UNPROCESSABLE_ENTITY, renamed to
  HTTP_422_UNPROCESSABLE_CONTENT.
- Unawaited coroutines in the streaming and scan tests. A bare MagicMock
  drops the coroutine handed to spawn_sync_task, and a bare AsyncMock's
  return_value is itself an AsyncMock, so the to_dict() call on it leaked
  out of the scan handler.
- About 4780 from sentry-sdk 2.32 and opentelemetry 1.36 calling
  asyncio.iscoroutinefunction, which Python 3.14 deprecates and 3.16
  removes. Bumping both in the lock clears them.

The remaining starlette warning wants httpx2 in place of the httpx 0.27 the
metadata providers pin, so it is filtered rather than fixed: a second HTTP
stack for the test client is a larger change than the warning justifies.

4815 passed, 2 skipped, 0 warnings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(backend): address review on the warning fixes

Greptile flagged the pytest.ini rationale as over the two-line comment limit,
and the new scan fake as untyped. Both fixed: the filter comment is one
non-obvious fact, and the fake now takes `scan_stats` as a typed keyword-only
parameter, which is a real contract rather than `**kwargs`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 13:33:48 -05:00
..