cpython/Lib/idlelib/idle_test/test_config_key.py
Terry Jan Reedy 3f3dc89a15 Issue #27714: text_textview now passes when re-run in the same process
because test_idle failed while running with test -w (and no -jn).
Prevent a non-fatal warning from test_config_key.
2016-08-10 15:15:25 -04:00

32 lines
697 B
Python

''' Test idlelib.config_key.
Coverage: 56% from creating and closing dialog.
'''
from idlelib import config_key
from test.support import requires
requires('gui')
import unittest
from tkinter import Tk, Text
class GetKeysTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.root = Tk()
@classmethod
def tearDownClass(cls):
cls.root.update() # Stop "can't run event command" warning.
cls.root.destroy()
del cls.root
def test_init(self):
dia = config_key.GetKeysDialog(
self.root, 'test', '<<Test>>', ['<Key-F12>'], _utest=True)
dia.Cancel()
if __name__ == '__main__':
unittest.main(verbosity=2)