def result()

in teamcity/jb_behave_formatter.py [0:0]


    def result(self, step):
        assert isinstance(step, Step)
        step_name = _step_name(step)
        fail_statuses = [Status.failed]
        if hasattr(Status, "error"):
            fail_statuses.append(Status.error)
        if step.status in fail_statuses:
            try:
                error = "".join(traceback.format_exception(step.exception))
                if error != step.error_message:
                    self._messages.testStdErr(step_name, error)
            except Exception:
                pass  # exception shall not prevent error message
            self._messages.testFailed(step_name, message=step.error_message)

        if step.status == Status.undefined:
            self._messages.testFailed(step_name, message="Undefined")

        if step.status == Status.skipped:
            self._messages.testIgnored(step_name)

        self._messages.testFinished(step_name, testDuration=datetime.datetime.now() - self.__test_start_time)

        if not self.__steps:
            self.__close_scenario()
        elif step.status in [Status.failed, Status.undefined]:
            # Broken background/undefined step stops whole scenario

            reason = "Undefined step" if step.status == Status.undefined else "Prev. step failed"
            self.__skip_rest_of_scenario(reason)