B (y\@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$xt|D]}|dkr dSq WdS)N)z __init__.pyz __init__.pycTF)oslistdir)pathnamer)z#get_tests_modules..z.%s.%sz tkinter.test)rwalklistremoverlensepreplacefilter importlib import_moduletestsupportZResourceDenied) ZbasepathguipackagesdirpathZdirnames filenamesdirnameZpkg_namerr)rrget_tests_moduless(  "    r!ccsdg}|r|d|r |dx>t||dD].}x(|D] }xt||dD] }|VqJWq8Wq.WdS)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)textrrZattrsmoduleattrrrrr get_tests5s   r'__main__)TTN)__doc__rrZ test.supportrrabspathr __file__Z this_dir_pathrr!r'__name__rZ run_unittestrrrrs