[1.0] unittest2/HTMLTestRunner ... as Sikuli package content or extension

Asked by RayanRoger

Hi all,

I'm experiencing some problems when using current Sikuli's Jython unittets module.
In the current version (I guess unittest 1.63) some of most useful unittest features are not (yet) available.
For example I'd like to skip some Sikuli testcases by using an instruction like : @unittest.skipIf(a_conditon) just before the TestCase() method.

I'm still trying to look for a workaround for that.
Ideally I'd like to use some script options passed by the Sikuli commandline to the Jython's sys.argv.
For example : Sikuli-IDE.bat -r mainTestClass.sikuli --args --suite suite1 --testcase test1,test2,test5
In the mainTestClass.sikuli I'll parse sys.argv and so I'll run only testsuite1.sikuli and only testcases test1() , test2() and test3() among all testcases defined in that testsuite.sikuli class.

Any idea about when Sikuli will integrate a new unittest version ?
Or, any idea about how to skip a testcase defined in a testsuite class with the current unittest version ?

Thanks a lot,
Rayan

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
RaiMan Edit question
Solved by:
RayanRoger
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

The language level of the current Jython (latest 2.5.3) is still Python 2.5 and the same goes for the implemented standard modules like unittest (which has no skip() in 2.5 nor annotations like you mentioned).

Your Sikuli uses Jython 2.5.2 if it is the latest version.

There is a Python module unittest2 that backports some 2.7 features to 2.5 and can be used in Jython since it is plain Python.
https://answers.launchpad.net/sikuli/+question/192876

Revision history for this message
RayanRoger (rayanroger2) said :
#2

Thanks a lot RaiMan

I could install unittest2 (that contains a lot of advanced unittest features) without any issue.
I suggest this unittest2 module to all people want to use Python's unittest directly in Sikuli.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Ok. Thanks.
I will add it to the bundle in the new version, so it is available out of the box.

I think, the same I will do with the modified HTMLTestrunner.

Revision history for this message
TestMechanic (ndinev) said :
#4

Hi,

Just wondering if this is available in version 1.0?

Revision history for this message
RaiMan (raimund-hocke) said :
#5

@ dinev: thanks for reminding me ;-)
made it a request bug