MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_load_old_api

Function test_load_old_api

lib/matplotlib/tests/test_backend_template.py:21–30  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

19
20
21def test_load_old_api(monkeypatch):
22 mpl_test_backend = SimpleNamespace(**vars(backend_template))
23 mpl_test_backend.new_figure_manager = (
24 lambda num, *args, FigureClass=mpl.figure.Figure, **kwargs:
25 FigureManagerTemplate(
26 FigureCanvasTemplate(FigureClass(*args, **kwargs)), num))
27 monkeypatch.setitem(sys.modules, "mpl_test_backend", mpl_test_backend)
28 mpl.use("module://mpl_test_backend")
29 assert type(plt.figure().canvas) == FigureCanvasTemplate
30 plt.draw_if_interactive()
31
32
33def test_show(monkeypatch):

Callers

nothing calls this directly

Calls 4

figureMethod · 0.80
draw_if_interactiveMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…