/
opt
/
alt
/
python37
/
lib64
/
python3.7
/
site-packages
/
numpy
/
core
/
tests
/
/opt/alt/python37/lib64/python3.7/site-packages/numpy/core/tests
mkdir
upload
Name
Size
Mode
Actions
data/
-
0755
rm
__pycache__/
-
0755
rm
test_abc.py
2014
0644
edit
dl
rm
test_api.py
18906
0644
edit
dl
rm
test_arrayprint.py
10215
0644
edit
dl
rm
test_datetime.py
92527
0644
edit
dl
rm
test_defchararray.py
25764
0644
edit
dl
rm
test_deprecations.py
18802
0644
edit
dl
rm
test_dtype.py
26202
0644
edit
dl
rm
test_einsum.py
39598
0644
edit
dl
rm
test_errstate.py
1588
0644
edit
dl
rm
test_extint128.py
5774
0644
edit
dl
rm
test_function_base.py
11429
0644
edit
dl
rm
test_getlimits.py
4613
0644
edit
dl
rm
test_half.py
18648
0644
edit
dl
rm
test_indexerrors.py
4938
0644
edit
dl
rm
test_indexing.py
47966
0644
edit
dl
rm
test_item_selection.py
3665
0644
edit
dl
rm
test_longdouble.py
5967
0644
edit
dl
rm
test_machar.py
1014
0644
edit
dl
rm
test_memmap.py
7075
0644
edit
dl
rm
test_mem_overlap.py
29564
0644
edit
dl
rm
test_multiarray.py
260805
0644
edit
dl
rm
test_nditer.py
108283
0644
edit
dl
rm
test_numeric.py
100854
0644
edit
dl
rm
test_numerictypes.py
14610
0644
edit
dl
rm
test_print.py
8089
0644
edit
dl
rm
test_records.py
15635
0644
edit
dl
rm
test_regression.py
81211
0644
edit
dl
rm
test_scalarinherit.py
771
0644
edit
dl
rm
test_scalarmath.py
25033
0644
edit
dl
rm
test_scalarprint.py
917
0644
edit
dl
rm
test_shape_base.py
18544
0644
edit
dl
rm
test_ufunc.py
54985
0644
edit
dl
rm
test_umath.py
98785
0644
edit
dl
rm
test_umath_complex.py
19800
0644
edit
dl
rm
test_unicode.py
14238
0644
edit
dl
rm
Edit:
/opt/alt/python37/lib64/python3.7/site-packages/numpy/core/tests/test_errstate.py
(1588B)
from __future__ import division, absolute_import, print_function import platform import numpy as np from numpy.testing import TestCase, assert_, run_module_suite, dec class TestErrstate(TestCase): @dec.skipif(platform.machine() == "armv5tel", "See gh-413.") def test_invalid(self): with np.errstate(all='raise', under='ignore'): a = -np.arange(3) # This should work with np.errstate(invalid='ignore'): np.sqrt(a) # While this should fail! try: np.sqrt(a) except FloatingPointError: pass else: self.fail("Did not raise an invalid error") def test_divide(self): with np.errstate(all='raise', under='ignore'): a = -np.arange(3) # This should work with np.errstate(divide='ignore'): a // 0 # While this should fail! try: a // 0 except FloatingPointError: pass else: self.fail("Did not raise divide by zero error") def test_errcall(self): def foo(*args): print(args) olderrcall = np.geterrcall() with np.errstate(call=foo): assert_(np.geterrcall() is foo, 'call is not foo') with np.errstate(call=None): assert_(np.geterrcall() is None, 'call is not None') assert_(np.geterrcall() is olderrcall, 'call is not olderrcall') if __name__ == "__main__": run_module_suite()
Save
cmd:
run