(self, val, iface, expected)
| 9654 | reason="test result depends on the reference count of a global object", |
| 9655 | ) |
| 9656 | def test_scalar_interface(self, val, iface, expected): |
| 9657 | # Test scalar coercion within the array interface |
| 9658 | self.f.iface = {'typestr': 'f8'} |
| 9659 | self.f.iface.update(iface) |
| 9660 | if HAS_REFCOUNT: |
| 9661 | pre_cnt = sys.getrefcount(np.dtype('f8')) |
| 9662 | if isinstance(expected, type): |
| 9663 | assert_raises(expected, np.array, val) |
| 9664 | else: |
| 9665 | result = np.array(val) |
| 9666 | assert_equal(np.array(val), expected) |
| 9667 | assert result.dtype == 'f8' |
| 9668 | del result |
| 9669 | if HAS_REFCOUNT: |
| 9670 | post_cnt = sys.getrefcount(np.dtype('f8')) |
| 9671 | assert_equal(pre_cnt, post_cnt) |
| 9672 | |
| 9673 | |
| 9674 | def test_interface_empty_shape(): |
nothing calls this directly
no test coverage detected