Terry Jan Reedy | 725d9dd | 2013-07-28 00:00:20 -0400 | [diff] [blame] | 1 | import unittest |
Zachary Ware | f085a16 | 2015-10-24 23:22:16 -0500 | [diff] [blame] | 2 | from test.support import import_module, import_fresh_module |
Terry Jan Reedy | 725d9dd | 2013-07-28 00:00:20 -0400 | [diff] [blame] | 3 | |
| 4 | # Skip test if _thread or _tkinter wasn't built or idlelib was deleted. |
Terry Jan Reedy | eb4c9c7 | 2013-05-28 22:21:53 -0400 | [diff] [blame] | 5 | import_module('threading') # imported by PyShell, imports _thread |
Terry Jan Reedy | 725d9dd | 2013-07-28 00:00:20 -0400 | [diff] [blame] | 6 | tk = import_module('tkinter') # imports _tkinter |
Terry Jan Reedy | eb4c9c7 | 2013-05-28 22:21:53 -0400 | [diff] [blame] | 7 | idletest = import_module('idlelib.idle_test') |
Zachary Ware | f085a16 | 2015-10-24 23:22:16 -0500 | [diff] [blame] | 8 | # Make sure TCL_LIBRARY is set properly on Windows. Note that this will |
| 9 | # cause a warning about test_idle modifying the environment |
| 10 | import_fresh_module('tkinter._fix') |
Terry Jan Reedy | db4e5c5 | 2013-05-27 21:32:03 -0400 | [diff] [blame] | 11 | |
Terry Jan Reedy | eb4c9c7 | 2013-05-28 22:21:53 -0400 | [diff] [blame] | 12 | # Without test_main present, regrtest.runtest_inner (line1219) calls |
| 13 | # unittest.TestLoader().loadTestsFromModule(this_module) which calls |
| 14 | # load_tests() if it finds it. (Unittest.main does the same.) |
| 15 | load_tests = idletest.load_tests |
Terry Jan Reedy | db4e5c5 | 2013-05-27 21:32:03 -0400 | [diff] [blame] | 16 | |
| 17 | if __name__ == '__main__': |
Terry Jan Reedy | db4e5c5 | 2013-05-27 21:32:03 -0400 | [diff] [blame] | 18 | unittest.main(verbosity=2, exit=False) |