Skip to content

Commit 667522e

Browse files
authored
bpo-31414: IDLE -- fix tk entry box tests by deleting first. (#3501)
Adding to an int entry is not the same as deleting and inserting because int('') will fail.
1 parent 4866957 commit 667522e

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

Lib/idlelib/idle_test/test_configdialog.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,24 +1128,28 @@ def test_startup(self):
11281128

11291129
def test_editor_size(self):
11301130
d = self.page
1131-
d.win_height_int.insert(0, '1')
1132-
self.assertEqual(mainpage, {'EditorWindow': {'height': '140'}})
1131+
d.win_height_int.delete(0, 'end')
1132+
d.win_height_int.insert(0, '11')
1133+
self.assertEqual(mainpage, {'EditorWindow': {'height': '11'}})
11331134
changes.clear()
1134-
d.win_width_int.insert(0, '1')
1135-
self.assertEqual(mainpage, {'EditorWindow': {'width': '180'}})
1135+
d.win_width_int.delete(0, 'end')
1136+
d.win_width_int.insert(0, '11')
1137+
self.assertEqual(mainpage, {'EditorWindow': {'width': '11'}})
11361138

11371139
def test_autocomplete_wait(self):
1138-
self.page.auto_wait_int.insert(0, '1')
1139-
self.assertEqual(extpage, {'AutoComplete': {'popupwait': '12000'}})
1140+
self.page.auto_wait_int.delete(0, 'end')
1141+
self.page.auto_wait_int.insert(0, '11')
1142+
self.assertEqual(extpage, {'AutoComplete': {'popupwait': '11'}})
11401143

11411144
def test_parenmatch(self):
11421145
d = self.page
11431146
eq = self.assertEqual
11441147
d.paren_style_type['menu'].invoke(0)
11451148
eq(extpage, {'ParenMatch': {'style': 'opener'}})
11461149
changes.clear()
1147-
d.paren_flash_time.insert(0, '2')
1148-
eq(extpage, {'ParenMatch': {'flash-delay': '2500'}})
1150+
d.paren_flash_time.delete(0, 'end')
1151+
d.paren_flash_time.insert(0, '11')
1152+
eq(extpage, {'ParenMatch': {'flash-delay': '11'}})
11491153
changes.clear()
11501154
d.bell_on.invoke()
11511155
eq(extpage, {'ParenMatch': {'bell': 'False'}})
@@ -1158,12 +1162,14 @@ def test_autosave(self):
11581162
self.assertEqual(mainpage, {'General': {'autosave': '0'}})
11591163

11601164
def test_paragraph(self):
1161-
self.page.format_width_int.insert(0, '1')
1162-
self.assertEqual(extpage, {'FormatParagraph': {'max-width': '172'}})
1165+
self.page.format_width_int.delete(0, 'end')
1166+
self.page.format_width_int.insert(0, '11')
1167+
self.assertEqual(extpage, {'FormatParagraph': {'max-width': '11'}})
11631168

11641169
def test_context(self):
1170+
self.page.context_int.delete(0, 'end')
11651171
self.page.context_int.insert(0, '1')
1166-
self.assertEqual(extpage, {'CodeContext': {'numlines': '13'}})
1172+
self.assertEqual(extpage, {'CodeContext': {'numlines': '1'}})
11671173

11681174
def test_source_selected(self):
11691175
d = self.page
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
IDLE -- fix tk entry box tests by deleting first. Adding to an int entry is
2+
not the same as deleting and inserting because int('') will fail.

0 commit comments

Comments
 (0)