mirror of
				https://github.com/python/cpython.git
				synced 2025-10-29 17:38:56 +00:00 
			
		
		
		
	Restore the global state of the log vars, so that test_cgi can be run twice without failures.
This commit is contained in:
		
							parent
							
								
									6e18e04273
								
							
						
					
					
						commit
						7ebb706133
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		|  | @ -155,7 +155,13 @@ class CgiTests(unittest.TestCase): | ||||||
|             cgi.logfp = None |             cgi.logfp = None | ||||||
|             cgi.logfile = "/dev/null" |             cgi.logfile = "/dev/null" | ||||||
|             cgi.initlog("%s", "Testing log 3") |             cgi.initlog("%s", "Testing log 3") | ||||||
|             self.addCleanup(cgi.logfp.close) |             def log_cleanup(): | ||||||
|  |                 """Restore the global state of the log vars.""" | ||||||
|  |                 cgi.logfile = '' | ||||||
|  |                 cgi.logfp.close() | ||||||
|  |                 cgi.logfp = None | ||||||
|  |                 cgi.log = cgi.initlog | ||||||
|  |             self.addCleanup(log_cleanup) | ||||||
|             cgi.log("Testing log 4") |             cgi.log("Testing log 4") | ||||||
| 
 | 
 | ||||||
|     def test_fieldstorage_readline(self): |     def test_fieldstorage_readline(self): | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ezio Melotti
						Ezio Melotti