Guilherme Polo | a91790a | 2009-02-09 20:40:42 +0000 | [diff] [blame] | 1 | from test import support |
R. David Murray | a21e4ca | 2009-03-31 23:16:50 +0000 | [diff] [blame] | 2 | # Skip test if _tkinter wasn't built. |
| 3 | support.import_module('_tkinter') |
| 4 | |
Terry Jan Reedy | 743c85a | 2013-03-16 02:37:06 -0400 | [diff] [blame] | 5 | # Make sure tkinter._fix runs to set up the environment |
| 6 | support.import_fresh_module('tkinter') |
| 7 | |
Ned Deily | 4143535 | 2011-07-03 21:56:48 -0700 | [diff] [blame] | 8 | # Skip test if tk cannot be initialized. |
| 9 | from tkinter.test.support import check_tk_availability |
| 10 | check_tk_availability() |
Kristján Valur Jónsson | 42a40c5 | 2009-04-01 11:28:47 +0000 | [diff] [blame] | 11 | |
Ned Deily | 4143535 | 2011-07-03 21:56:48 -0700 | [diff] [blame] | 12 | from tkinter.test import runtktests |
Guilherme Polo | a91790a | 2009-02-09 20:40:42 +0000 | [diff] [blame] | 13 | |
| 14 | def 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 | |
| 24 | if __name__ == '__main__': |
| 25 | test_main(enable_gui=True) |