]> granicus.if.org Git - python/commitdiff
Try to fix test_wsgiref failures due to test_httpservers modifying the environment
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 2 Nov 2009 22:04:54 +0000 (22:04 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 2 Nov 2009 22:04:54 +0000 (22:04 +0000)
Lib/test/test_httpservers.py

index 31321c3fa6a32825ec198ab8330c76494fa13bb1..49474f6351ca49a1cf6b35050fd15cc1cc038f83 100644 (file)
@@ -341,13 +341,17 @@ class CGIHTTPServerTestCase(BaseTestCase):
 
 
 def test_main(verbose=None):
+    cwd = os.getcwd()
+    env = os.environ.copy()
     try:
-        cwd = os.getcwd()
         test_support.run_unittest(BaseHTTPServerTestCase,
                                   SimpleHTTPServerTestCase,
                                   CGIHTTPServerTestCase
                                   )
     finally:
+        test_support.reap_children()
+        os.environ.clear()
+        os.environ.update(env)
         os.chdir(cwd)
 
 if __name__ == '__main__':