summaryrefslogtreecommitdiff
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-01-17 18:44:09 -0800
committerGitHub <noreply@github.com>2019-01-17 18:44:09 -0800
commit237f864c905531b2da211bebc5f6109b0b797bac (patch)
tree71aeacecebb7da793834a8b76fc7d1e61ec1c83e /Lib/idlelib
parent59d7bdb3386ab78ccf6edbbeba9669124515c707 (diff)
downloadcpython-git-237f864c905531b2da211bebc5f6109b0b797bac.tar.gz
bpo-35730: IDLE - test squeezer reload() by checking load_font() (GH-11585)
(cherry picked from commit e55cf024cae203f63b4f78f1b21c1375fe424441) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/idle_test/test_squeezer.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/idlelib/idle_test/test_squeezer.py b/Lib/idlelib/idle_test/test_squeezer.py
index 71eccd3693..4e3da030a3 100644
--- a/Lib/idlelib/idle_test/test_squeezer.py
+++ b/Lib/idlelib/idle_test/test_squeezer.py
@@ -293,25 +293,21 @@ class SqueezerTest(unittest.TestCase):
def test_reload(self):
"""Test the reload() class-method."""
editwin = self.make_mock_editor_window(with_text_widget=True)
- text_widget = editwin.text
squeezer = self.make_squeezer_instance(editwin)
+ squeezer.load_font = Mock()
- orig_zero_char_width = squeezer.zero_char_width
orig_auto_squeeze_min_lines = squeezer.auto_squeeze_min_lines
- # Increase both font size and auto-squeeze-min-lines.
- text_widget["font"] = ('Courier', 20)
+ # Increase auto-squeeze-min-lines.
new_auto_squeeze_min_lines = orig_auto_squeeze_min_lines + 10
self.set_idleconf_option_with_cleanup(
'main', 'PyShell', 'auto-squeeze-min-lines',
str(new_auto_squeeze_min_lines))
Squeezer.reload()
- # The following failed on Gentoo buildbots. Issue title will be
- # IDLE: Fix squeezer test_reload.
- #self.assertGreater(squeezer.zero_char_width, orig_zero_char_width)
self.assertEqual(squeezer.auto_squeeze_min_lines,
new_auto_squeeze_min_lines)
+ squeezer.load_font.assert_called()
def test_reload_no_squeezer_instances(self):
"""Test that Squeezer.reload() runs without any instances existing."""