Commits

anatoly techtonik committed 9ebf894

best practices: make test suite use new unittest.main() runner

Comments (0)

Files changed (1)

____.switch_httpservers_tests_to_unittest.patch

+# HG changeset patch
+# Parent 805d5d3fd8e7f205c966d148e8e7c0ea8787e935
+# User anatoly techtonik <techtonik@gmail.com>
+switch http servers testcases to use new unittest.main()
+instead of old test_support.run_unittest()
+
+diff -r 805d5d3fd8e7 Lib/test/test_SimpleHTTPServer.py
+--- a/Lib/test/test_SimpleHTTPServer.py	Sat Jul 03 11:40:13 2010 +0300
++++ b/Lib/test/test_SimpleHTTPServer.py	Thu Jul 15 20:48:37 2010 +0300
+@@ -5,7 +5,6 @@
+ 
+ import os, unittest
+ from SimpleHTTPServer import SimpleHTTPRequestHandler
+-from test import test_support
+ 
+ 
+ class SocketlessRequestHandler (SimpleHTTPRequestHandler):
+@@ -35,7 +34,7 @@
+ 
+ 
+ def test_main():
+-    test_support.run_unittest(SimpleHTTPRequestHandlerTestCase)
++    unittest.main()
+ 
+ if __name__ == "__main__":
+     test_main()
+diff -r 805d5d3fd8e7 Lib/test/test_httpservers.py
+--- a/Lib/test/test_httpservers.py	Sat Jul 03 11:40:13 2010 +0300
++++ b/Lib/test/test_httpservers.py	Thu Jul 15 20:48:37 2010 +0300
+@@ -402,10 +402,7 @@
+ def test_main(verbose=None):
+     try:
+         cwd = os.getcwd()
+-        test_support.run_unittest(BaseHTTPServerTestCase,
+-                                SimpleHTTPServerTestCase,
+-                                CGIHTTPServerTestCase
+-                                )
++        unittest.main()
+     finally:
+         os.chdir(cwd)
+