()
| 112 | |
| 113 | |
| 114 | def test_instances(): |
| 115 | # Test the finfo and iinfo results on numeric instances agree with |
| 116 | # the results on the corresponding types |
| 117 | |
| 118 | for c in [int, np.int16, np.int32, np.int64]: |
| 119 | class_iinfo = iinfo(c) |
| 120 | instance_iinfo = iinfo(c(12)) |
| 121 | |
| 122 | assert_iinfo_equal(class_iinfo, instance_iinfo) |
| 123 | |
| 124 | for c in [float, np.float16, np.float32, np.float64]: |
| 125 | class_finfo = finfo(c) |
| 126 | instance_finfo = finfo(c(1.2)) |
| 127 | assert_finfo_equal(class_finfo, instance_finfo) |
| 128 | |
| 129 | with pytest.raises(ValueError): |
| 130 | iinfo(10.) |
| 131 | |
| 132 | with pytest.raises(ValueError): |
| 133 | iinfo('hi') |
| 134 | |
| 135 | with pytest.raises(ValueError): |
| 136 | finfo(np.int64(1)) |
| 137 | |
| 138 | |
| 139 | def assert_ma_equal(discovered, ma_like): |
nothing calls this directly
no test coverage detected