zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
U
O±dv ã@srdZddlZddlZddlZejjjZejjjZGdd„dƒZ    Gdd„dƒZ
ej   ddd    d
g¡Gd d „d ƒƒZ dS) zQ
Tests of the ._exceptions module. Primarily for exercising the __str__ methods.
éNc@s,eZdZdd„Zdd„Zdd„Zdd„Zd    S)
ÚTestArrayMemoryErrorcCs6tdt tj¡ƒ}t t |¡¡}|j|jks2t‚dS)z, Test that _ArrayMemoryError can be pickled ©éÿN)    Ú_ArrayMemoryErrorÚnpÚdtypeÚuint8ÚpickleÚloadsÚdumpsÚ _total_sizeÚAssertionError)ÚselfÚerrorÚres©rúXd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/core/tests/test__exceptions.pyÚ test_picklingsz"TestArrayMemoryError.test_picklingcCstdt tj¡ƒ}t|ƒdS)Nr)rrrrÚstr©rÚerrrÚtest_strszTestArrayMemoryError.test_strcCsBtj}d}|dƒdkst‚|dƒdks*t‚|dƒdks:t‚||ƒdksJt‚||dƒdks^t‚|d    |ƒd
ksrt‚|td |ƒƒd ksŠt‚|td |ƒƒdks¢t‚|td|ƒƒdksºt‚|||ƒdksÎt‚|t|||dƒƒdksît‚|||||||ƒdkst‚|||||||dƒdks>t‚dS)z Test e._size_to_string érz0 byteséz1 bytesrz
1023 bytesz1.00 KiBé
z10.0 KiBg33333;@z999. KiBg33333û@z    1023. KiBgü@z1.00 MiBg§èH.ÿï?z1.00 GiBz1.00 EiBi@âz 123456. EiBN)rZ_size_to_stringr Úint)rÚfZKirrrÚtest__size_to_strings &z)TestArrayMemoryError.test__size_to_stringcCsHtdt tj¡ƒ}|jdks t‚tdt tjdf¡ƒ}|jdksDt‚dS)z Test e._total_size )rr)ééérN)rrrrr r Zuint64rrrrÚtest__total_size/sz%TestArrayMemoryError.test__total_sizeN)Ú__name__Ú
__module__Ú __qualname__rrrr!rrrrr src@seZdZdd„ZdS)ÚTestUFuncNoLoopErrorcCstt t¡tƒst‚dS)z, Test that _UFuncNoLoopError can be pickled N)Ú
isinstancer    r Ú_UFuncNoLoopErrorÚbytesr )rrrrr9sz"TestUFuncNoLoopError.test_picklingN)r"r#r$rrrrrr%8sr%Úargs)rrN)rrZ test_prefix)z test messagec@seZdZdd„Zdd„ZdS)Ú TestAxisErrorcCs^tj|Ž}t|ƒdkr4|jdks$t‚|jdksZt‚n&|^}}}|j|ksLt‚|j|ksZt‚dS)zValidate attribute types.rN)rÚ    AxisErrorÚlenÚaxisr Úndim)rr)Úexcr-r.Ú_rrrÚ    test_attrDs
 
zTestAxisError.test_attrcCs`tj|Ž}t t |¡¡}t|ƒt|ƒks.t‚dD](}t||ƒ}t||ƒ}||ks2t|ƒ‚q2dS)z%Test that `AxisError` can be pickled.)r-r.r)N)rr+r    r
r Útyper Úgetattr)rr)r/Zexc2ÚnameZattr1Zattr2rrrrOs
 
 
zTestAxisError.test_picklingN)r"r#r$r1rrrrrr*>s r*)Ú__doc__r    ZpytestÚnumpyrÚcoreÚ _exceptionsrr'rr%ÚmarkZ parametrizer*rrrrÚ<module>s
 
+ý