diff options
| author | Nick Coghlan <ncoghlan@gmail.com> | 2009-10-17 15:23:08 (GMT) | 
|---|---|---|
| committer | Nick Coghlan <ncoghlan@gmail.com> | 2009-10-17 15:23:08 (GMT) | 
| commit | 87c03b3108fd8108f7ab62fbcfd63aabf86c507b (patch) | |
| tree | ac5ff85ede6244d6830e44e740acc482d83f2dec /Lib/test/test_httpservers.py | |
| parent | 8c1ffeb614406ecaad651609f25f7bffee6237aa (diff) | |
| download | cpython-87c03b3108fd8108f7ab62fbcfd63aabf86c507b.zip cpython-87c03b3108fd8108f7ab62fbcfd63aabf86c507b.tar.gz cpython-87c03b3108fd8108f7ab62fbcfd63aabf86c507b.tar.bz2  | |
Revert changes made to environment in test_httpservers
Diffstat (limited to 'Lib/test/test_httpservers.py')
| -rw-r--r-- | Lib/test/test_httpservers.py | 9 | 
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 228d82b..73354e3 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -50,6 +50,7 @@ class TestServerThread(threading.Thread):  class BaseTestCase(unittest.TestCase):      def setUp(self): +        os.environ = test_support.EnvironmentVarGuard()          self.lock = threading.Lock()          self.thread = TestServerThread(self, self.request_handler)          self.thread.start() @@ -58,6 +59,8 @@ class BaseTestCase(unittest.TestCase):      def tearDown(self):          self.lock.release()          self.thread.stop() +        os.environ.__exit__() +        os.environ = os.environ._environ      def request(self, uri, method='GET', body=None, headers={}):          self.connection = httplib.HTTPConnection('localhost', self.PORT) @@ -390,9 +393,9 @@ def test_main(verbose=None):      try:          cwd = os.getcwd()          test_support.run_unittest(BaseHTTPServerTestCase, -                                  SimpleHTTPServerTestCase, -                                  CGIHTTPServerTestCase -                                  ) +                                SimpleHTTPServerTestCase, +                                CGIHTTPServerTestCase +                                )      finally:          os.chdir(cwd)  | 
