mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Make sure that the warnings filter is not reset or changed beyond the current
running test file. Closes issue2407. Thanks Jerry Seutter.
This commit is contained in:
		
							parent
							
								
									a0ce6b6b71
								
							
						
					
					
						commit
						48581c5f08
					
				
					 3 changed files with 24 additions and 36 deletions
				
			
		|  | @ -211,8 +211,8 @@ def update(self, v): | |||
|             def digest(self): | ||||
|                 return self._x.digest() | ||||
| 
 | ||||
|         warnings.simplefilter('error', RuntimeWarning) | ||||
|         try: | ||||
|         with test_support.catch_warning(): | ||||
|             warnings.simplefilter('error', RuntimeWarning) | ||||
|             try: | ||||
|                 hmac.HMAC('a', 'b', digestmod=MockCrazyHash) | ||||
|             except RuntimeWarning: | ||||
|  | @ -227,8 +227,6 @@ def digest(self): | |||
|                 pass | ||||
|             else: | ||||
|                 self.fail('Expected warning about small block_size') | ||||
|         finally: | ||||
|             warnings.resetwarnings() | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brett Cannon
						Brett Cannon