MCPcopy Create free account
hub / github.com/Kitware/VTK / test

Function test

Wrapping/Python/vtkmodules/test/Testing.py:413–436  ·  view source on GitHub ↗

Pass a list of tuples containing test classes and the functions used for testing. It returns a unittest._TextTestResult object. Example: test = test_suite([(vtkTestClass, 'test'), (vtkTestClass1, 'test')])

(cases)

Source from the content-addressed store, hash-verified

411
412
413def test(cases):
414 """ Pass a list of tuples containing test classes and the
415 functions used for testing.
416
417 It returns a unittest._TextTestResult object.
418
419 Example:
420
421 test = test_suite([(vtkTestClass, 'test'),
422 (vtkTestClass1, 'test')])
423 """
424 # Make the test suites from the arguments.
425 suites = []
426 loader = unittest.TestLoader()
427 # the "name" is ignored (it was always just 'test')
428 for test,name in cases:
429 suites.append(loader.loadTestsFromTestCase(test))
430 test_suite = unittest.TestSuite(suites)
431
432 # Now run the tests.
433 runner = unittest.TextTestRunner(verbosity=_VERBOSE)
434 result = runner.run(test_suite)
435
436 return result
437
438
439def usage():

Callers 1

mainFunction · 0.70

Calls 2

appendMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected