From: Serhiy Storchaka Date: Mon, 11 Sep 2023 11:05:30 +0000 (+0300) Subject: Better integration of doctest and unittest in test_ctypes.test_objects (GH-108922) X-Git-Tag: v3.13.0a1~495 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60b8341d07649194aa73108369a1e04ed1848794;p=thirdparty%2FPython%2Fcpython.git Better integration of doctest and unittest in test_ctypes.test_objects (GH-108922) Better integration of docrtest and unittest in test_ctypes.test_objects --- diff --git a/Lib/test/test_ctypes/test_objects.py b/Lib/test/test_ctypes/test_objects.py index 23c92b01a111..fb01421b9559 100644 --- a/Lib/test/test_ctypes/test_objects.py +++ b/Lib/test/test_ctypes/test_objects.py @@ -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()