MCPcopy Index your code
hub / github.com/numpy/numpy / test_subnormal_warning

Function test_subnormal_warning

numpy/_core/tests/test_getlimits.py:144–157  ·  view source on GitHub ↗

Test that the subnormal is zero warning is not being raised.

()

Source from the content-addressed store, hash-verified

142
143
144def test_subnormal_warning():
145 """Test that the subnormal is zero warning is not being raised."""
146 with warnings.catch_warnings(record=True) as w:
147 warnings.simplefilter('always')
148 # Test for common float types
149 for dtype in [np.float16, np.float32, np.float64]:
150 f = finfo(dtype)
151 _ = f.smallest_subnormal
152 # Also test longdouble
153 with np.errstate(all='ignore'):
154 fld = finfo(np.longdouble)
155 _ = fld.smallest_subnormal
156 # Check no warnings were raised
157 assert len(w) == 0
158
159
160def test_plausible_finfo():

Callers

nothing calls this directly

Calls 1

finfoClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…