When using GDAL 2.1, we get pixel counts that differ enough to cause some tests to fail:
_______________________________________________ test_cli_okcompare ________________________________________________
def test_cli_okcompare():
runner = CliRunner()
result = runner.invoke(cli, ['compare', 'tests/expected/blobby.tif', 'tests/fixtures/notblobby.tif', '--upsample', '8', '--compare-masked', '--downsample', '64'])
> assert result.exit_code == 0
E assert -1 == 0
E + where -1 = <Result ValueError('Mask has 2 pixels that vary by more than 16',)>.exit_code
tests/test_cli.py:40: AssertionError
_________________________________________ test_cli_okcompare_bad_no_error _________________________________________
def test_cli_okcompare_bad_no_error():
runner = CliRunner()
result = runner.invoke(cli, ['compare', 'tests/expected/blobby.tif', 'tests/fixtures/notblobby.tif', '--upsample', '8', '--downsample', '64', '--no-error'])
assert result.exit_code == 0
> assert result.output == 'not ok - Band 1 has 363 pixels that vary by more than 16\n'
E assert 'not ok - Ban...ore than 16\n' == 'not ok - Band...ore than 16\n'
E - not ok - Band 1 has 436 pixels that vary by more than 16
E ? -
E + not ok - Band 1 has 363 pixels that vary by more than 16
E ? +
tests/test_cli.py:53: AssertionError
_____________________________________________ test_cli_okcompare_rgb ______________________________________________
def test_cli_okcompare_rgb():
runner = CliRunner()
result = runner.invoke(cli, ['compare', 'tests/expected/blobby_rgb.tif', 'tests/fixtures/notblobby_rgb.tif', '--upsample', '8', '--compare-masked', '--downsample', '64', '--flex-mode'])
> assert result.exit_code == 0
E assert -1 == 0
E + where -1 = <Result ValueError('Band 1 has 128 pixels that vary by more than 16',)>.exit_code
tests/test_cli.py:59: AssertionError
___________________________________________ test_cli_okcompare_rgb_rev ____________________________________________
def test_cli_okcompare_rgb_rev():
runner = CliRunner()
result = runner.invoke(cli, ['compare', 'tests/fixtures/notblobby_rgb.tif', 'tests/expected/blobby_rgb.tif', '--upsample', '8', '--compare-masked', '--downsample', '64', '--flex-mode'])
> assert result.exit_code == 0
E assert -1 == 0
E + where -1 = <Result ValueError('Band 1 has 128 pixels that vary by more than 16',)>.exit_code
tests/test_cli.py:65: AssertionError
None of these failures occur when using GDAL 1.11. This is the first GDAL 2 regression I've seen but I guess it had to happen sometime.
I haven't dug into the reason behind the differences - perhaps some difference in the way the upsampling is performed in GDAL 2? In any case, we'll want to make raster-tester
robust under both GDAL versions.