PATH:
opt
/
alt
/
python37
/
lib64
/
python3.7
/
site-packages
/
numpy
/
core
/
tests
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()
[-] test_indexerrors.py
[edit]
[-] test_regression.py
[edit]
[-] test_arrayprint.py
[edit]
[-] test_numeric.py
[edit]
[+]
data
[-] test_scalarinherit.py
[edit]
[-] test_numerictypes.py
[edit]
[-] test_item_selection.py
[edit]
[-] test_umath.py
[edit]
[-] test_longdouble.py
[edit]
[-] test_dtype.py
[edit]
[+]
__pycache__
[-] test_memmap.py
[edit]
[-] test_getlimits.py
[edit]
[-] test_mem_overlap.py
[edit]
[-] test_scalarprint.py
[edit]
[-] test_multiarray.py
[edit]
[-] test_function_base.py
[edit]
[-] test_datetime.py
[edit]
[-] test_nditer.py
[edit]
[-] test_records.py
[edit]
[-] test_ufunc.py
[edit]
[-] test_api.py
[edit]
[-] test_machar.py
[edit]
[-] test_scalarmath.py
[edit]
[-] test_shape_base.py
[edit]
[-] test_extint128.py
[edit]
[-] test_abc.py
[edit]
[-] test_umath_complex.py
[edit]
[-] test_indexing.py
[edit]
[-] test_print.py
[edit]
[-] test_einsum.py
[edit]
[-] test_deprecations.py
[edit]
[-] test_unicode.py
[edit]
[-] test_errstate.py
[edit]
[+]
..
[-] test_half.py
[edit]
[-] test_defchararray.py
[edit]