Terry Jan Reedy | f688f72 | 2013-07-21 21:57:52 -0400 | [diff] [blame] | 1 | # Skip test if _tkinter or _thread wasn't built or idlelib was deleted. |
| 2 | from test.test_support import import_module |
| 3 | import_module('Tkinter') |
| 4 | import_module('threading') # imported by PyShell, imports _thread |
Terry Jan Reedy | b02a1b8 | 2013-05-30 18:24:28 -0400 | [diff] [blame] | 5 | idletest = import_module('idlelib.idle_test') |
Terry Jan Reedy | b8fd9ca | 2013-05-30 14:47:33 -0400 | [diff] [blame] | 6 | |
| 7 | # Without test_main present, regrtest.runtest_inner (line1219) calls |
| 8 | # unittest.TestLoader().loadTestsFromModule(this_module) which calls |
| 9 | # load_tests() if it finds it. (Unittest.main does the same.) |
| 10 | load_tests = idletest.load_tests |
| 11 | |
| 12 | if __name__ == '__main__': |
Terry Jan Reedy | 1d14246 | 2013-06-29 18:22:02 -0400 | [diff] [blame] | 13 | # Until unittest supports resources, we emulate regrtest's -ugui |
| 14 | # so loaded tests run the same as if textually present here. |
| 15 | # If any Idle test ever needs another resource, add it to the list. |
| 16 | from test import support |
| 17 | support.use_resources = ['gui'] # use_resources is initially None |
Terry Jan Reedy | b8fd9ca | 2013-05-30 14:47:33 -0400 | [diff] [blame] | 18 | import unittest |
| 19 | unittest.main(verbosity=2, exit=False) |