← 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:
@ Jose

When using the unittest framework, it does not make sense, to catch the
assert exceptions, because they are used by the framework, to create the
final report.

what you can do, is the following:

now:

assert exists(some-image)

modified:

if not exists(some-image):
    # make your log message
    assert False
else:
    assert True

This means in general, you have to check the assert condition your self
and then use assert False/True according to the result. So before
issuing the assert False, you can write your log message.

Another possibility is to modify the HTMLTestRunner.py in the TestResult
class in the method addFailure(), which is called, when a test fails
(this is the place, where you could e.g. make a screenshot of the
failure situation). Come back if you want this solution.

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