summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-11-03 16:41:20 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-11-03 16:41:20 (GMT)
commitb3c169b08f6bb56edc2a14ecfd2b6d36c1fec13f (patch)
tree070c39b8270208e1bfb0308ca6c11e58089a6ffd
parent5b54432b1d735b1d6e539e399fa21b6eae889dc4 (diff)
downloadcpython-b3c169b08f6bb56edc2a14ecfd2b6d36c1fec13f.zip
cpython-b3c169b08f6bb56edc2a14ecfd2b6d36c1fec13f.tar.gz
cpython-b3c169b08f6bb56edc2a14ecfd2b6d36c1fec13f.tar.bz2
Try to make test_wsgiref less fragile against environment changes by other tests
-rwxr-xr-xLib/test/test_wsgiref.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index db82139..b638391 100755
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -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__(