HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/numpy/tests/__pycache__/test_reloading.cpython-310.pyc
o

���g2	�@s�ddlmZmZmZmZmZddlmZddlZddl	Z	ddl
Z
ddlZddlm
Z
dd�Zdd�Zejjed	d
�dd��ZdS)
�)�
assert_raises�assert_warns�assert_�assert_equal�IS_WASM)�pickleN)�reloadcCs�ddl}ddl}|j}|j}|j}tt��t|�Wd�n1s$wYt||ju�t||ju�t||ju�t	t
t|j�tt��t|�Wd�n1sXwYt||ju�t||ju�t||ju�dS)Nr)�numpy�numpy._globals�_NoValue�VisibleDeprecationWarning�ModuleDeprecationWarningr�UserWarningrrr�RuntimeError�_globals)�npr	rrr
�r�E/usr/local/lib/python3.10/dist-packages/numpy/tests/test_reloading.py�test_numpy_reloadings$

�

�rcCsRddl}tdtjd�D]}tt|j�d�tt�tj	|j|d��|ju�qdS)Nr��z
<no value>)�protocol)
r	�ranger�HIGHEST_PROTOCOLr�reprrr�loads�dumps)r�protorrr�test_novalue's���rzcan't start subprocess)�reasoncCsFt�d�}tjtjd|gdd�}|jr!td|j�d|j�	�����dS)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_outputzNon-zero return code: z

N)
�textwrap�dedent�
subprocess�run�sys�
executable�
returncode�AssertionError�stderr�decode)�code�prrr�test_full_reimport/s
	��r-)�
numpy.testingrrrrr�numpy.compatr�pytestr%r#r!�	importlibrrr�mark�skipifr-rrrr�<module>s