Order of functions called in Sikuli

Asked by Sreelekshmi on 2019-01-03

class Test_a(unittest.TestCase):
       def test_A(self):
           print("abc")
            .......
             ..........

         def test_Z(self):
            ..............
suite = unittest.TestLoader().loadTestsFromTestCase(Test_a)
outfile = open("C:\Tools\sree.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Test Report', description='This is demo' )
runner.run(suite)
outfile.close()

q1. How to ensure my functions are executed in the order from A TO Z.
q2. whats the error .EEE...E.E
Time Elapsed: 0:01:03.349000

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Sreelekshmi
Solved:
2019-01-03
Last query:
2019-01-03
Last reply:
2019-01-03
RaiMan (raimund-hocke) said : #1

Sorry, not a question about SikuliX.

It is about Python/Jython unittest.
The chance to get help and find solutions might be better outside this forum.

Sreelekshmi (sree2604) said : #2

Agree its not related to sikulix.
But want to share what I found.

in this case the functions are run in the order of function names.

so name your functions accordingly

def_test_a_name
def_test_b_name
def_test_c_name

TestMechanic (ndinev) said : #3

A1: I am using names like test_0010_CreateProject. In this way I can sort my test in the desired way.

A2: In the console you are seeing 1 letter indication about status of each case
. = pass
E = exception
F = failure

In the html report you can see details about exception or the failure