mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Cleanup this test's modification of os.environ in teardown (this already
exists in 3.4 but apparently wasn't done for 3.3).
This commit is contained in:
		
							parent
							
								
									162307fa35
								
							
						
					
					
						commit
						30d8e167ff
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -353,12 +353,15 @@ class TestUrlopen(unittest.TestCase):
 | 
			
		|||
    def setUp(self):
 | 
			
		||||
        super(TestUrlopen, self).setUp()
 | 
			
		||||
        # Ignore proxies for localhost tests.
 | 
			
		||||
        self.old_environ = os.environ.copy()
 | 
			
		||||
        os.environ['NO_PROXY'] = '*'
 | 
			
		||||
        self.server = None
 | 
			
		||||
 | 
			
		||||
    def tearDown(self):
 | 
			
		||||
        if self.server is not None:
 | 
			
		||||
            self.server.stop()
 | 
			
		||||
        os.environ.clear()
 | 
			
		||||
        os.environ.update(self.old_environ)
 | 
			
		||||
        super(TestUrlopen, self).tearDown()
 | 
			
		||||
 | 
			
		||||
    def urlopen(self, url, data=None, **kwargs):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue