diff --git a/pygmt/tests/test_grdimage.py b/pygmt/tests/test_grdimage.py index c4658dc38e7..7a29bc0a572 100644 --- a/pygmt/tests/test_grdimage.py +++ b/pygmt/tests/test_grdimage.py @@ -78,10 +78,19 @@ def test_grdimage_file(): condition=gmt_version <= Version("6.1.1"), ) @check_figures_equal() -def test_grdimage_xarray_shading(grid): +@pytest.mark.parametrize( + "shading", + [True, 0.5, "+a30+nt0.8", "@earth_relief_01d_g+d", "@earth_relief_01d_g+a60+nt0.8"], +) +def test_grdimage_shading_xarray(grid, shading): """ Test that shading works well for xarray. - See https://github.com/GenericMappingTools/pygmt/issues/364 + + The ``shading`` can be True, a constant intensity, some modifiers, or + a grid with modifiers. + + See https://github.com/GenericMappingTools/pygmt/issues/364 and + https://github.com/GenericMappingTools/pygmt/issues/618. """ fig_ref, fig_test = Figure(), Figure() kwargs = dict( @@ -89,7 +98,7 @@ def test_grdimage_xarray_shading(grid): frame=True, projection="Cyl_stere/6i", cmap="geo", - shading=True, + shading=shading, ) fig_ref.grdimage("@earth_relief_01d_g", **kwargs)