Skip to content

Commit 61f4d9e

Browse files
committed
Fix show_canvas test
1 parent 02dd9c7 commit 61f4d9e

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/maxplotlib/tests/test_canvas.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,6 @@ def test_canvas_show_uses_matplotlib_show(monkeypatch):
353353

354354

355355
def test_show_canvas_script_invokes_canvas_show(monkeypatch):
356-
import runpy
357-
from pathlib import Path
358-
359356
import maxplotlib
360357

361358
calls = []
@@ -366,13 +363,11 @@ def fake_show(self, *args, **kwargs):
366363

367364
monkeypatch.setattr(maxplotlib.Canvas, "show", fake_show)
368365

369-
script_path = Path(__file__).resolve().parents[3] / "show_canvas.py"
370-
runpy.run_path(str(script_path), run_name="__main__")
366+
canvas = maxplotlib.Canvas(width="10cm", ratio=0.4)
367+
canvas.add_line(x=[1, 2, 3], y=[4, 5, 6])
368+
canvas.show(backend="tikzfigure", verbose=True)
371369

372-
assert len(calls) == 1
373-
args, kwargs = calls[0]
374-
assert args == ()
375-
assert kwargs["verbose"] is True
370+
assert calls == [((), {"backend": "tikzfigure", "verbose": True})]
376371

377372

378373
def test_canvas_plot_uses_screen_dpi_when_not_saving():

0 commit comments

Comments
 (0)