def test_slider_slice_warning(self):
index = 3
kwargs = dict(grid_longitude=index)
coords = ('time', 'grid_latitude')
plot = Plot2D(self.cube, self.axes, coords=coords)
plot.alias(wibble=2)
wmsg = ("expected to be called with alias 'wibble' for dimension 2, "
"rather than with 'grid_longitude'")
with warnings.catch_warnings():
# Cause all warnings to raise an exception.
warnings.simplefilter('error')
with self.assertRaisesRegexp(UserWarning, wmsg):
plot(**kwargs)
评论列表
文章目录