Test that the subnormal is zero warning is not being raised.
()
| 142 | |
| 143 | |
| 144 | def 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 | |
| 160 | def test_plausible_finfo(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…