Skip to content

Commit 24ed3b3

Browse files
docs: mention fake server testing pattern (#12394)
1 parent 53f6e91 commit 24ed3b3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/testing.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,12 @@ basis, the TestClient object can be used directly::
537537
A full list of the utilities provided can be found at the
538538
:data:`api reference <aiohttp.test_utils>`
539539

540+
For end-to-end client code that talks to an external service, it is
541+
recommended to run a small fake server rather than patching private aiohttp
542+
internals. The ``examples/fake_server.py`` demo shows such an approach: start
543+
a local :class:`~aiohttp.web.Application`, point a custom resolver at it, and
544+
exercise the client against that controlled endpoint.
545+
540546

541547
Testing API Reference
542548
---------------------

0 commit comments

Comments
 (0)