Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3457f428
Commit
3457f428
authored
Aug 27, 2017
by
Terry Jan Reedy
Committed by
GitHub
Aug 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-31287: IDLE - do not alter tkinter.messagebox in configdialog tests. (#3220)
parent
7028e598
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
Lib/idlelib/configdialog.py
Lib/idlelib/configdialog.py
+11
-3
Lib/idlelib/idle_test/test_configdialog.py
Lib/idlelib/idle_test/test_configdialog.py
+4
-4
Misc/NEWS.d/next/IDLE/2017-08-27-15-31-33.bpo-31287.aZERfI.rst
...NEWS.d/next/IDLE/2017-08-27-15-31-33.bpo-31287.aZERfI.rst
+1
-0
No files found.
Lib/idlelib/configdialog.py
View file @
3457f428
...
...
@@ -18,7 +18,7 @@ from tkinter.ttk import (Button, Checkbutton, Entry, Frame, Label, LabelFrame,
Notebook
,
Radiobutton
,
Scrollbar
,
Style
)
import
tkinter.colorchooser
as
tkColorChooser
import
tkinter.font
as
tkFont
import
tkinter.messagebox
as
tkMessageB
ox
from
tkinter
import
messageb
ox
from
idlelib.config
import
idleConf
,
ConfigChanges
from
idlelib.config_key
import
GetKeysDialog
...
...
@@ -1227,6 +1227,10 @@ class HighPage(Frame):
value
=
theme
[
element
]
idleConf
.
userCfg
[
'highlight'
].
SetOption
(
theme_name
,
element
,
value
)
def
askyesno
(
self
,
*
args
,
**
kwargs
):
# Make testing easier. Could change implementation.
messagebox
.
askyesno
(
*
args
,
**
kwargs
)
def
delete_custom
(
self
):
"""Handle event to delete custom theme.
...
...
@@ -1251,7 +1255,7 @@ class HighPage(Frame):
"""
theme_name
=
self
.
custom_name
.
get
()
delmsg
=
'Are you sure you wish to delete the theme %r ?'
if
not
tkMessageBox
.
askyesno
(
if
not
self
.
askyesno
(
'Delete Theme'
,
delmsg
%
theme_name
,
parent
=
self
):
return
self
.
cd
.
deactivate_current_config
()
...
...
@@ -1669,6 +1673,10 @@ class KeysPage(Frame):
value
=
keyset
[
event
]
idleConf
.
userCfg
[
'keys'
].
SetOption
(
keyset_name
,
event
,
value
)
def
askyesno
(
self
,
*
args
,
**
kwargs
):
# Make testing easier. Could change implementation.
messagebox
.
askyesno
(
*
args
,
**
kwargs
)
def
delete_custom_keys
(
self
):
"""Handle event to delete a custom key set.
...
...
@@ -1678,7 +1686,7 @@ class KeysPage(Frame):
"""
keyset_name
=
self
.
custom_name
.
get
()
delmsg
=
'Are you sure you wish to delete the key set %r ?'
if
not
tkMessageBox
.
askyesno
(
if
not
self
.
askyesno
(
'Delete Key Set'
,
delmsg
%
keyset_name
,
parent
=
self
):
return
self
.
cd
.
deactivate_current_config
()
...
...
Lib/idlelib/idle_test/test_configdialog.py
View file @
3457f428
...
...
@@ -643,7 +643,7 @@ class HighPageTest(unittest.TestCase):
eq
=
self
.
assertEqual
d
=
self
.
page
d
.
button_delete_custom
.
state
((
'!disabled'
,))
yesno
=
configdialog
.
tkMessageBox
.
askyesno
=
Func
()
yesno
=
d
.
askyesno
=
Func
()
dialog
.
deactivate_current_config
=
Func
()
dialog
.
activate_config_changes
=
Func
()
...
...
@@ -678,7 +678,7 @@ class HighPageTest(unittest.TestCase):
eq
(
d
.
set_theme_type
.
called
,
1
)
del
dialog
.
activate_config_changes
,
dialog
.
deactivate_current_config
del
configdialog
.
tkMessageBox
.
askyesno
del
d
.
askyesno
class
KeysPageTest
(
unittest
.
TestCase
):
...
...
@@ -1034,7 +1034,7 @@ class KeysPageTest(unittest.TestCase):
eq
=
self
.
assertEqual
d
=
self
.
page
d
.
button_delete_custom_keys
.
state
((
'!disabled'
,))
yesno
=
configdialog
.
tkMessageBox
.
askyesno
=
Func
()
yesno
=
d
.
askyesno
=
Func
()
dialog
.
deactivate_current_config
=
Func
()
dialog
.
activate_config_changes
=
Func
()
...
...
@@ -1069,7 +1069,7 @@ class KeysPageTest(unittest.TestCase):
eq
(
d
.
set_keys_type
.
called
,
1
)
del
dialog
.
activate_config_changes
,
dialog
.
deactivate_current_config
del
configdialog
.
tkMessageBox
.
askyesno
del
d
.
askyesno
class
GenPageTest
(
unittest
.
TestCase
):
...
...
Misc/NEWS.d/next/IDLE/2017-08-27-15-31-33.bpo-31287.aZERfI.rst
0 → 100644
View file @
3457f428
IDLE - Do not modify tkinter.message in test_configdialog.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment