a  ze @sdZddlZddlZddlZddlZddlmZej ej ej ej ej e Z ej e dZej edZdddZejdd Zd d Zd d ZdS)z=Support functions for testing scripts in the Tools directory.N)supportZToolsscriptscCs<|rtjt|}nd}t}tj|s8t|ddS)Nrz directory could not be found)ospathjointoolsdir scriptsdirisdirunittestZSkipTest)Ztooltooldirr L/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_tools/__init__.pyskip_if_missings  rcgsJtjjt|g|R}t|}|VWdn1s<0YdSN)rrrrr DirsOnSysPath)namesubdirsr cmr r r imports_under_tools rcCs8ttt|WdS1s*0YdSr)rrr importlib import_module)Ztoolnamer r r import_tool s rcGstjtjtg|RSr)rZload_package_testsrrdirname__file__)argsr r r load_tests$sr)N)__doc__ contextlibrZos.pathrr testrrnormpathrrZbasepathrrrrcontextmanagerrrrr r r r s*