Skip to content

Commit 6d81b02

Browse files
[PR #12394/24ed3b34 backport][3.14] docs: mention fake server testing pattern (#12396)
**This is a backport of PR #12394 as merged into master (24ed3b3).** Fixes #980. Co-authored-by: nightcityblade <[email protected]>
1 parent 3c56715 commit 6d81b02

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

docs/testing.rst

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

493+
For end-to-end client code that talks to an external service, it is
494+
recommended to run a small fake server rather than patching private aiohttp
495+
internals. The ``examples/fake_server.py`` demo shows such an approach: start
496+
a local :class:`~aiohttp.web.Application`, point a custom resolver at it, and
497+
exercise the client against that controlled endpoint.
498+
493499

494500
Testing API Reference
495501
---------------------

0 commit comments

Comments
 (0)