MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test__resample_valid_output

Function test__resample_valid_output

lib/matplotlib/tests/test_image.py:1657–1677  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1655
1656
1657def 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",

Callers

nothing calls this directly

Calls 1

Affine2DClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…