]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 76086 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 3 Nov 2009 16:43:03 +0000 (16:43 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 3 Nov 2009 16:43:03 +0000 (16:43 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76086 | antoine.pitrou | 2009-11-03 17:41:20 +0100 (mar., 03 nov. 2009) | 3 lines

  Try to make test_wsgiref less fragile against environment changes by other tests
........

Lib/test/test_wsgiref.py

index b6d994b03d413f2debbc9137ea7d6c177f94bfab..06591ad4361695c9d720d27f9a874c1543d7173a 100755 (executable)
@@ -9,7 +9,9 @@ from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, demo_app
 from wsgiref.simple_server import make_server
 from StringIO import StringIO
 from SocketServer import BaseServer
-import re, sys
+import os
+import re
+import sys
 
 from test import test_support
 
@@ -386,6 +388,11 @@ class HeaderTests(TestCase):
 class ErrorHandler(BaseCGIHandler):
     """Simple handler subclass for testing BaseHandler"""
 
+    # BaseHandler records the OS environment at import time, but envvars
+    # might have been changed later by other tests, which trips up
+    # HandlerTests.testEnviron().
+    os_environ = dict(os.environ.items())
+
     def __init__(self,**kw):
         setup_testing_defaults(kw)
         BaseCGIHandler.__init__(