File: all_tests.py

package info (click to toggle)
cmor 3.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 16,960 kB
  • sloc: ansic: 28,094; f90: 13,872; python: 12,423; sh: 3,738; makefile: 111
file content (16 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import glob
import os
import unittest


def create_test_suite():
    test_file_strings = glob.glob('Test/test_python_CMIP6_CV*.py')
#    test_file_strings = glob.glob('Test/test_python_CMIP6_CV*further*.py')
    test_file_strings.extend(['Test/test_python_has_cur_dataset_attribute.py',
                              'Test/test_python_has_variable_attribute.py'])
    module_strings = [os.path.splitext(test_file_string)[0].replace('/', '.')
                      for test_file_string in test_file_strings]
    suites = [unittest.defaultTestLoader.loadTestsFromName(module_string)
              for module_string in module_strings]
    test_suite = unittest.TestSuite(suites)
    return test_suite