mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-24 18:43:58 +03:00
8eea9c4e45
* Add implementation, typing stubs, and tests * Add docs and example * Update changelog
16 lines
428 B
Python
16 lines
428 B
Python
"""Container dependencies check example."""
|
|
|
|
from dependency_injector import containers, providers
|
|
|
|
|
|
class Container(containers.DeclarativeContainer):
|
|
|
|
service1 = providers.Dependency()
|
|
service2 = providers.Dependency()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
container = Container()
|
|
container.check_dependencies() # <-- raises error:
|
|
# Container has undefined dependencies: "Container.service1", "Container.service2"
|