(self)
| 265 | class TestHash: |
| 266 | # see #3793 |
| 267 | def test_int(self): |
| 268 | for st, ut, s in [(np.int8, np.uint8, 8), |
| 269 | (np.int16, np.uint16, 16), |
| 270 | (np.int32, np.uint32, 32), |
| 271 | (np.int64, np.uint64, 64)]: |
| 272 | for i in range(1, s): |
| 273 | assert_equal(hash(st(-2**i)), hash(-2**i), |
| 274 | err_msg="%r: -2**%d" % (st, i)) |
| 275 | assert_equal(hash(st(2**(i - 1))), hash(2**(i - 1)), |
| 276 | err_msg="%r: 2**%d" % (st, i - 1)) |
| 277 | assert_equal(hash(st(2**i - 1)), hash(2**i - 1), |
| 278 | err_msg="%r: 2**%d - 1" % (st, i)) |
| 279 | |
| 280 | i = max(i - 1, 1) |
| 281 | assert_equal(hash(ut(2**(i - 1))), hash(2**(i - 1)), |
| 282 | err_msg="%r: 2**%d" % (ut, i - 1)) |
| 283 | assert_equal(hash(ut(2**i - 1)), hash(2**i - 1), |
| 284 | err_msg="%r: 2**%d - 1" % (ut, i)) |
| 285 | |
| 286 | |
| 287 | class TestAttributes: |
nothing calls this directly
no test coverage detected