def setUp(self) -> None: self.container = Container(config={'a': {'b': {'c': 10}}}) self.container.wire( modules=[module], packages=[package], ) self.addCleanup(self.container.unwire)
def test_bypass_marker_injection(self): container = Container() container.wire(modules=[module]) self.addCleanup(container.unwire) service = module.test_function(service=Provide[Container.service]) self.assertIsInstance(service, Service)
def test_wire_queue(self) -> None: from wiringsamples import queuemodule container = Container() self.addCleanup(container.unwire) # Should not raise exception # See: https://github.com/ets-labs/python-dependency-injector/issues/362 try: container.wire(modules=[queuemodule]) except: raise
def setUp(self) -> None: self.container = Container(config={'a': {'b': {'c': 10}}}) importlib.reload(module)