def test_save_with_figure(self): """Test save() works when given an explicit figure instance...""" setup_figure(width=1, height=1) from matplotlib import pyplot as plt fig = plt.figure() save(fig) os.unlink("tests/test_misc.pypgf")
from pgfutils import setup_figure, save setup_figure(height=0.3) from custom_lib import get_data from matplotlib import pyplot as plt t, s = get_data() plt.plot(t, s) save()
def test_save_with_nonfigure_fails(self): """Test save() fails when given a non-figure object...""" setup_figure(width=1, height=1) with pytest.raises(AttributeError): save(self)