[Python-checkins] cpython (3.3): #17079: test_ctypes now works with unittest test discovery. Patch by Zachary

ezio.melotti python-checkins at python.org
Fri Mar 1 09:56:54 CET 2013


http://hg.python.org/cpython/rev/42d4a29509c4
changeset:   82431:42d4a29509c4
branch:      3.3
parent:      82428:66d0f6ef2a7f
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Fri Mar 01 10:55:17 2013 +0200
summary:
  #17079: test_ctypes now works with unittest test discovery.  Patch by Zachary Ware.

files:
  Lib/test/test_ctypes.py |  8 ++++----
  Misc/NEWS               |  3 +++
  2 files changed, 7 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_ctypes.py b/Lib/test/test_ctypes.py
--- a/Lib/test/test_ctypes.py
+++ b/Lib/test/test_ctypes.py
@@ -1,16 +1,16 @@
 import unittest
 
-from test.support import run_unittest, import_module
+from test.support import import_module
 
 # Skip tests if _ctypes module was not built.
 import_module('_ctypes')
 
 import ctypes.test
 
-def test_main():
+def load_tests(*args):
     skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0)
     suites = [unittest.makeSuite(t) for t in testcases]
-    run_unittest(unittest.TestSuite(suites))
+    return unittest.TestSuite(suites)
 
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -644,6 +644,9 @@
 
 - Issue #15539: Added regression tests for Tools/scripts/pindent.py.
 
+- Issue #17079: test_ctypes now works with unittest test discovery.
+  Patch by Zachary Ware.
+
 - Issue #17304: test_hash now works with unittest test discovery.
   Patch by Zachary Ware.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list