]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Better integration of doctest and unittest in test_ctypes.test_objects (GH-108922)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 11 Sep 2023 11:05:30 +0000 (14:05 +0300)
committerGitHub <noreply@github.com>
Mon, 11 Sep 2023 11:05:30 +0000 (14:05 +0300)
Better integration of docrtest and unittest in test_ctypes.test_objects

Lib/test/test_ctypes/test_objects.py

index 23c92b01a11107c21ec99865a99eb9d0526dff48..fb01421b955951641c5f0dbbb1cf1186579fb993 100644 (file)
@@ -55,14 +55,12 @@ of 'x' ('_b_base_' is either None, or the root object owning the memory block):
 
 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()