%PDF- %PDF-
| Direktori : /lib64/python3.9/site-packages/numpy/tests/__pycache__/ |
| Current File : //lib64/python3.9/site-packages/numpy/tests/__pycache__/test_reloading.cpython-39.pyc |
a
z[yc� � @ sd d dl mZmZmZmZ d dlmZ d dlZd dlZd dl Z d dl
mZ dd� Zdd� Z
d d
� ZdS )� )�
assert_raises�assert_warns�assert_�assert_equal)�pickleN)�reloadc C s� dd l } dd l}| j}| j}| j}tt�� t| � W d � n1 sH0 Y t|| ju � t|| ju � t|| ju � t t
t|j� tt�� t| � W d � n1 s�0 Y t|| ju � t|| ju � t|| ju � d S )Nr )�numpyZnumpy._globals�_NoValue�VisibleDeprecationWarning�ModuleDeprecationWarningr �UserWarningr r r �RuntimeErrorZ_globals)�npr r r
r � r �@/usr/lib64/python3.9/site-packages/numpy/tests/test_reloading.py�test_numpy_reloading
s
&
&r c C sR dd l } tdtjd �D ]4}tt| j�d� tt�tj | j|d��| ju � qd S )Nr � � z
<no value>)Zprotocol)
r �ranger ZHIGHEST_PROTOCOLr �reprr r �loads�dumps)r �protor r r �test_novalue s ��r c C sF t �d�} tjtjd| gdd�}|jrBtd|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)Zcapture_outputzNon-zero return code: z
N)
�textwrap�dedent�
subprocess�run�sys�
executable�
returncode�AssertionError�stderr�decode)�code�pr r r �test_full_reimport( s
�r&