fix(webui): migrate Starlette TestClient to httpx2 (#682)
Starlette 1.3.x prefers httpx2 for starlette.testclient.TestClient; plain httpx still works but emits StarletteDeprecationWarning. - Pin httpx2==2.9.1 (keep httpx for MCP/runtime) - Centralize Web UI TestClient import via tests/webui_testclient.py - Point all test_webui_* modules at the helper - Add regression tests that the deprecation warning is gone Closes #682
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"""Canonical Web UI ``TestClient`` import for the Gitea-Tools suite (#682).
|
||||
|
||||
Starlette 1.3+ builds ``starlette.testclient.TestClient`` on ``httpx2``.
|
||||
Plain ``httpx`` still works but emits ``StarletteDeprecationWarning``.
|
||||
|
||||
All Web UI tests import ``TestClient`` from this module so:
|
||||
|
||||
* dependency intent is single-sourced (``httpx2`` in ``requirements.txt``);
|
||||
* a future client-construction helper has one place to land;
|
||||
* import-site audits do not need to re-scan every ``test_webui_*.py``.
|
||||
|
||||
Runtime MCP / FastMCP code continues to use ``httpx``; this module is
|
||||
test-only and does not change production clients.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from starlette.testclient import TestClient
|
||||
|
||||
__all__ = ["TestClient"]
|
||||
Reference in New Issue
Block a user