[New-bugs-announce] [issue21647] Idle unittests: make gui, mock switching easier.

Terry J. Reedy report at bugs.python.org
Tue Jun 3 07:58:40 CEST 2014


New submission from Terry J. Reedy:

Idle unittests that use tkinter.Text are developed using the gui widget and then switched, to the current extent possible, to mock_tk.Text. I have done this previously by commenting out gui lines and adding new lines, so it would be possible to switch back if needed. test_searchengine is an example. However, switching back would require commenting and uncommenting several lines.

When reviewing test_autoexpand #18292, I realized that everything after the imports

from tkinter import Text
from idlelib.idle_text.mock_tk import Text

can be made conditional on 'tkinter in str(Text)'. The only comment switching needed is for the import lines. This issue is about retrofitting test_searchengine and any other files that need it.

----------
messages: 219663
nosy: sahutd, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle unittests: make gui, mock switching easier.
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21647>
_______________________________________


More information about the New-bugs-announce mailing list