mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-12-01 22:14:04 +03:00
c964253204
* Rename container tests * Add implementation + tests * Update changelog * Add examples and docs
20 lines
543 B
ReStructuredText
20 lines
543 B
ReStructuredText
Reset container singletons
|
|
--------------------------
|
|
|
|
To reset all container singletons use method ``.reset_singletons()``.
|
|
|
|
.. literalinclude:: ../../examples/containers/reset_singletons.py
|
|
:language: python
|
|
:lines: 3-
|
|
:emphasize-lines: 16
|
|
|
|
Method ``.reset_singletons()`` also resets singletons in sub-containers: ``providers.Container`` and
|
|
``providers.DependenciesContainer.``
|
|
|
|
.. literalinclude:: ../../examples/containers/reset_singletons_subcontainers.py
|
|
:language: python
|
|
:lines: 3-
|
|
:emphasize-lines: 21
|
|
|
|
.. disqus::
|