blob: 7551a7f4709c13a061c63d2a0145504767c99c9e [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.
9from tkinter.test.support import check_tk_availability
10check_tk_availability()
Kristján Valur Jónsson42a40c52009-04-01 11:28:47 +000011
Ned Deily41435352011-07-03 21:56:48 -070012from tkinter.test import runtktests
Guilherme Poloa91790a2009-02-09 20:40:42 +000013
14def test_main(enable_gui=False):
15 if enable_gui:
16 if support.use_resources is None:
17 support.use_resources = ['gui']
18 elif 'gui' not in support.use_resources:
19 support.use_resources.append('gui')
20
21 support.run_unittest(
22 *runtktests.get_tests(text=False, packages=['test_tkinter']))
23
24if __name__ == '__main__':
25 test_main(enable_gui=True)