(self, obj)
| 7826 | """ Test PEP3118 buffers """ |
| 7827 | |
| 7828 | def _check_roundtrip(self, obj): |
| 7829 | obj = np.asarray(obj) |
| 7830 | x = memoryview(obj) |
| 7831 | y = np.asarray(x) |
| 7832 | y2 = np.array(x) |
| 7833 | assert_(not y.flags.owndata) |
| 7834 | assert_(y2.flags.owndata) |
| 7835 | |
| 7836 | assert_equal(y.dtype, obj.dtype) |
| 7837 | assert_equal(y.shape, obj.shape) |
| 7838 | assert_array_equal(obj, y) |
| 7839 | |
| 7840 | assert_equal(y2.dtype, obj.dtype) |
| 7841 | assert_equal(y2.shape, obj.shape) |
| 7842 | assert_array_equal(obj, y2) |
| 7843 | |
| 7844 | def test_roundtrip(self): |
| 7845 | x = np.array([1, 2, 3, 4, 5], dtype='i4') |
no test coverage detected