a
    
3j                     @   s   d dl Z d dlZd dlZd dlZd dlmZ ejej	ej	ej	ej	e
ZejedZejedZdddZe jdd Zd	d
 Zdd ZdS )    N)supportZToolsscriptsc                 C   s<   | rt jt| }nd} t}t j|s8t|  dd S )Nr   z directory could not be found)ospathjointoolsdir
scriptsdirisdirunittestZSkipTest)Ztooltooldir r   T/www/server/python_manager/versions/3.9.10/lib/python3.9/test/test_tools/__init__.pyskip_if_missing   s    r   c                 g   sJ   t jjt| g|R  }t|}|V  W d    n1 s<0    Y  d S N)r   r   r   r   r   DirsOnSysPath)namesubdirsr   cmr   r   r   imports_under_tool   s    r   c                 C   s8   t t t| W  d    S 1 s*0    Y  d S r   )r   r   r   	importlibimport_module)Ztoolnamer   r   r   import_tool    s    r   c                  G   s   t jtjtg| R  S r   )r   Zload_package_testsr   r   dirname__file__)argsr   r   r   
load_tests$   s    r   )N)
contextlibr   Zos.pathr   r
   testr   r   normpathr   r   Zbasepathr   r   r   r   contextmanagerr   r   r   r   r   r   r   <module>   s(   

	
