Ticket #6143: test-simple-refactor.diff
File test-simple-refactor.diff, 1.8 KB (added by , 17 years ago) |
---|
-
python/django/test/simple.py
35 35 mod[0].close() 36 36 raise 37 37 return test_module 38 38 39 def build_doctest_suite(module): 40 return doctest.DocTestSuite(module, 41 checker=doctestOutputChecker, 42 runner=DocTestRunner) 43 39 44 def build_suite(app_module): 40 45 "Create a complete Django test suite for the provided application module" 41 46 suite = unittest.TestSuite() … … 47 52 else: 48 53 suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(app_module)) 49 54 try: 50 suite.addTest(doctest.DocTestSuite(app_module, 51 checker=doctestOutputChecker, 52 runner=DocTestRunner)) 55 suite.addTest(build_doctest_suite(app_module)) 53 56 except ValueError: 54 57 # No doc tests in models.py 55 58 pass … … 64 67 suite.addTest(test_module.suite()) 65 68 else: 66 69 suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_module)) 67 try: 68 suite.addTest(doctest.DocTestSuite(test_module, 69 checker=doctestOutputChecker, 70 runner=DocTestRunner)) 70 try: 71 suite.addTest(build_doctest_suite(test_module)) 71 72 except ValueError: 72 73 # No doc tests in tests.py 73 74 pass … … 146 147 teardown_test_environment() 147 148 148 149 return len(result.failures) + len(result.errors) 149 150 No newline at end of file 150