← Back to team overview

sikuli-driver team mailing list archive

[Question #268468]: Can we have multiple assertions in a single module

 

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

Hello,

We are creating a test suite and adding multiple test list to it. Each test list has multiple test. One of the functions has multiple asserts.

Is it possible to have multiple assert statements in a functions .The Report that gets generates we see that the first assertion failure that it encounters it stops execution of the script. We could like the script to continue to test the further assertions.

Code :-

import unittest

class MyTest4(unittest.TestCase):
    def testPassFailFail(self):
        x=5
        assert x >3
        y=3
        assert y >5
        z=4
        assert z==3


Report has the following details against this test."testPassFailFai"

fail
[x]
        
ft3.3: Traceback (most recent call last):
  File "C:\SikuliX\Test4.sikuli\Test4.py", line 8, in testPassFailFail
    assert y >5
AssertionError

We could want it continue with script execution and shows the details for the failure in the case where z is not equal to 3 aswell.

Let us know if we could upload our code in any particular location that could help in explaining our issue.
        
      


      

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