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 | |
Ned Deily | 4143535 | 2011-07-03 21:56:48 -0700 | [diff] [blame^] | 5 | # Skip test if tk cannot be initialized. |
| 6 | from tkinter.test.support import check_tk_availability |
| 7 | check_tk_availability() |
Kristján Valur Jónsson | 42a40c5 | 2009-04-01 11:28:47 +0000 | [diff] [blame] | 8 | |
Ned Deily | 4143535 | 2011-07-03 21:56:48 -0700 | [diff] [blame^] | 9 | from tkinter.test import runtktests |
Guilherme Polo | a91790a | 2009-02-09 20:40:42 +0000 | [diff] [blame] | 10 | |
| 11 | def test_main(enable_gui=False): |
| 12 | if enable_gui: |
| 13 | if support.use_resources is None: |
| 14 | support.use_resources = ['gui'] |
| 15 | elif 'gui' not in support.use_resources: |
| 16 | support.use_resources.append('gui') |
| 17 | |
| 18 | support.run_unittest( |
| 19 | *runtktests.get_tests(text=False, packages=['test_tkinter'])) |
| 20 | |
| 21 | if __name__ == '__main__': |
| 22 | test_main(enable_gui=True) |