forked from PCMDI/cmor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests2.py
40 lines (37 loc) · 1.53 KB
/
run_tests2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
testmodules = [
"Test.test_python_CMIP6_CV_baddirectory",
"Test.test_python_CMIP6_CV_badgridgr",
"Test.test_python_CMIP6_CV_badgridlabel",
"Test.test_python_CMIP6_CV_badgridresolution",
"Test.test_python_CMIP6_CV_badinstitutionIDNotSet",
"Test.test_python_CMIP6_CV_badinstitutionID",
"Test.test_python_CMIP6_CV_badinstitution",
"Test.test_python_CMIP6_CV_badsourceid",
"Test.test_python_CMIP6_CV_badsource",
"Test.test_python_CMIP6_CV_badsourcetypeCHEMAER",
"Test.test_python_CMIP6_CV_badsourcetype",
"Test.test_python_CMIP6_CV_badsourcetypeRequired",
"Test.test_python_CMIP6_CV_badvariant",
"Test.test_python_CMIP6_CV_externalvariables",
"Test.test_python_CMIP6_CV_furtherinfourl",
"Test.test_python_CMIP6_CV_fxtable",
"Test.test_python_CMIP6_CV_HISTORY",
"Test.test_python_CMIP6_CV_longrealizationindex",
"Test.test_python_CMIP6_CV_nomipera",
"Test.test_python_CMIP6_CV_trackingNoprefix",
"Test.test_python_CMIP6_CV_trackingprefix",
"Test.test_python_has_cur_dataset_attribute",
"Test.test_python_has_variable_attribute.TestHasVariableAttribute"
]
import unittest
suite = unittest.TestSuite()
for t in testmodules:
try:
# If the module defines a suite() function, call it to get the suite.
mod = __import__(t, globals(), locals(), ['suite'])
suitefn = getattr(mod, 'suite')
suite.addTest(suitefn())
except (ImportError, AttributeError):
# else, just load all the test cases from the module.
suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t))
unittest.TextTestRunner(verbosity=2).run(suite)