17db96d56Sopenharmony_ci"""idlelib.idle_test implements test.test_idle, which tests the IDLE 27db96d56Sopenharmony_ciapplication as part of the stdlib test suite. 37db96d56Sopenharmony_ciRun IDLE tests alone with "python -m test.test_idle (-v)". 47db96d56Sopenharmony_ci 57db96d56Sopenharmony_ciThis package and its contained modules are subject to change and 67db96d56Sopenharmony_ciany direct use is at your own risk. 77db96d56Sopenharmony_ci""" 87db96d56Sopenharmony_cifrom os.path import dirname 97db96d56Sopenharmony_ci 107db96d56Sopenharmony_ci# test_idle imports load_tests for test discovery (default all). 117db96d56Sopenharmony_ci# To run subsets of idlelib module tests, insert '[<chars>]' after '_'. 127db96d56Sopenharmony_ci# Example: insert '[ac]' for modules beginning with 'a' or 'c'. 137db96d56Sopenharmony_ci# Additional .discover/.addTest pairs with separate inserts work. 147db96d56Sopenharmony_ci# Example: pairs with 'c' and 'g' test c* files and grep. 157db96d56Sopenharmony_ci 167db96d56Sopenharmony_cidef load_tests(loader, standard_tests, pattern): 177db96d56Sopenharmony_ci this_dir = dirname(__file__) 187db96d56Sopenharmony_ci top_dir = dirname(dirname(this_dir)) 197db96d56Sopenharmony_ci module_tests = loader.discover(start_dir=this_dir, 207db96d56Sopenharmony_ci pattern='test_*.py', # Insert here. 217db96d56Sopenharmony_ci top_level_dir=top_dir) 227db96d56Sopenharmony_ci standard_tests.addTests(module_tests) 237db96d56Sopenharmony_ci## module_tests = loader.discover(start_dir=this_dir, 247db96d56Sopenharmony_ci## pattern='test_*.py', # Insert here. 257db96d56Sopenharmony_ci## top_level_dir=top_dir) 267db96d56Sopenharmony_ci## standard_tests.addTests(module_tests) 277db96d56Sopenharmony_ci return standard_tests 28