cpython/Lib/idlelib/idle_test/test_configdialog.py
Terry Jan Reedy 6047b55372 Issue #27196: Stop 'application destroyed' warnings when running IDLE tests.
The update_idletasks solution was provided by Serhiy Storchaka.
2016-06-03 23:53:56 -04:00

34 lines
823 B
Python

'''Test idlelib.configHandler.
Coverage: 46% just by creating dialog.
The other half is code for working with user customizations.
'''
import unittest
from test.support import requires
from tkinter import Tk
from idlelib.configDialog import ConfigDialog
from idlelib.macosxSupport import _initializeTkVariantTests
class ConfigDialogTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
requires('gui')
cls.root = Tk()
_initializeTkVariantTests(cls.root)
@classmethod
def tearDownClass(cls):
cls.root.update_idletasks()
cls.root.destroy()
del cls.root
def test_dialog(self):
d = ConfigDialog(self.root, 'Test', _utest=True)
d.remove_var_callbacks()
d.destroy()
if __name__ == '__main__':
unittest.main(verbosity=2)