Belle II Software development
test_collector.py
1
8
9import basf2
10from zmq_daq import test_support
11from unittest import main
12
13
14class CollectorTestCase(test_support.BaseCollectorTestCase):
15 """Test case"""
16
17 final_collector = False
18
19
20class FinalCollectorTestCase(test_support.BaseCollectorTestCase):
21 """Test case"""
22
23 final_collector = True
24
25
26if __name__ == '__main__':
27
28 number_of_failures = 0
29
30 for i in range(test_support.ZMQ_TEST_FOR_LOOPS):
31 try:
32 main(exit=False)
33 except AssertionError:
34 number_of_failures += 1
35
36
37 message = f'Number of failed for loops: {number_of_failures}/{test_support.ZMQ_TEST_FOR_LOOPS}'
38 if number_of_failures <= test_support.ZMQ_TEST_MAX_FAILURES:
39 basf2.B2INFO(message)
40 else:
41 basf2.B2FATAL(message)
Definition: main.py:1