← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #208458]: Unit test exception/script problems

 

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

Description changed to:
I'm trying to create unit tests; so far, i have been able to run the
Calculator example from http://stackoverflow.com/questions/2854141/help-
sikuli-unit-test-can-not-run .

Although the test itself is fine (it is executed and all), the result is
always a failure. I have tried with:

def test_calculator(self):
    assert True

and this does finish correectly, however, 
def test_calculator(self):
    assert False

gives me a failure, with the very helpful
"test_calculator(org.python.proxies.__main__$unittesttest|$5)" (my
sikuli project is called unittesttest)

Is there any way to see useful error messages?

        at
org.sikuli.ide.sikuli_test.UnitTestRunner$9.run(UnitTestRunner.java:409)

I have a much more elaborate unittest, but that does not run.

Any print message is not output to the console (even in the setUp
method).

The only messages I get, if I cancel the test:

Exception in thread "MainThread" SyntaxError: ("mismatched input 'test'
expecting COLON", ('', 6, 13, 'class Sikuli test
(junit.framework.TestCase):\n'))

Exception in thread "AWT-EventQueue-0" SyntaxError: ("mismatched input
'test' expecting COLON", ('', 6, 13, 'class Sikuli test
(junit.framework.TestCase):\n'))

-- The problem is in the filename of the project, it contained spaces

Furthermore, I noticed that it is possible to import modules from within
test_, setUp and tearDown methods. These are only available within these
methods, which is confusing.

Apart from that, importing a sikuli script creates invalid references,
as the imported module's  images cannot be found when the unit test is
run.

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