Belle II Software  release-08-01-10
test_collector.py
1 
8 
9 import basf2
10 from zmq_daq import test_support
11 from unittest import main
12 
13 
14 class CollectorTestCase(test_support.BaseCollectorTestCase):
15  """Test case"""
16 
17  final_collector = False
18 
19 
20 class FinalCollectorTestCase(test_support.BaseCollectorTestCase):
21  """Test case"""
22 
23  final_collector = True
24 
25 
26 if __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