

@staticmethod
def select_step_with_status(status, steps):
    '\n        Helper function to find the first step that has the given step.status.\n\n        EXAMPLE: Search for a failing step in a scenario (all steps).\n            >>> scenario = ...\n            >>> failed_step = select_step_with_status("failed", scenario)\n            >>> failed_step = select_step_with_status("failed", scenario.all_steps)\n            >>> assert failed_step.status == "failed"\n\n        EXAMPLE: Search only scenario steps, skip background steps.\n            >>> failed_step = select_step_with_status("failed", scenario.steps)\n\n        :param status:  Step status to search for (as string).\n        :param steps:   List of steps to search in (or scenario).\n        :returns: Step object, if found.\n        :returns: None, otherwise.\n        '
    for step in steps:
        assert isinstance(step, Step), ('TYPE-MISMATCH: step.class=%s' % step.__class__.__name__)
        if (step.status == status):
            return step
    return None

dataset/ETHPy150Open behave/behave/behave/reporter/junit.py JUnitReporter.select_step_with_status/original