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)
| 411 | |
| 412 | |
| 413 | def 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 | |
| 439 | def usage(): |