idlelib idletest implements test testidle which tests the idle application as part of the stdlib test suite run idle tests alone with python m test testidle v this package and its contained modules are subject to change and any direct use is at your own risk testidle imports loadtests for test discovery default all to run subsets of idlelib module tests insert chars after example insert ac for modules beginning with a or c additional discover addtest pairs with separate inserts work example pairs with c and g test c files and grep moduletests loader discoverstartdirthisdir pattern test py insert here topleveldirtopdir standardtests addtestsmoduletests test_idle imports load_tests for test discovery default all to run subsets of idlelib module tests insert chars after _ example insert ac for modules beginning with a or c additional discover addtest pairs with separate inserts work example pairs with c and g test c files and grep insert here module_tests loader discover start_dir this_dir pattern test_ py insert here top_level_dir top_dir standard_tests addtests module_tests
from os.path import dirname


def load_tests(loader, standard_tests, pattern):
    this_dir = dirname(__file__)
    top_dir = dirname(dirname(this_dir))
    module_tests = loader.discover(start_dir=this_dir,
                                    pattern='test_*.py',  
                                    top_level_dir=top_dir)
    standard_tests.addTests(module_tests)




    return standard_tests