tearDown not called when calling exit() in a unit test
Hi,
I have a .sikuli unit test that looks like this:
def setUp(self):
print "Setting up..."
#some set-up code goes here
def tearDown(self):
print "Tearing Down..."
#some code for tearing down goes here
def testSomething(
if not exists(
print "Verification failed for SomeImage"
exit(1)
The issue with the code above is that the tearDown method is not executed when the verification fails and the "exit(1)" line is hit. If I comment-out the "exit(1)" line than the tearDown method is called as expected.
Any hints about why tearDown is not called are highly appreciated :-)
I trued executing the test through both the Unit Test view in Sikuli IDE and through command-line with the same result.
The version I'm using is Sikuli X-1.0rc3 (r905)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: