FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-39388: IDLE: Fix bug when cancelling out of configdialog by csabella · Pull Request #18068 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) .txt  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 3 additions & 1 deletion Lib/idlelib/NEWS.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Released on 2020-10-05?
======================================


bpo-39050: Make Settings dialog Help button work again.
bpo-39388: Settings dialog Cancel button cancels pending changes.

bpo-39050: Settings dialog Help button again displays help text.

bpo-32989: Add tests for editor newline_and_indent_event method.
Remove unneeded arguments and dead code from pyparse
Expand Down
1 change: 1 addition & 0 deletions Lib/idlelib/configdialog.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def cancel(self):
Methods:
destroy: inherited
"""
changes.clear()
self.destroy()

def destroy(self):
Expand Down
21 changes: 14 additions & 7 deletions Lib/idlelib/idle_test/test_configdialog.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,24 @@ def tearDownModule():
root.destroy()
root = dialog = None

class ConfigDialogTest(unittest.TestCase):

def test_help(self):
class DialogTest(unittest.TestCase):

@mock.patch(__name__+'.dialog.destroy', new_callable=Func)
def test_cancel(self, destroy):
changes['main']['something'] = 1
dialog.cancel()
self.assertEqual(changes['main'], {})
self.assertEqual(destroy.called, 1)

@mock.patch('idlelib.configdialog.view_text', new_callable=Func)
def test_help(self, view):
dialog.note.select(dialog.keyspage)
saved = configdialog.view_text
view = configdialog.view_text = Func()
dialog.help()
s = view.kwds['contents']
self.assertTrue(s.startswith('When you click'))
self.assertTrue(s.endswith('a different name.\n'))
configdialog.view_text = saved
self.assertTrue(s.startswith('When you click') and
s.endswith('a different name.\n'))


class FontPageTest(unittest.TestCase):
"""Test that font widgets enable users to make font changes.
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IDLE Settings Cancel button now cancels pending changes

Back | FazBrowse Home | New Git URL