From 6528411271f49540140ec951953c2beeaf1570c1 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Thu, 3 Sep 2020 17:00:14 -0400 Subject: [PATCH] Add container usage for object provider example --- examples/providers/object.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/providers/object.py b/examples/providers/object.py index 7da9cb26..d0066153 100644 --- a/examples/providers/object.py +++ b/examples/providers/object.py @@ -1,10 +1,14 @@ """`Object` provider example.""" -from dependency_injector import providers +from dependency_injector import containers, providers -object_provider = providers.Object(1) +class Container(containers.DeclarativeContainer): + + object_provider = providers.Object(1) if __name__ == '__main__': - assert object_provider() == 1 + container = Container() + + assert container.object_provider() == 1