a
    h6                     @   sD  d Z ddlZddlZddlZddlZddlmZ ddlmZm	Z	 zddl
Z
W n eyb   dZ
Y n0 eedZedoe  ZzddlZdd ZW n ey   d	d ZdZY n0 z dd
lmZ dd Zdd ZW n" ey   dd Zd ZZY n0 e	edu ddZe	ejd ddZe	e
du ddZe	e
duddZdS )z
Small utilities for testing.
    N)mp)SkipTestskipifpypy_version_infoPy_GIL_DISABLEDc                 C   s   | S )*A decorator to skip tests requiring numpy. funcr   r   N/var/www/html/assistant/venv/lib/python3.9/site-packages/joblib/test/common.py
with_numpy   s    r   c                 C   s   dd }|S )r   c                   S   s   t dd S )NzTest requires numpyr   r   r   r   r   my_func%   s    zwith_numpy.<locals>.my_funcr   )r
   r   r   r   r   r   "   s    )memory_usagec                 C   s   | S )4A decorator to skip tests requiring memory_profiler.r   r	   r   r   r   with_memory_profiler3   s    r   c                 O   s*   t   t| ||fdd}t|t| S )z)Compute memory usage when executing func.gMbP?)interval)gcZcollectr   maxmin)r
   argskwargsZmem_user   r   r   memory_used7   s    r   c                 C   s   dd }|S )r   c                   S   s   t dd S )NzTest requires memory_profiler.r   r   r   r   r   
dummy_funcB   s    z(with_memory_profiler.<locals>.dummy_funcr   )r
   r   r   r   r   r   ?   s    zNeeds multiprocessing to run.)reasonz/dev/shmz5This test requires a large /dev/shm shared memory fs.zNeeds lz4 compression to runz$Needs lz4 not being installed to run)__doc__r   ossys	sysconfigZjoblib._multiprocessing_helpersr   Zjoblib.testingr   r   Zlz4ImportErrorhasattrZIS_PYPYget_config_varZ_is_gil_enabledZIS_GIL_DISABLEDnumpynpr   Zmemory_profilerr   r   r   Zwith_multiprocessingpathexistsZwith_dev_shmZwith_lz4Zwithout_lz4r   r   r   r   <module>   sB   


