blob: 589f66d6921e521a99b6195f5bd37f2bfd635f6b [file] [log] [blame]
Guilherme Poloa91790a2009-02-09 20:40:42 +00001from test import support
R. David Murraya21e4ca2009-03-31 23:16:50 +00002# Skip test if _tkinter wasn't built.
3support.import_module('_tkinter')
4
Terry Jan Reedy743c85a2013-03-16 02:37:06 -04005# Make sure tkinter._fix runs to set up the environment
6support.import_fresh_module('tkinter')
7
Ned Deily41435352011-07-03 21:56:48 -07008# Skip test if tk cannot be initialized.
Zachary Warececed6b2014-05-02 10:51:07 -05009support.requires('gui')
Kristján Valur Jónsson42a40c52009-04-01 11:28:47 +000010
Ned Deily41435352011-07-03 21:56:48 -070011from tkinter.test import runtktests
Guilherme Poloa91790a2009-02-09 20:40:42 +000012
13def test_main(enable_gui=False):
14 if enable_gui:
15 if support.use_resources is None:
16 support.use_resources = ['gui']
17 elif 'gui' not in support.use_resources:
18 support.use_resources.append('gui')
19
20 support.run_unittest(
21 *runtktests.get_tests(text=False, packages=['test_tkinter']))
22
23if __name__ == '__main__':
24 test_main(enable_gui=True)