Import pytest library into the sikuli script

Asked by sam on 2018-02-09

Hello,

I am trying to run a simple Sikuli script that open an App and then using pytest library to check if the app is open or not. However, Sikuli gives me this error:"No module named pytest". Basically, it can't import pytest library using "import pytest".

I am using Sikuli 1.1.1 on Windows 10 (Jython 2.7). I was wondering if there is a way to test the code using pytest library.

Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-02-12
Last query:
2018-02-12
Last reply:
2018-02-11
RaiMan (raimund-hocke) said : #1

check wether pytest is Jython compatible (Python language only, no C-based library stuff)

and read:
http://sikulix-2014.readthedocs.io/en/latest/scenarios.html#access-python-packages-from-sikulix-scripts-run-by-sikulix-gui-or-commandline

about where to put the module in case it is useable.

Best RaiMan (raimund-hocke) said : #3

Apparently, the Jython setup in case IDE (everything bundled) XMLTestRunner does not accept a file object as 1st parameter, but expects a string. so try with the filename as string only.

sam (sy1365) said : #4

Thanks RaiMan, that solved my question.