
    HWh 	                     l   S r SSKrSSKrSSKrSSKJr  SSKJrJr   SSK	r	\" \S5      r SSKrS r SSKJr  S	 rS
 rS r\" \SL SS9r\" \R,                  R/                  S5      (       + SS9r\" \	SL SS9r\" \	SLSS9rg! \
 a    Sr	 Nlf = f! \
 a    S rSr Nlf = f! \
 a
    S rS=rr Nrf = f)z
Small utilities for testing.
    N)mp)SkipTestskipifpypy_version_infoc                     U $ )*A decorator to skip tests requiring numpy. funcs    4/usr/lib/python3/dist-packages/joblib/test/common.py
with_numpyr              c                     S nU$ )r   c                      [        S5      e)NzTest requires numpyr   r	   r   r   my_funcwith_numpy.<locals>.my_func   s    011r   r	   )r   r   s     r   r   r      s    	2r   )memory_usagec                     U $ )4A decorator to skip tests requiring memory_profiler.r	   r
   s    r   with_memory_profilerr   )   r   r   c                 r    [         R                  " 5         [        XU4SS9n[        U5      [	        U5      -
  $ )z)Compute memory usage when executing func.gMbP?)interval)gccollectr   maxmin)r   argskwargsmem_uses       r   memory_usedr"   -   s/    


F3dC7|c'l**r   c                     S nU$ )r   c                      [        S5      e)NzTest requires memory_profiler.r   r	   r   r   
dummy_func(with_memory_profiler.<locals>.dummy_func6   s    ;<<r   r	   )r   r%   s     r   r   r   4   s    	=r   c                  h    [         (       a'  SS Kn U R                  " 5         U R                  " 5         g g )Nr   )IS_PYPYr   r   )r   s    r   force_gc_pypyr)   =   s%     w 	





 r   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__osr   sysjoblib._multiprocessing_helpersr   joblib.testingr   r   lz4ImportErrorhasattrr(   numpynpr   memory_profilerr   r   r"   r)   with_multiprocessingpathexistswith_dev_shmwith_lz4without_lz4r	   r   r   <module>r<      s   
 	 
 . + #*
+ &,+ 	 $J68  
z""BD #+&DEtOBDM  
C  
 
B2  & "&%L;&s3   B B B# BBB B #B32B3