test/python/tests/__init__.py
Go to the documentation of this file.
1 from os.path import dirname, basename, isfile
2 import glob
3 import unittest
4 # automatically import all files in this module
5 modules = glob.glob(dirname(__file__)+"/*.py")
6 __all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
7 
8 class RosparamTestSuite(unittest.TestSuite):
9 
10  def __init__(self):
11  super(RosparamTestSuite, self).__init__()
12 
13  # Collect test cases
14  testcases = {}
15  for test_module in __all__:
16  module = __import__("tests."+test_module, fromlist=['*'])
17  for name in dir(module):
18  obj = getattr(module, name)
19  if isinstance(obj, type) and issubclass(obj, unittest.TestCase):
20  testcases[name] = unittest.TestLoader().loadTestsFromTestCase(obj)
21 
22  # Add testcases
23  for test_name, test in testcases.items():
24  self.addTest(test)


rosparam_handler
Author(s): Claudio Bandera
autogenerated on Wed Jun 5 2019 19:50:35