def test_stackcopy(): layers = 4 x = np.empty((3, 3, layers)) y = np.eye(3, 3) _stackcopy(x, y) for i in range(layers): assert_almost_equal(x[..., i], y)