mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	bpo-45436: Fix tkinter tests with Tcl/Tk 8.6.11+ (GH-29077)
Since v8.6.11, a few configuration options seem to accept an empty value where they did not previously; particularly the `type` of a `Menu` widget, and the `compound` of any ttk widget with a label. Providing an explicit expected error message to `checkEnumParam` bypasses the check of an empty value, which no longer raises `TclError`.
This commit is contained in:
		
							parent
							
								
									3163e68c34
								
							
						
					
					
						commit
						4fe454c6f5
					
				
					 2 changed files with 11 additions and 5 deletions
				
			
		|  | @ -169,10 +169,13 @@ def checkImageParam(self, widget, name): | |||
|                 errmsg='image "spam" doesn\'t exist') | ||||
| 
 | ||||
|     def test_configure_compound(self): | ||||
|         options = 'none text image center top bottom left right'.split() | ||||
|         errmsg = ( | ||||
|             'bad compound "{}": must be' | ||||
|             f' {", ".join(options[:-1])}, or {options[-1]}' | ||||
|             ) | ||||
|         widget = self.create() | ||||
|         self.checkEnumParam(widget, 'compound', | ||||
|                 'none', 'text', 'image', 'center', | ||||
|                 'top', 'bottom', 'left', 'right') | ||||
|         self.checkEnumParam(widget, 'compound', *options, errmsg=errmsg) | ||||
| 
 | ||||
|     def test_configure_state(self): | ||||
|         widget = self.create() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Zachary Ware
						Zachary Ware