← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #188751]: Sikuli Test hanging when running unit test - fine when through IDE

 

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

RaiMan posted a new comment:
IDE normal run: 
black or yellow triangle button in top bar of IDE window (or the respective entries in the run menu)
scripts prepared for the view unit test only consist of def()'s, that do nothing but getting basically syntax checked.

To run the def's you have to manually add a "runner", that calls these def.'s.
This is easily possible like with the if False: block above, as long, as a reference to self is not needed in the def()'s (which is the case in my last example).

A more general runner would be:

if False: # set it to True when running normally
    class MyRunner():
        pass
    runner = MyRunner()
    setUp(runner)
    testA(runner)
    tearDown(runner)
    setUp(runner)
    testB(runner)
    tearDown(runner)

Now runner is a real object, that can be referenced and used as self. inside the test functions.
This would work with my last example.

When changing False to True, your def's will be run the same way as in
the view unittest, but without the documentation.

So if you do not plan to use it for cases, where it might be hard to
find bugs in the unit test view, just forget it and delete it from the
script.

conclusion: run scripts prepared for the IDE unit test (again: forget it
and use unittest directly) as long as you like ;-)

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