summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-11-07 23:15:10 -0500
committerTerry Jan Reedy <tjreedy@udel.edu>2016-11-07 23:15:10 -0500
commite83a64164ef20b0e15ad1f6b259cbe4e0a29be07 (patch)
treecbfca76ca33ff7c8f79912e64d8bb9a88e18617c
parentcb4f0c53ffa171de8a6fa3aba6be2eb38d9f758e (diff)
parent0180cf66845474ec07ff217123f5de1af4923346 (diff)
downloadcpython-git-e83a64164ef20b0e15ad1f6b259cbe4e0a29be07.tar.gz
Merge with 3.6
-rw-r--r--Lib/idlelib/config-main.def2
-rw-r--r--Lib/idlelib/idle_test/test_configdialog.py20
2 files changed, 14 insertions, 8 deletions
diff --git a/Lib/idlelib/config-main.def b/Lib/idlelib/config-main.def
index 330c0154a7..16f4b0959c 100644
--- a/Lib/idlelib/config-main.def
+++ b/Lib/idlelib/config-main.def
@@ -60,6 +60,8 @@ delete-exitfunc= 1
width= 80
height= 40
font= TkFixedFont
+# For TkFixedFont, the actual size and boldness are obtained from tk
+# and override 10 and 0. See idlelib.config.IdleConf.GetFont
font-size= 10
font-bold= 0
encoding= none
diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py
index 81c57e863e..3f94493733 100644
--- a/Lib/idlelib/idle_test/test_configdialog.py
+++ b/Lib/idlelib/idle_test/test_configdialog.py
@@ -54,25 +54,29 @@ class FontTabTest(unittest.TestCase):
changes.clear()
def test_font(self):
+ # Set values guaranteed not to be defaults.
+ dfont = idleConf.GetFont(root, 'main', 'EditorWindow')
+ dsize = str(dfont[1])
+ dbold = dfont[2] == 'bold'
configure.fontName.set('Test Font')
expected = [
('main', 'EditorWindow', 'font', 'Test Font'),
- ('main', 'EditorWindow', 'font-size', '10'),
- ('main', 'EditorWindow', 'font-bold', False)]
+ ('main', 'EditorWindow', 'font-size', dsize),
+ ('main', 'EditorWindow', 'font-bold', dbold)]
self.assertEqual(changes, expected)
changes.clear()
- configure.fontSize.set(12)
+ configure.fontSize.set(20)
expected = [
('main', 'EditorWindow', 'font', 'Test Font'),
- ('main', 'EditorWindow', 'font-size', '12'),
- ('main', 'EditorWindow', 'font-bold', False)]
+ ('main', 'EditorWindow', 'font-size', '20'),
+ ('main', 'EditorWindow', 'font-bold', dbold)]
self.assertEqual(changes, expected)
changes.clear()
- configure.fontBold.set(True)
+ configure.fontBold.set(not dbold)
expected = [
('main', 'EditorWindow', 'font', 'Test Font'),
- ('main', 'EditorWindow', 'font-size', '12'),
- ('main', 'EditorWindow', 'font-bold', True)]
+ ('main', 'EditorWindow', 'font-size', '20'),
+ ('main', 'EditorWindow', 'font-bold', not dbold)]
self.assertEqual(changes, expected)
#def test_sample(self): pass # TODO