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