]> granicus.if.org Git - python/commitdiff
#17079: test_ctypes now works with unittest test discovery. Patch by Zachary Ware.
authorEzio Melotti <ezio.melotti@gmail.com>
Fri, 1 Mar 2013 08:55:17 +0000 (10:55 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Fri, 1 Mar 2013 08:55:17 +0000 (10:55 +0200)
Lib/test/test_ctypes.py
Misc/NEWS

index 7d9abdcba7220a54ef0fcd0e815d8c786734e6de..496355e61d3435c4ff97e978646643ceab461252 100644 (file)
@@ -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()
index 043daee7e76bc656baf3de301d40e0649888500d..3149f90852244f297257d75f47f9240e888c40d6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -644,6 +644,9 @@ Tests
 
 - 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.