def test_implicit_component_lookup(): class ITarget(Interface): pass reg = Registry() reg.register(ITarget, (), 'test component') implicit.initialize(reg) assert ITarget.component() == 'test component'
def test_implicit_component_lookup(): @generic def func(): pass reg = Registry() reg.register(func, (), 'test component') implicit.initialize(reg) assert func.component() == 'test component'
def test_implicit_component_lookup(): @dispatch() def func(): pass def foo(): pass reg = Registry() reg.register_dispatch(func) reg.register_function(func, foo) implicit.initialize(reg.lookup()) assert func.component() is foo
def setup_function(f): implicit.initialize(Registry().lookup())
def setup_function(f): implicit.initialize(Registry())