blob: e1f9c5bfe216305047d08f7287fb25d529569c77 [file] [log] [blame]
Guilherme Polobbb7efd2009-02-09 19:21:21 +00001import os
2import sys
Guilherme Polo55bdb8e2009-02-09 19:57:04 +00003import Tkinter
Guilherme Polobbb7efd2009-02-09 19:21:21 +00004from test import test_support
5
Guilherme Polo55bdb8e2009-02-09 19:57:04 +00006try:
7 Tkinter.Button()
8except Tkinter.TclError, msg:
9 # assuming tk is not available
10 raise test_support.TestSkipped("tk not available: %s" % msg)
11
Guilherme Polobbb7efd2009-02-09 19:21:21 +000012this_dir = os.path.dirname(os.path.abspath(__file__))
13lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir,
14 'lib-tk', 'test'))
15if lib_tk_test not in sys.path:
16 sys.path.append(lib_tk_test)
17
18import runtktests
19
20def test_main(enable_gui=False):
21 if enable_gui:
22 if test_support.use_resources is None:
23 test_support.use_resources = ['gui']
24 elif 'gui' not in test_support.use_resources:
25 test_support.use_resources.append('gui')
26
27 test_support.run_unittest(
28 *runtktests.get_tests(text=False, packages=['test_tkinter']))
29
30if __name__ == '__main__':
31 test_main(enable_gui=True)