o
    1ήc                     @   sZ   d dl Z d dlZd dlZd dlmZmZ edZedu rdne	dZ
G dd dZdS )    N)assert_assert_raisesHOST_GNU_TYPEFgnueabic                   @   sL   e Zd Zejjedddd Zejjedddd Zdd	 Z	d
d Z
dS )TestErrstatez+platform/cpu issue with FPU (gh-413,-15562))reasonc              	   C   s   t jdddK t d }t jdd t | W d    n1 s$w   Y  tt t | W d    n1 s=w   Y  W d    d S W d    d S 1 sUw   Y  d S )Nraiseignoreallunder   )invalid)nperrstatearangesqrtr   FloatingPointErrorselfa r   E/tmp/pip-target-vg8gfxp4/lib/python/numpy/core/tests/test_errstate.pytest_invalid   s   
"zTestErrstate.test_invalidz&platform/cpu issue with FPU (gh-15562)c              	   C   s   t jddda t d }t jdd |d  W d    n1 s#w   Y  tt |d  W d    n1 s;w   Y  tt ||  W d    n1 sSw   Y  W d    d S W d    d S 1 skw   Y  d S )Nr   r	   r
   r   )divider   )r   r   r   r   r   r   r   r   r   test_divide   s   




	"zTestErrstate.test_dividec              	   C   s   dd }t  }t j|d0 tt  |u d t jd d tt  d u d W d    n1 s2w   Y  W d    n1 sAw   Y  tt  |u d d S )Nc                  W   s   t |  d S )N)print)argsr   r   r   foo+   s   z&TestErrstate.test_errcall.<locals>.foo)callzcall is not foozcall is not Nonezcall is not olderrcall)r   
geterrcallr   r   )r   r   
olderrcallr   r   r   test_errcall*   s   zTestErrstate.test_errcallc                 C   s   t jdddd }|  d S )Nr	   )r   c                  S   s   t d } | d  d S )Nr   r   )r   r   )r   r   r   r   r   6   s   z1TestErrstate.test_errstate_decorator.<locals>.foo)r   r   )r   r   r   r   r   test_errstate_decorator5   s   


z$TestErrstate.test_errstate_decoratorN)__name__
__module____qualname__pytestmarkskipifarm_softfloatr   r   r"   r#   r   r   r   r   r      s    


r   )r'   	sysconfignumpyr   numpy.testingr   r   get_config_varhosttypeendswithr*   r   r   r   r   r   <module>   s    
