a
    hÝEbÄ  ã                   @   sd   d dl mZmZmZmZ d dlmZ d dlZd dlZd dl	Z	d dl
mZ dd„ Zdd„ Zd	d
„ ZdS )é    )Úassert_raisesÚassert_warnsÚassert_Úassert_equal)ÚpickleN)Úreloadc                  C   sè   dd l } dd l}| j}| j}| j}ttƒ� t| ƒ W d   ƒ n1 sH0    Y  t|| ju ƒ t|| ju ƒ t|| ju ƒ t	t
t|jƒ ttƒ� t| ƒ W d   ƒ n1 s°0    Y  t|| ju ƒ t|| ju ƒ t|| ju ƒ d S )Nr   )ÚnumpyZnumpy._globalsÚ_NoValueÚVisibleDeprecationWarningÚModuleDeprecationWarningr   ÚUserWarningr   r   r   ÚRuntimeErrorZ_globals)Únpr   r	   r
   r   © r   úZ/home/ja/django-apps/lartica_env/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   Úranger   ÚHIGHEST_PROTOCOLr   Úreprr	   r   ÚloadsÚdumps)r   Úprotor   r   r   Útest_novalue    s    ÿÿr   c                  C   sF   t  d¡} tjtjd| gdd�}|jrBtd|j›d|j 	¡ › �ƒ‚dS )z²At 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_reimport(   s    
ÿr)   )Znumpy.testingr   r   r   r   Znumpy.compatr   r!   r   r   Ú	importlibr   r   r   r)   r   r   r   r   Ú<module>   s   