From: Antoine Pitrou Date: Mon, 2 Nov 2009 22:04:54 +0000 (+0000) Subject: Try to fix test_wsgiref failures due to test_httpservers modifying the environment X-Git-Tag: v2.6.5rc1~387 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f4f8c3ff148e151e345253c8a607a1d5fe14d4d;p=thirdparty%2FPython%2Fcpython.git Try to fix test_wsgiref failures due to test_httpservers modifying the environment --- diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 31321c3fa6a3..49474f6351ca 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -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__':