Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_resolves_instances_with_singleton_scope():
container = Container()
container.register(MessageWriter, StdoutMessageWriter, scope=Scope.singleton)
mw1 = container.resolve(MessageWriter)
mw2 = container.resolve(MessageWriter)
expect(mw1).to(equal(mw2))