From 24ed3b343f4673b54b7b5a95bb441e1f7f93120b Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Mon, 20 Apr 2026 09:49:49 +0800 Subject: [PATCH] docs: mention fake server testing pattern (#12394) --- docs/testing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/testing.rst b/docs/testing.rst index 1e3a12e2302..87c31e6a25f 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -537,6 +537,12 @@ basis, the TestClient object can be used directly:: A full list of the utilities provided can be found at the :data:`api reference ` +For end-to-end client code that talks to an external service, it is +recommended to run a small fake server rather than patching private aiohttp +internals. The ``examples/fake_server.py`` demo shows such an approach: start +a local :class:`~aiohttp.web.Application`, point a custom resolver at it, and +exercise the client against that controlled endpoint. + Testing API Reference ---------------------