Author Saimadhav.Heblikar
Recipients Saimadhav.Heblikar, terry.reedy
Date 2014-06-06.10:52:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Perhaps, we can move GUI/non GUI code into blocks. I will take Text as example. 

from test import support
if support._is_gui_available():
   from tkinter import Text
   from idlelib.idle_test.mock_tk import Text
if not support._is_gui_available():
    parts of test which can be run keeping in mind mock.Text's      limitations.
    everything, using tkinter.Text

Only drawback is _is_gui_available is not documented publicly. Also, we'd will have lot of if...else blocks all over the place. Avoiding code duplication will be tricky.
If nothing else, the if...else block can be used at the import level only.
Date User Action Args
2014-06-06 10:52:28Saimadhav.Heblikarsetrecipients: + Saimadhav.Heblikar, terry.reedy
2014-06-06 10:52:28Saimadhav.Heblikarsetmessageid: <>
2014-06-06 10:52:28Saimadhav.Heblikarlinkissue21647 messages
2014-06-06 10:52:28Saimadhav.Heblikarcreate