mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Issue #6157: Fixed tkinter.Text.debug(). tkinter.Text.bbox() now raises
TypeError instead of TclError on wrong number of arguments. Original patch by Guilherme Polo.
This commit is contained in:
		
						commit
						4babb9111f
					
				
					 4 changed files with 34 additions and 5 deletions
				
			
		|  | @ -610,6 +610,19 @@ def test_wrap(self): | |||
|         else: | ||||
|             self.checkEnumParam(widget, 'wrap', 'char', 'none', 'word') | ||||
| 
 | ||||
|     def test_bbox(self): | ||||
|         widget = self.create() | ||||
|         bbox = widget.bbox('1.1') | ||||
|         self.assertEqual(len(bbox), 4) | ||||
|         for item in bbox: | ||||
|             self.assertIsInstance(item, int) | ||||
| 
 | ||||
|         self.assertIsNone(widget.bbox('end')) | ||||
|         self.assertRaises(tkinter.TclError, widget.bbox, 'noindex') | ||||
|         self.assertRaises(tkinter.TclError, widget.bbox, None) | ||||
|         self.assertRaises(TypeError, widget.bbox) | ||||
|         self.assertRaises(TypeError, widget.bbox, '1.1', 'end') | ||||
| 
 | ||||
| 
 | ||||
| @add_standard_options(PixelSizeTests, StandardOptionsTests) | ||||
| class CanvasTest(AbstractWidgetTest, unittest.TestCase): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Serhiy Storchaka
						Serhiy Storchaka