summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-09-11 11:05:30 (GMT)
committerGitHub <noreply@github.com>2023-09-11 11:05:30 (GMT)
commit60b8341d07649194aa73108369a1e04ed1848794 (patch)
tree31baf5479e4001097bff00754bc7ec36cb3fef94
parent0abc935086931d4915ea3c45cffffecb31e7a45c (diff)
downloadcpython-60b8341d07649194aa73108369a1e04ed1848794.zip
cpython-60b8341d07649194aa73108369a1e04ed1848794.tar.gz
cpython-60b8341d07649194aa73108369a1e04ed1848794.tar.bz2
Better integration of doctest and unittest in test_ctypes.test_objects (GH-108922)
Better integration of docrtest and unittest in test_ctypes.test_objects
-rw-r--r--Lib/test/test_ctypes/test_objects.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_ctypes/test_objects.py b/Lib/test/test_ctypes/test_objects.py
index 23c92b0..fb01421 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()