comparison Lib/test/test_httpservers.py @ 57084:3201fab35220 2.6

Try to fix test_wsgiref failures due to test_httpservers modifying the environment
author Antoine Pitrou <solipsis@pitrou.net>
date Mon, 02 Nov 2009 22:04:54 +0000
parents 77557216ba32
children f84f83963a78
comparison
equal deleted inserted replaced
57083:6c13bf35d166 57084:3201fab35220
339 self.assertEquals(('Hello World\n', 'text/html', 200), \ 339 self.assertEquals(('Hello World\n', 'text/html', 200), \
340 (res.read(), res.getheader('Content-type'), res.status)) 340 (res.read(), res.getheader('Content-type'), res.status))
341 341
342 342
343 def test_main(verbose=None): 343 def test_main(verbose=None):
344 cwd = os.getcwd()
345 env = os.environ.copy()
344 try: 346 try:
345 cwd = os.getcwd()
346 test_support.run_unittest(BaseHTTPServerTestCase, 347 test_support.run_unittest(BaseHTTPServerTestCase,
347 SimpleHTTPServerTestCase, 348 SimpleHTTPServerTestCase,
348 CGIHTTPServerTestCase 349 CGIHTTPServerTestCase
349 ) 350 )
350 finally: 351 finally:
352 test_support.reap_children()
353 os.environ.clear()
354 os.environ.update(env)
351 os.chdir(cwd) 355 os.chdir(cwd)
352 356
353 if __name__ == '__main__': 357 if __name__ == '__main__':
354 test_main() 358 test_main()