Test that the subnormal is zero warning is not being raised.
()
| 164 | |
| 165 | |
| 166 | def test_subnormal_warning(): |
| 167 | """Test that the subnormal is zero warning is not being raised.""" |
| 168 | with np.errstate(all='ignore'): |
| 169 | ld_ma = _discovered_machar(np.longdouble) |
| 170 | bytes = np.dtype(np.longdouble).itemsize |
| 171 | with warnings.catch_warnings(record=True) as w: |
| 172 | warnings.simplefilter('always') |
| 173 | if (ld_ma.it, ld_ma.maxexp) == (63, 16384) and bytes in (12, 16): |
| 174 | # 80-bit extended precision |
| 175 | ld_ma.smallest_subnormal |
| 176 | assert len(w) == 0 |
| 177 | elif (ld_ma.it, ld_ma.maxexp) == (112, 16384) and bytes == 16: |
| 178 | # IEE 754 128-bit |
| 179 | ld_ma.smallest_subnormal |
| 180 | assert len(w) == 0 |
| 181 | else: |
| 182 | # Double double |
| 183 | ld_ma.smallest_subnormal |
| 184 | # This test may fail on some platforms |
| 185 | assert len(w) == 0 |
| 186 | |
| 187 | |
| 188 | def test_plausible_finfo(): |
nothing calls this directly
no test coverage detected