zfc@sdZddlZddlZddlZddlZddlZejjejj e Z dZ e e ddZe e ddZedkrejjendS(s 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. iNcCs.x'tj|D]}|dkrtSqWtS(Ns __init__.pys __init__.pycs __init.pyo(s __init__.pys __init__.pycs __init.pyo(tostlistdirtTruetFalse(tpathtname((s./usr/lib64/python2.7/lib-tk/test/runtktests.pyt is_packages c #s-dx tj|D]\}}}x4t|D]&}|ddkr2|j|q2q2Wt|r|r|t|ttjjdd}|r||krqntfd|}x[|D]P}y$t j d|t |VWqt j j k r|rqqXqWqqWdS(sThis will import and yield modules whose names start with test_ and are inside packages found in the path starting at basepath. If packages is specified it should contain package names that want their tests collected. s.pyit.t/cs|jdo|jS(Nttest_(t startswithtendswith(tx(tpy_ext(s./usr/lib64/python2.7/lib-tk/test/runtktests.pyt+ts.%sN(RtwalktlisttremoveRtlentseptreplacetfiltert importlibt import_modulettestt test_supporttResourceDenied( tbasepathtguitpackagestdirpathtdirnamest filenamestdirnametpkg_nameR((R s./usr/lib64/python2.7/lib-tk/test/runtktests.pytget_tests_moduless&)   ccsg}|r|jdn|r2|jdnxPtd|d|D]9}x0|D](}xt||dD] }|VqnWqUWqHWdS(sYield 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.t tests_noguit tests_guiRRN((tappendR$tgetattr(ttextRRtattrstmoduletattrR((s./usr/lib64/python2.7/lib-tk/test/runtktests.pyt get_tests6s t__main__(t__doc__RtsystunittestRttest.test_supportRRtabspathR"t__file__t this_dir_pathRRtNoneR$R-t__name__Rt run_unittest(((s./usr/lib64/python2.7/lib-tk/test/runtktests.pyts