diff --git a/dkist/dataset/tests/test_tiled_dataset.py b/dkist/dataset/tests/test_tiled_dataset.py index 95179010..101ce7c2 100644 --- a/dkist/dataset/tests/test_tiled_dataset.py +++ b/dkist/dataset/tests/test_tiled_dataset.py @@ -6,6 +6,7 @@ from dkist import Dataset, TiledDataset, load_dataset from dkist.tests.helpers import figure_test +from dkist.utils.exceptions import DKISTUserWarning def test_tiled_dataset(simple_tiled_dataset, dataset): @@ -90,7 +91,11 @@ def test_tileddataset_plot(share_zscale): ds = TiledDataset(np.array(newtiles).reshape(ori_ds.shape), meta={"inventory": newtiles[0].inventory}) fig = plt.figure(figsize=(12, 15)) - ds.plot(0, share_zscale=share_zscale, figure=fig) + with pytest.warns(DKISTUserWarning, + match="The metadata ASDF file that produced this dataset is out of date and will result in " + "incorrect plots. Please re-download the metadata ASDF file."): + #TODO: Once sample data have been updated maybe we should test both paths here (old data and new data) + ds.plot(0, share_zscale=share_zscale, figure=fig) return plt.gcf() @@ -119,7 +124,11 @@ def test_tileddataset_plot_limit_swapping(swap_tile_limits): assert non_square_ds.shape[0] != non_square_ds.shape[1] # Just in case the underlying data change for some reason fig = plt.figure(figsize=(12, 15)) - non_square_ds.plot(0, share_zscale=False, swap_tile_limits=swap_tile_limits, figure=fig) + with pytest.warns(DKISTUserWarning, + match="The metadata ASDF file that produced this dataset is out of date and will result in " + "incorrect plots. Please re-download the metadata ASDF file."): + #TODO: Once sample data have been updated maybe we should test both paths here (old data and new data) + non_square_ds.plot(0, share_zscale=False, swap_tile_limits=swap_tile_limits, figure=fig) assert fig.axes[0].get_gridspec().get_geometry() == non_square_ds.shape[::-1] for ax in fig.axes: