def install_result():
    import nose.result

    class MyTextTestResult(nose.result.TextTestResult):
        def addExpectedFailure(self, test, err):
            # 2.7 expected failure compat
            if ExpectedFailure in self.errorClasses:
                storage, label, isfail = self.errorClasses[ExpectedFailure]
                storage.append((test, self._exc_info_to_string(err, test)))
                self.printLabel(label, (ExpectedFailure, '', None))

        def addUnexpectedSuccess(self, test):
            # 2.7 unexpected success compat
            if UnexpectedSuccess in self.errorClasses:
                storage, label, isfail = self.errorClasses[UnexpectedSuccess]
                storage.append((test, 'This test was marked as an expected '
                    'failure, but it succeeded.'))
                self.printLabel(label, (UnexpectedSuccess, '', None))
    nose.result.TextTestResult = MyTextTestResult
dataset/ETHPy150Open cournape/Bento/bento/core/_nose_compat.py/install_result/original