From 8f9f5870d3c1ed62710437e14d227ab1e95efcf7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 5 Nov 2013 21:05:10 +0200 Subject: [PATCH] Fix test_insertwidth Tkinter tests on Tk 8.5 with patchlevel >= 8.5.12 (issue #19085). --- Lib/tkinter/test/test_tkinter/test_widgets.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index 8a768edfa89..32b1e5da369 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -332,12 +332,12 @@ class EntryTest(AbstractWidgetTest, unittest.TestCase): def test_insertwidth(self): widget = self.create() self.checkPixelsParam(widget, 'insertwidth', 1.3, 3.6, '10p') - if tcl_version[:2] == (8, 5): - self.checkParam(widget, 'insertwidth', 0.9, expected=2) - else: - self.checkParam(widget, 'insertwidth', 0.9, expected=1) self.checkParam(widget, 'insertwidth', 0.1, expected=2) self.checkParam(widget, 'insertwidth', -2, expected=2) + if pixels_round(0.9) <= 0: + self.checkParam(widget, 'insertwidth', 0.9, expected=2) + else: + self.checkParam(widget, 'insertwidth', 0.9) def test_invalidcommand(self): widget = self.create()