def test_sieve_out(basic_image):

    with Env():
        output = numpy.zeros_like(basic_image)
        output[1:3, 1:3] = 5
        sieved_image = sieve(basic_image, basic_image.sum(), out=output)
        assert numpy.array_equal(basic_image, sieved_image)
        assert numpy.array_equal(output, sieved_image)
Output array passed in should match the returned array
dataset/ETHPy150Open mapbox/rasterio/tests/test_features.py/test_sieve_out