← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #176005]: [HowTo] Nice unit test runner with html output

 

Question #176005 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/176005

RaiMan posted a new comment:
@ RiSol
no, currently not.

But it is easy to add:
in HTMLTestRunner.py thes are the 2 methods:


    def addError(self, test, err):
        self.error_count += 1
        TestResult.addError(self, test, err)
        _, _exc_str = self.errors[-1]
        output = self.complete_output()
        self.result.append((2, test, output, _exc_str, ''))
        if self.verbosity > 1:
            sys.stderr.write('E  ')
            sys.stderr.write(str(test))
            sys.stderr.write('\n')
        else:
            sys.stderr.write('E')

    def addFailure(self, test, err):
        self.failure_count += 1
        TestResult.addFailure(self, test, err)
        _, _exc_str = self.failures[-1]
        output = self.complete_output()
        self.result.append((1, test, output, _exc_str, self.generateTestScreenshot(test))) # modified by RaiMan
        if self.verbosity > 1:
            sys.stderr.write('F  ')
            sys.stderr.write(str(test))
            sys.stderr.write('\n')
        else:
            sys.stderr.write('F')

just replace the line self.result.append.... in addError with the line
... # modified by RaiMan from addFailure

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.