/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
numpy
/
core
/
tests
/
/usr/local/lib64/python3.6/site-packages/numpy/core/tests
mkdir
upload
Name
Size
Mode
Actions
data/
-
0755
rm
__pycache__/
-
0755
rm
test_abc.py
2328
0644
edit
dl
rm
test_api.py
20806
0644
edit
dl
rm
test_arrayprint.py
34493
0644
edit
dl
rm
test_conversion_utils.py
4981
0644
edit
dl
rm
test_cpu_features.py
6785
0644
edit
dl
rm
test_datetime.py
108192
0644
edit
dl
rm
test_defchararray.py
24381
0644
edit
dl
rm
test_deprecations.py
24187
0644
edit
dl
rm
test_dtype.py
49291
0644
edit
dl
rm
test_einsum.py
45197
0644
edit
dl
rm
test_errstate.py
2066
0644
edit
dl
rm
test_extint128.py
5643
0644
edit
dl
rm
test_function_base.py
13148
0644
edit
dl
rm
test_getlimits.py
4297
0644
edit
dl
rm
test_half.py
23102
0644
edit
dl
rm
test_indexerrors.py
5130
0644
edit
dl
rm
test_indexing.py
49260
0644
edit
dl
rm
test_item_selection.py
3579
0644
edit
dl
rm
test_longdouble.py
13041
0644
edit
dl
rm
test_machar.py
1066
0644
edit
dl
rm
test_memmap.py
7464
0644
edit
dl
rm
test_mem_overlap.py
28855
0644
edit
dl
rm
test_multiarray.py
319797
0644
edit
dl
rm
test_nditer.py
112298
0644
edit
dl
rm
test_numeric.py
124118
0644
edit
dl
rm
test_numerictypes.py
20846
0644
edit
dl
rm
test_overrides.py
14433
0644
edit
dl
rm
test_print.py
6737
0644
edit
dl
rm
test_protocols.py
1168
0644
edit
dl
rm
test_records.py
19694
0644
edit
dl
rm
test_regression.py
88840
0644
edit
dl
rm
test_scalarbuffer.py
4065
0644
edit
dl
rm
test_scalarinherit.py
2127
0644
edit
dl
rm
test_scalarmath.py
28565
0644
edit
dl
rm
test_scalarprint.py
15158
0644
edit
dl
rm
test_scalar_ctors.py
2580
0644
edit
dl
rm
test_scalar_methods.py
4063
0644
edit
dl
rm
test_shape_base.py
24679
0644
edit
dl
rm
test_ufunc.py
83978
0644
edit
dl
rm
test_umath.py
121442
0644
edit
dl
rm
test_umath_accuracy.py
3044
0644
edit
dl
rm
test_umath_complex.py
23145
0644
edit
dl
rm
test_unicode.py
12553
0644
edit
dl
rm
test__exceptions.py
2005
0644
edit
dl
rm
_locales.py
2192
0644
edit
dl
rm
__init__.py
0
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/numpy/core/tests/test_scalarinherit.py
(2127B)
# -*- coding: utf-8 -*- """ Test printing of scalar types. """ import pytest import numpy as np from numpy.testing import assert_ class A: pass class B(A, np.float64): pass class C(B): pass class D(C, B): pass class B0(np.float64, A): pass class C0(B0): pass class HasNew: def __new__(cls, *args, **kwargs): return cls, args, kwargs class B1(np.float64, HasNew): pass class TestInherit: def test_init(self): x = B(1.0) assert_(str(x) == '1.0') y = C(2.0) assert_(str(y) == '2.0') z = D(3.0) assert_(str(z) == '3.0') def test_init2(self): x = B0(1.0) assert_(str(x) == '1.0') y = C0(2.0) assert_(str(y) == '2.0') def test_gh_15395(self): # HasNew is the second base, so `np.float64` should have priority x = B1(1.0) assert_(str(x) == '1.0') # previously caused RecursionError!? with pytest.raises(TypeError): B1(1.0, 2.0) class TestCharacter: def test_char_radd(self): # GH issue 9620, reached gentype_add and raise TypeError np_s = np.string_('abc') np_u = np.unicode_('abc') s = b'def' u = u'def' assert_(np_s.__radd__(np_s) is NotImplemented) assert_(np_s.__radd__(np_u) is NotImplemented) assert_(np_s.__radd__(s) is NotImplemented) assert_(np_s.__radd__(u) is NotImplemented) assert_(np_u.__radd__(np_s) is NotImplemented) assert_(np_u.__radd__(np_u) is NotImplemented) assert_(np_u.__radd__(s) is NotImplemented) assert_(np_u.__radd__(u) is NotImplemented) assert_(s + np_s == b'defabc') assert_(u + np_u == u'defabc') class Mystr(str, np.generic): # would segfault pass ret = s + Mystr('abc') assert_(type(ret) is type(s)) def test_char_repeat(self): np_s = np.string_('abc') np_u = np.unicode_('abc') res_s = b'abc' * 5 res_u = u'abc' * 5 assert_(np_s * 5 == res_s) assert_(np_u * 5 == res_u)
Save
cmd:
run