Sikuli test succeeding even though it should fail

Asked by Zoran Lisovac

Hi,

I've set up a few tests. However, I intentionally set up one test to fail. When I run all those test an xml report gets created. What is funny, all 6 tests pass, despite the 6th one should fail, since it's asserting for a non existent image.

class TestRiggedToFail(unittest.TestCase):
    def testFail(self):
            wait(2)
            assert exists("1437632092515.png")

1437632092515.png won't be seen on the screen, as it is a photo from the internet.

How and why does this assert pass, and in my report all tests are successful?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

--- How and why does this assert pass?
... because Sikuli finds something on the screen, that matches 1437632092515.png with a score of >0.7 within 3 seconds after the testcase starts.

Can you help with this problem?

Provide an answer of your own, or ask Zoran Lisovac for more information if necessary.

To post a message you must log in.