3
Y]x                 @   s   d Z ddlmZmZmZ ddlZddlZddlmZ da	i Z
dd Zej dd Zejd	d
ddd Zejd
ddd ZdS )z=
Pytest configuration and fixtures for the Numpy test suite.
    )divisionabsolute_importprint_functionN)get_fpu_modec             C   s   | j dd | j dd d S )NZmarkersz=valgrind_error: Tests that are known to error under valgrind.zslow: Tests that are very slow.)Zaddinivalue_line)config r   -lib/python3.6/site-packages/numpy/conftest.pypytest_configure   s    r	   c             C   s0   t  }tdkr|an|tkr,t|ft| < |adS )z
    Check FPU precision mode was not changed during test collection.

    The clumsy way we do it here is mainly necessary because numpy
    still uses yield tests, which can execute code at test collection
    time.
    N)r   _old_fpu_mode_collect_results)itemmoder   r   r   pytest_itemcollected   s    r   ZfunctionT)Zscopeautousec             c   sZ   t  }dV  t  }||kr*tdj||tj| j}|dk	rV|\}}tdj||dS )zC
    Check FPU precision mode was not changed during the test.
    Nz@FPU precision mode changed from {0:#x} to {1:#x} during the testzIFPU precision mode changed from {0:#x} to {1:#x} when collecting the test)r   AssertionErrorformatr   getZnode)ZrequestZold_modeZnew_modeZcollect_resultr   r   r   check_fpu_mode,   s    
r   )r   c             C   s   t | d< d S )NZnp)numpy)Zdoctest_namespacer   r   r   add_npA   s    r   )__doc__Z
__future__r   r   r   Zpytestr   Znumpy.core._multiarray_testsr   r
   r   r	   Zhookimplr   Zfixturer   r   r   r   r   r   <module>   s   