MCPcopy Create free account
hub / github.com/modelscope/FunASR / gather_test_cases

Function gather_test_cases

tests/run_test.py:15–34  ·  view source on GitHub ↗
(test_dir, pattern, list_tests)

Source from the content-addressed store, hash-verified

13
14
15def gather_test_cases(test_dir, pattern, list_tests):
16 case_list = []
17 for dirpath, dirnames, filenames in os.walk(test_dir):
18 for file in filenames:
19 if fnmatch(file, pattern):
20 case_list.append(file)
21
22 test_suite = unittest.TestSuite()
23
24 for case in case_list:
25 test_case = unittest.defaultTestLoader.discover(start_dir=test_dir, pattern=case)
26 test_suite.addTest(test_case)
27 if hasattr(test_case, "__iter__"):
28 for subcase in test_case:
29 if list_tests:
30 print(subcase)
31 else:
32 if list_tests:
33 print(test_case)
34 return test_suite
35
36
37def main(args):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…