def register_steps_with(cls, step_registry): STEP_DEFINITIONS = [ ("step", "a step passes", cls.step_passes), ("step", "a step fails", cls.step_fails), ("step", "a step with text", cls.step_with_text), ("step", "a step with a table", cls.step_with_table), ] for keyword, string, func in STEP_DEFINITIONS: step_registry.add_step_definition(keyword, string, func)