a
    Lf?	                     @   s   d dl Z d dlZd dlZd dlmZ d dlZd dlZd dlmZ	 d dl
mZmZmZmZmZ dd Zdd Zejjedd	d
d ZdS )    N)reload)assert_raisesassert_warnsassert_assert_equalIS_WASMc                  C   s   dd l } dd l}| j}tj}tj}tt t|  W d    n1 sH0    Y  t	|| ju  t	|tju  t	|tju  t
tt|j tt t|  W d    n1 s0    Y  t	|| ju  t	|tju  t	|tju  d S )Nr   )numpyZnumpy._globals_NoValueexVisibleDeprecationWarningModuleDeprecationWarningr   UserWarningr   r   r   RuntimeErrorZ_globals)npr   r	   r   r    r   S/var/www/ai-form-bot/venv/lib/python3.9/site-packages/numpy/tests/test_reloading.pytest_numpy_reloading   s     
&
&r   c                  C   sR   dd l } tdtjd D ]4}tt| jd tttj	| j|d| ju  qd S )Nr         z
<no value>)protocol)
r   rangepickleHIGHEST_PROTOCOLr   reprr	   r   loadsdumps)r   protor   r   r   test_novalue)   s    r   zcan't start subprocess)reasonc                  C   sF   t d} tjtjd| gdd}|jrBtd|jd|j	  dS )zAt the time of writing this, it is *not* truly supported, but
    apparently enough users rely on it, for it to be an annoying change
    when it started failing previously.
    a  
        import sys
        from pytest import warns
        import numpy as np

        for k in list(sys.modules.keys()):
            if "numpy" in k:
                del sys.modules[k]

        with warns(UserWarning):
            import numpy as np
        z-cT)capture_outputzNon-zero return code: z

N)
textwrapdedent
subprocessrunsys
executable
returncodeAssertionErrorstderrdecode)codepr   r   r   test_full_reimport1   s    	
r,   )r$   r"   r    	importlibr   r   ZpytestZnumpy.exceptions
exceptionsr
   Znumpy.testingr   r   r   r   r   r   r   markZskipifr,   r   r   r   r   <module>   s   	