zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
U
P±dz    ã@s€ddlmZmZmZmZmZddlmZddlZddl    Z    ddl
Z
ddl Z ddl m Z dd„Zdd„Zejjed    d
d d „ƒZdS) é)Ú assert_raisesÚ assert_warnsÚassert_Ú assert_equalÚIS_WASM)ÚpickleN)Úreloadc    CsÀddl}ddl}|j}|j}|j}ttƒt|ƒW5QRXt||jkƒt||jkƒt||jkƒt    t
t|j ƒttƒt|ƒW5QRXt||jkƒt||jkƒt||jkƒdS)Nr) ÚnumpyZnumpy._globalsÚ_NoValueÚVisibleDeprecationWarningÚModuleDeprecationWarningrÚ UserWarningrrrÚ RuntimeErrorZ_globals)Únpr    r
r r ©rúQd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/tests/test_reloading.pyÚtest_numpy_reloadings 
 
rcCsRddl}tdtjdƒD]4}tt|jƒdƒtt tj    |j|d¡|jkƒqdS)Nrééz
<no value>)Úprotocol)
r    ÚrangerÚHIGHEST_PROTOCOLrÚreprr
rÚloadsÚdumps)rÚprotorrrÚ test_novalue'sÿÿrzcan't start subprocess)ÚreasoncCsFt 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)Úcapture_outputzNon-zero return code: z
 
N)
ÚtextwrapÚdedentÚ
subprocessÚrunÚsysÚ
executableÚ
returncodeÚAssertionErrorÚstderrÚdecode)ÚcodeÚprrrÚtest_full_reimport/s     
ÿr+)Z numpy.testingrrrrrZ numpy.compatrZpytestr#r!rÚ    importlibrrrÚmarkZskipifr+rrrrÚ<module>s