U .c@sldZddlZddlZddlZejejeZ ddZ e ddfddZ d dd Z e d krhejje dS) z Use this module to get and run all tk tests. tkinter tests should live in a package inside the directory where this file lives, like test_tkinter. Extensions also should live in packages following the same rule as above. NcCs"t|D]}|dkr dSq dS)N)z __init__.pyz __init__.pycTF)oslistdir)pathnamer)z#get_tests_modules..z.%s.%sz tkinter.test)rwalklistremoverlensepreplacefilter importlib import_moduletestsupportZResourceDenied) ZbasepathguipackagesdirpathZdirnames filenamesdirnameZpkg_namerrrrget_tests_moduless,    "   r!ccsXg}|r|d|r |dt||dD]&}|D]}t||dD] }|VqDq4q,dS)zYield all the tests in the modules found by get_tests_modules. If nogui is True, only tests that do not require a GUI will be returned.Z tests_noguiZ tests_gui)rrrN)appendr!getattr)textrrattrsmoduleattrrrrr get_tests5s  r(__main__)TTN)__doc__rrZ test.supportrrabspathr __file__Z this_dir_pathrr!r(__name__rZ run_unittestrrrrs