()
| 1655 | |
| 1656 | |
| 1657 | def test__resample_valid_output(): |
| 1658 | resample = functools.partial(mpl._image.resample, transform=Affine2D()) |
| 1659 | with pytest.raises(TypeError, match="incompatible function arguments"): |
| 1660 | resample(np.zeros((9, 9)), None) |
| 1661 | with pytest.raises(ValueError, match="different dimensionalities"): |
| 1662 | resample(np.zeros((9, 9)), np.zeros((9, 9, 4))) |
| 1663 | with pytest.raises(ValueError, match="different dimensionalities"): |
| 1664 | resample(np.zeros((9, 9, 4)), np.zeros((9, 9))) |
| 1665 | with pytest.raises(ValueError, match="3D input array must be RGBA"): |
| 1666 | resample(np.zeros((9, 9, 3)), np.zeros((9, 9, 4))) |
| 1667 | with pytest.raises(ValueError, match="3D output array must be RGBA"): |
| 1668 | resample(np.zeros((9, 9, 4)), np.zeros((9, 9, 3))) |
| 1669 | with pytest.raises(ValueError, match="mismatched types"): |
| 1670 | resample(np.zeros((9, 9), np.uint8), np.zeros((9, 9))) |
| 1671 | with pytest.raises(ValueError, match="must be C-contiguous"): |
| 1672 | resample(np.zeros((9, 9)), np.zeros((9, 9)).T) |
| 1673 | |
| 1674 | out = np.zeros((9, 9)) |
| 1675 | out.flags.writeable = False |
| 1676 | with pytest.raises(ValueError, match="Output array must be writeable"): |
| 1677 | resample(np.zeros((9, 9)), out) |
| 1678 | |
| 1679 | |
| 1680 | @pytest.mark.parametrize("data, interpolation, expected", |
nothing calls this directly
no test coverage detected
searching dependent graphs…