def handle_named_example_resource(context, resource_type, name, **kwargs): resource_factory = factory_for(resource_type) example = Example(resource_type, resource_factory(**kwargs)) setattr(context, name, example)
def handle_example_resource(context, resource_type): resource_factory = factory_for(resource_type) context.example_resource = resource_factory()