B
    ‰°b/  ã               @   s2   d Z ddlZddd„Zd	dd„Zedkr.eƒ  dS )
z4Common utility functions for various Bio submodules.é    Nc             C   s’   | sd} t j | ¡}xdt j t j |d¡¡rXt j t j |d¡¡rXt j t j |d¡¡S t j |¡\}}||krrP |}qW tdt j | ¡ ƒ‚dS )a   Find the absolute path of Biopython's Tests directory.

    Arguments:
    start_dir -- Initial directory to begin lookup (default to current dir)

    If the directory is not found up the filesystem's root directory, an
    exception will be raised.

    Ú.ZBioZTestsz$Not within Biopython source tree: %rN)ÚosÚpathÚabspathÚisdirÚjoinÚsplitÚ
ValueError)Z	start_dirÚtargetÚnewZtmp© r   ú)lib/python3.7/site-packages/Bio/_utils.pyÚfind_test_dir   s    
r   c          	   O   sj   ddl }d|ji}| |¡ tj tj¡}tdƒ zt t	| ƒ¡ |j
||Ž W dt |¡ X tdƒ dS )z%Run doctest for the importing module.r   NZoptionflagszRunning doctests...ZDone)ÚdoctestÚELLIPSISÚupdater   r   r   ÚcurdirÚprintÚchdirr   Ztestmod)Z
target_dirÚargsÚkwargsr   Zdefault_kwargsZcur_dirr   r   r   Úrun_doctest1   s    

r   Ú__main__)N)N)Ú__doc__r   r   r   Ú__name__r   r   r   r   Ú<module>   s
   
#
