o
    h                     @   s   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	 d dl
mZ d dlmZ dd Zdd Zd	d
 Zejddddd ZdS )    N)get_fpu_mode)FPUModeChangeWarning)_pep440c                 C   sT   |  dd |  dd |  dd zdd l}W d S  ty)   |  dd Y d S w )Nmarkerszslow: Tests that are very slow.zHxslow: mark test as extremely slow (not run unless explicitly requested)z8xfail_on_32bit: mark test as failing on 32-bit platformsr   z.timeout: mark a test for a non-default timeout)addinivalue_linepytest_timeout	Exception)configr    r
   I/var/www/html/scripts/venv/lib/python3.10/site-packages/scipy/conftest.pypytest_configure   s    
r   c                 C   s2   t tjt dkr| |}|S | |}|S )Nz3.6.0)r   parsepytest__version__Versionget_closest_marker
get_marker)itemnamemarkr
   r
   r   	_get_mark   s
   

r   c           	   	   C   s  t | d}|d ur'zttjdd}W n ty   d}Y nw |s'td t | d}|d urCt	dj
dk rCtd	|jd   t |}|tj z
dd
lm} d}W n tyc   d}Y nw |rz	ttjd }W n ty   Y W d    d S w tdst d }t|| d}z||dd W n  ty   Y W d    d S w W d    d S W d    d S W d    d S 1 sw   Y  d S )NxslowSCIPY_XSLOW0Fz@very slow test; set environment variable SCIPY_XSLOW=1 to run itxfail_on_32bitr      z&Fails on our 32-bit test platform(s): )threadpool_limitsTPYTEST_XDIST_WORKER_COUNTOMP_NUM_THREADS      blas)user_api)r   intosenvironget
ValueErrorr   skipnpintpitemsizexfailargsnptsuppress_warningsfilter PytestUnraisableExceptionWarningthreadpoolctlr   r   KeyErrorgetenv	cpu_countmax)	r   r   vsupr   HAS_THREADPOOLCTLxdist_worker_countmax_openmp_threadsthreads_per_workerr
   r
   r   pytest_runtest_setup#   sT   




"r=   functionT)scopeautousec                 c   s<    t  }dV  t  }||krtjd||tdd dS dS )z9
    Check FPU mode was not changed during the test.
    Nz4FPU mode changed from {:#x} to {:#x} during the testr   )category
stacklevel)r   warningswarnformatr   )requestold_modenew_moder
   r
   r   check_fpu_modeS   s   
rI   )r$   r   rC   numpyr)   numpy.testingtestingr.   scipy._lib._fpumoder   scipy._lib._testutilsr   
scipy._libr   r   r   r=   fixturerI   r
   r
   r
   r   <module>   s   0