def failed(self, msg=constants.NO_MESSAGE):
        """Call this and return if the execute() failed.

        Call this if your test logic determines a failure. Only call this if
        your test implementation in the execute is positively sure that it
        does not meet the criteria. Other kinds of errors should return
        `incomplete()`.

        In the execute method, the pattern is: `return self.failed('message')`.
        """
        if self.OPTIONS.bugid:
            self._report.diagnostic(
                            "This failure was expected. see bug: %s." % (self.OPTIONS.bugid,), 2)
            self._report.expectedfail(msg, 2)
            return TestResult(constants.EXPECTED_FAIL)
        else:
            self._report.failed(msg, 2)
            return TestResult(constants.FAILED)
dataset/ETHPy150Open kdart/pycopia/QA/pycopia/QA/core.py/Test.failed/original