← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #192876]: How to get unittest2 in Sikuli X-1.0rc3

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
The steps to get unittest2 available with Sikuli's built-in Jython:

--1: folder Lib
in the Sikuli X program folder make a new folder "Lib". This is already in Sikuli's sys.path, so we can use it, to store modules to import in Sikuli scripts, without the need to touch sys.path

-- 2: download unittest2
from http://pypi.python.org/pypi/unittest2#downloads
download the zip version and unzip somewhere. do not install/setup - only unzip !!!!
It contains a folder "unittest2".
copy this folder to the above Sikuli X/Lib folder.

-- 3: restart Sikuli IDE
use
import unittest2

to get it activated in your script.

In the docs of unittest2, remarks regarding Python language level 2.5
apply to Sikuli's Jython.

--- You seam to have posted a question in the Jython boards too: 
http://python.6.n6.nabble.com/Unittest2-td4675675.html
If you want to use unittest2 with a standalone Jython, the Jython folder site-packages (already in sys.path) in the lib folder is the best target for the unittest2 module folder (same actions as for Sikuli).

--- Generally be prepared, to get odd behavior in some special areas (might not happen though ;-).
I know, that another guy got it working together with the HTMLTestRunner.

--- If you do not want to deal with the step --2.:
http://dl.dropbox.com/u/42895525/unittest2.zip
contains the zipped version of the unittest2 module folder without the surrounding Python install stuff.
So you might download and unzip this directly into the Sikuli X/Lib folder.

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