o
    i                     @   sX   d dl Z d dlmZ ejddd ed dd Zdd	 Zd
d Ze  dd Z	dS )    N)settingsno_deadlinesi )deadlinec                 C   sf   z(dd l }|jd}|D ]}z
|jj|d W q   td|  Y qW d S  ty2   Y d S w )Nr   GPUTz-failed to enable Tensorflow memory growth on )
tensorflowconfiglist_physical_devicesexperimentalset_memory_growthprintImportError)sessiontfphysical_devicesdevice r   H/home/ubuntu/.local/lib/python3.10/site-packages/thinc/tests/conftest.pypytest_sessionstart
   s   r   c                 C   s,   z| j dddd W d S  ty   Y d S w )Nz--slow
store_truezinclude slow tests)actionhelp)	addoption
ValueError)parserr   r   r   pytest_addoption   s
   r   c                    s>    fdd}dD ]}| j v r||std| d qd S )Nc                    s    j d|  dS )Nz--F)r   	getoption)optitemr   r   getopt&   s   z$pytest_runtest_setup.<locals>.getopt)slowzneed --z option to run)keywordspytestskip)r   r   r   r   r   r   pytest_runtest_setup%   s   	r$   c                  c   sp    t d dd l} dd l}ddlm}m} |jdd}|| |d}|jdd |V  |d	 | 	| d S )
Npathyr   )Pathyuse_fszthinc-pathy)prefixzgs://test-bucketT)exist_okF)
r"   importorskipshutiltempfiler%   r&   r'   mkdtempmkdirrmtree)r+   r,   r&   r'   temp_folderrootr   r   r   pathy_fixture4   s   
r2   )
r"   
hypothesisr   register_profileload_profiler   r   r$   fixturer2   r   r   r   r   <module>   s    
	