def test_register_with_instance(): instance = object() with pytest.raises(ValueError) as exception: Component.register(instance) assert str(exception.value) == f'Need class. Got: {instance}' assert exception.value.args == (f'Need class. Got: {instance}', )
def controller(controller_class: Type) -> Type: Component.register(controller_class) return controller_class