def pytest_runtest_logreport(self, report):
        try:
            scenario = report.scenario
        except __HOLE__:
            # skip reporting for non-bdd tests
            return

        if not scenario["steps"] or report.when != "call":
            # skip if there isn't a result or scenario has no steps
            return

        def stepmap(step):
            error_message = False
            if step['failed'] and not scenario.setdefault('failed', False):
                scenario['failed'] = True
                error_message = True

            return {
                "keyword": step['keyword'],
                "name": step['name'],
                "line": step['line_number'],
                "match": {
                    "location": "",
                },
                "result": self._get_result(step, report, error_message),
            }

        if scenario["feature"]["filename"] not in self.features:
            self.features[scenario["feature"]["filename"]] = {
                "keyword": "Feature",
                "uri": scenario["feature"]["rel_filename"],
                "name": scenario["feature"]["name"] or scenario["feature"]["rel_filename"],
                "id": scenario["feature"]["rel_filename"].lower().replace(" ", "-"),
                "line": scenario['feature']["line_number"],
                "description": scenario["feature"]["description"],
                "tags": self._serialize_tags(scenario["feature"]),
                "elements": [],
            }

        self.features[scenario["feature"]["filename"]]["elements"].append({
            "keyword": "Scenario",
            "id": report.item["name"],
            "name": scenario["name"],
            "line": scenario["line_number"],
            "description": "",
            "tags": self._serialize_tags(scenario),
            "type": "scenario",
            "steps": [stepmap(step) for step in scenario["steps"]],
        })
dataset/ETHPy150Open pytest-dev/pytest-bdd/pytest_bdd/cucumber_json.py/LogBDDCucumberJSON.pytest_runtest_logreport