← Back to team overview

sikuli-driver team mailing list archive

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

 

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

    Status: Open => Needs information

RaiMan requested for more information:
When I do this simple scenario on Mac or Win7

import unittest

class MyTests(unittest.TestCase):

 def setUp(self):
   print "setup"

 def tearDown(self):
   print "teardown"

 def test1(self):
   print "test"
#   assert (False)
   assert (True)

suite = unittest.TestLoader().loadTestsFromTestCase(MyTests)
unittest.TextTestRunner().run(suite)
print "testing is over"


------------- I get the following output:

--- in case assert(True)
setup
test
teardown
.
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK
testing is over


--- in case assert(False)
setup
test
teardown

F
======================================================================
FAIL: test1 (__main__.MyTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rhocke/testtest.sikuli/testtest.py", line 13, in test1
    assert (False)
AssertionError

----------------------------------------------------------------------
Ran 1 test in 0.020s

FAILED (failures=1)
testing is over

So in both cases unittest does what it should (setUp, perform all def's
contained in the TestCase that start with test..., tearDown). And then
it runs any script statements that come after the test run.

So what is your problem/question?

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