32 | | suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_module)) |
33 | | try: |
34 | | suite.addTest(doctest.DocTestSuite(test_module, |
35 | | checker=doctestOutputChecker, |
36 | | runner=DocTestRunner)) |
37 | | except ValueError: |
38 | | # No doc tests in tests.py |
39 | | pass |
| 32 | # If the module has a 'suite' attribute, we assume this is a function |
| 33 | # that returns a complete suite for this module, otherwise we build |
| 34 | # a test suite ourselves. |
| 35 | if hasattr(test_module, 'suite'): |
| 36 | suite.addTest(test_module.suite()) |
| 37 | else: |
| 38 | suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_module)) |
| 39 | try: |
| 40 | suite.addTest(doctest.DocTestSuite(test_module, |
| 41 | checker=doctestOutputChecker, |
| 42 | runner=DocTestRunner)) |
| 43 | except ValueError: |
| 44 | # No doc tests in tests.py |
| 45 | pass |