Better integration of docrtest and unittest in test_ctypes.test_objects
import doctest
import unittest
-import test.test_ctypes.test_objects
-class TestCase(unittest.TestCase):
- def test(self):
- failures, tests = doctest.testmod(test.test_ctypes.test_objects)
- self.assertFalse(failures, 'doctests failed, see output above')
+def load_tests(loader, tests, pattern):
+ tests.addTest(doctest.DocTestSuite())
+ return tests
if __name__ == '__main__':
- doctest.testmod(test.test_ctypes.test_objects)
+ unittest.main()