python-dependency-injector/tests/unit/samples/wiringsamples/container.py
Roman Mogylatov 4ddac663d9
Fix wiring for package init (#308)
* Add test

* Add fix

* Add extra test

* Remove package imports on discovery for Python versions < 3.6

* Move wiring samples to a different directory
2020-10-20 17:48:54 -04:00

18 lines
356 B
Python

from dependency_injector import containers, providers
from .service import Service
class SubContainer(containers.DeclarativeContainer):
int_object = providers.Object(1)
class Container(containers.DeclarativeContainer):
config = providers.Configuration()
service = providers.Factory(Service)
sub = providers.Container(SubContainer)