Guilherme Polo | bbb7efd | 2009-02-09 19:21:21 +0000 | [diff] [blame^] | 1 | import os |
| 2 | import sys |
| 3 | from _tkinter import TclError |
| 4 | from test import test_support |
| 5 | |
| 6 | this_dir = os.path.dirname(os.path.abspath(__file__)) |
| 7 | lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir, |
| 8 | 'lib-tk', 'test')) |
| 9 | if lib_tk_test not in sys.path: |
| 10 | sys.path.append(lib_tk_test) |
| 11 | |
| 12 | import runtktests |
| 13 | |
| 14 | def test_main(enable_gui=False): |
| 15 | if enable_gui: |
| 16 | if test_support.use_resources is None: |
| 17 | test_support.use_resources = ['gui'] |
| 18 | elif 'gui' not in test_support.use_resources: |
| 19 | test_support.use_resources.append('gui') |
| 20 | |
| 21 | test_support.run_unittest( |
| 22 | *runtktests.get_tests(text=False, packages=['test_tkinter'])) |
| 23 | |
| 24 | if __name__ == '__main__': |
| 25 | test_main(enable_gui=True) |