3
���h� � @ s` d dl mZmZmZ d dlmZ d dlZd dlZd dlZd dl m
Z
dd� Zdd� Zd d
� Z
dS )� )�
assert_raises�assert_�assert_equal)�pickleN)�reloadc C s� dd l } dd l}| j}| j}| j}t| � t|| jk� t|| jk� t|| jk� ttt|j � t| � t|| jk� t|| jk� t|| jk� d S )Nr )
�numpyZnumpy._globals�_NoValue�VisibleDeprecationWarning�ModuleDeprecationWarningr r r �RuntimeErrorZ_globals)�npr r r r
� r
�;/tmp/pip-build-5_djhm0z/numpy/numpy/tests/test_reloading.py�test_numpy_reloading
s r c C sV dd l } xHtdtjd �D ]4}tt| j�d� ttjtj | j|d��| jk� qW 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 s. t jd�} tjtjd| g�}|jdks*t�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.
z�
import sys
import numpy as np
for k in list(sys.modules.keys()):
if "numpy" in k:
del sys.modules[k]
import numpy as np
z-cr N)�textwrap�dedent�
subprocess�run�sys�
executable�
returncode�AssertionError)�code�pr
r
r �test_full_reimport& |