1"""idlelib.idle_test implements test.test_idle, which tests the IDLE 2application as part of the stdlib test suite. 3Run IDLE tests alone with "python -m test.test_idle (-v)". 4 5This package and its contained modules are subject to change and 6any direct use is at your own risk. 7""" 8from os.path import dirname 9 10# test_idle imports load_tests for test discovery (default all). 11# To run subsets of idlelib module tests, insert '[<chars>]' after '_'. 12# Example: insert '[ac]' for modules beginning with 'a' or 'c'. 13# Additional .discover/.addTest pairs with separate inserts work. 14# Example: pairs with 'c' and 'g' test c* files and grep. 15 16def load_tests(loader, standard_tests, pattern): 17 this_dir = dirname(__file__) 18 top_dir = dirname(dirname(this_dir)) 19 module_tests = loader.discover(start_dir=this_dir, 20 pattern='test_*.py', # Insert here. 21 top_level_dir=top_dir) 22 standard_tests.addTests(module_tests) 23## module_tests = loader.discover(start_dir=this_dir, 24## pattern='test_*.py', # Insert here. 25## top_level_dir=top_dir) 26## standard_tests.addTests(module_tests) 27 return standard_tests 28