()
| 164 | |
| 165 | |
| 166 | def test_gcf(): |
| 167 | fig = plt.figure("a label") |
| 168 | buf = BytesIO() |
| 169 | pickle.dump(fig, buf, pickle.HIGHEST_PROTOCOL) |
| 170 | plt.close("all") |
| 171 | assert plt._pylab_helpers.Gcf.figs == {} # No figures must be left. |
| 172 | fig = pickle.loads(buf.getbuffer()) |
| 173 | assert plt._pylab_helpers.Gcf.figs != {} # A manager is there again. |
| 174 | assert fig.get_label() == "a label" |
| 175 | |
| 176 | |
| 177 | def test_no_pyplot(): |