[Python-checkins] r76086 - python/trunk/Lib/test/test_wsgiref.py

antoine.pitrou python-checkins at python.org
Tue Nov 3 17:41:20 CET 2009


Author: antoine.pitrou
Date: Tue Nov 3 17:41:20 2009
New Revision: 76086
Log:
Try to make test_wsgiref less fragile against environment changes by other tests
Modified:
 python/trunk/Lib/test/test_wsgiref.py
Modified: python/trunk/Lib/test/test_wsgiref.py
==============================================================================
--- python/trunk/Lib/test/test_wsgiref.py	(original)
+++ python/trunk/Lib/test/test_wsgiref.py	Tue Nov 3 17:41:20 2009
@@ -9,7 +9,9 @@
 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 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__(


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /