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 ---------------------