← Back to team overview

sikuli-driver team mailing list archive

[Question #152117]: unittest execution hanging when the image is not found

 

New question #152117 on Sikuli:
https://answers.launchpad.net/sikuli/+question/152117

I'm launching a simple Python unittest in commandline.
The test contains an assert which is failing (this is what I want just to see the behavior when the test fails).

When the asertion fails, the execution of the test just hangs and never ends...


I launch the test with the following command :
java -jar sikuli-script.jar TESTS\testCalculatrice.sikuli


and here is the script :


import sys
import unittest
setAutoWaitTimeout(5000)

class MyTests(unittest.TestCase):

  def setUp(self):
    openApp("C:/WINDOWS/system32/calc.exe")
    wait(5)

  def tearDown(self):
    closeApp("Calculatrice")

  def test_addition(self):
    click("2.png")
    click("plus.png")
    click("2.png")
    click("equal.png")
    assert (exists("image_which_does_not_exist.png"))
 
suite = unittest.TestLoader().loadTestsFromTestCase(MyTests)
unittest.TextTestRunner(verbosity=2).run(suite)


The test works just fine when the assert is ok, but it is blocked when the assert fails... And the console is showing no error. The last line in the console is the las CLICK instruction.

Am'I missing something, is there something to do to let the execution continue after the failed assertion ?
Any help is appreciated.

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