Re: [Sikuli-driver] [Question #664253]: Import pytest library into the sikuli script

2018-02-12 Thread sam
Question #664253 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664253

Status: Answered => Solved

sam  confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #664253]: Import pytest library into the sikuli script

2018-02-11 Thread RaiMan
Question #664253 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664253

RaiMan proposed the following answer:
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.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #664253]: Import pytest library into the sikuli script

2018-02-09 Thread sam
Question #664253 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664253

sam  posted a new comment:
RaiMan,

Thank you very much. I took a look around to see if pytest is compatible
with Jython. It seems Pytest does not support Jython 2.5.3 and 2.7.  I
put some links below:

https://stackoverflow.com/questions/13250258/using-pytest-with-jython

https://github.com/pytest-dev/pytest/issues/3111

Therefore, I tried to import unittest and XMLTestrunner instead of
pytest. Some part of the code is shown below:

import unittest
from XMLTestRunner1 import *

suite = unittest.TestLoader().loadTestsFromTestCase(FlowCode_test)

result = XMLTestRunner(file("unittest.xml", "w")).run(suite)
print(result)

However, I got this error message when I run the GUI:

Error caused by: Traceback (most recent call last): 
result = XMLTestRunner(file("unittest.xml", "w")).run(suite) File 
"C:\sikulix\sikulixapi.jar\Lib\XMLTestRunner1.py", line 191, in run File 
"C:\sikulix\sikulix.jar\Lib\unittest\suite.py", line 70, in __call__ File 
"C:\sikulix\sikulix.jar\Lib\unittest\suite.py", line 99, in run File 
"C:\sikulix\sikulix.jar\Lib\unittest\suite.py", line 178, in 
_handleModuleFixture TypeError: coercing to Unicode: need string, NoneType type 
found

Interestingly, whenever I run the script on the command line using "java
-cp %JYTHON_HOME%jython.jar;%CLASSPATH% org.python.util.jython" command
everything looks fine and Sikuli runs.

Is there something that I am doing wrong?

Thank you

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #664253]: Import pytest library into the sikuli script

2018-02-09 Thread RaiMan
Question #664253 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664253

Status: Open => Answered

RaiMan proposed the following answer:
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.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp