1import os 2from test import test_support 3 4# Skip test if _tkinter wasn't built or gui resource is not available. 5test_support.import_module('_tkinter') 6test_support.requires('gui') 7 8this_dir = os.path.dirname(os.path.abspath(__file__)) 9lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir, 10 'lib-tk', 'test')) 11 12with test_support.DirsOnSysPath(lib_tk_test): 13 import runtktests 14 15def test_main(): 16 with test_support.DirsOnSysPath(lib_tk_test): 17 test_support.run_unittest( 18 *runtktests.get_tests(text=False, packages=['test_tkinter'])) 19 20if __name__ == '__main__': 21 test_main() 22