def test_plotfunc_kwargs(tmpdir): """Test if kwargs are properly propagated to the plotfunction""" def plotfunc(ds, fig, tt, framedim="time", test1=None, **kwargs): if test1 is None: raise RuntimeError("test1 cannot be None") da = test_dataarray() mov = Movie(da, plotfunc=plotfunc, test1=3) mov.preview(0) mov.save_frames(tmpdir)
def test_plotfunc_kwargs_xfail(tmpdir): pytest.xfail("if **kwargs is not in the function signature \ and the input is checked, this should error out.") def plotfunc(ds, fig, tt, test1=None): if test1 is None: raise RuntimeError("test1 cannot be None") da = test_dataarray() mov = Movie(da, plotfunc=plotfunc, test1=3) mov.preview(0) mov.save_frames(tmpdir)
def test_movie_preview(): da = test_dataarray() mov = Movie(da) mov.preview(0) fig = plt.gcf() assert mov.dpi == fig.dpi