(self, val, iface, expected)
| 8560 | (f, {'strides': 16}, TypeError), |
| 8561 | ]) |
| 8562 | def test_scalar_interface(self, val, iface, expected): |
| 8563 | # Test scalar coercion within the array interface |
| 8564 | self.f.iface = {'typestr': 'f8'} |
| 8565 | self.f.iface.update(iface) |
| 8566 | if HAS_REFCOUNT: |
| 8567 | pre_cnt = sys.getrefcount(np.dtype('f8')) |
| 8568 | if isinstance(expected, type): |
| 8569 | assert_raises(expected, np.array, val) |
| 8570 | else: |
| 8571 | result = np.array(val) |
| 8572 | assert_equal(np.array(val), expected) |
| 8573 | assert result.dtype == 'f8' |
| 8574 | del result |
| 8575 | if HAS_REFCOUNT: |
| 8576 | post_cnt = sys.getrefcount(np.dtype('f8')) |
| 8577 | assert_equal(pre_cnt, post_cnt) |
| 8578 | |
| 8579 | def test_interface_no_shape(): |
| 8580 | class ArrayLike: |
nothing calls this directly
no test coverage detected