(self)
| 80 | |
| 81 | @pytest.mark.slow |
| 82 | def test_constant_both(self): |
| 83 | # non-contiguous should raise error |
| 84 | x = np.arange(6, dtype=np.float64)[::2] |
| 85 | pytest.raises(ValueError, self.module.foo, x) |
| 86 | |
| 87 | # check values with contiguous array |
| 88 | x = np.arange(3, dtype=np.float64) |
| 89 | self.module.foo(x) |
| 90 | assert np.allclose(x, [0 + 1 * 3 * 3 + 2 * 3 * 3, 1 * 3, 2 * 3]) |
| 91 | |
| 92 | @pytest.mark.slow |
| 93 | def test_constant_no(self): |