Add a note on individuals import to wiring docs

This commit is contained in:
Roman Mogylatov 2020-09-29 23:54:25 -04:00
parent 6e53a7c0c6
commit 4c039d012e

View File

@ -153,6 +153,23 @@ You can use that in testing to re-create and re-wire a container before each tes
Wiring can take time if you have a large codebase. Consider to persist a container instance and
avoid re-wiring between tests.
.. note::
Python has a limitation on patching already imported individual members. To protect from errors
prefer an import of modules instead of individual members or make sure that imports happen
after the wiring:
.. code-block:: python
from . import module
module.fn()
# instead of
from .module import fn
fn()
Integration with other frameworks
---------------------------------