Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a test
  • Loading branch information
adam-urbanczyk committed Feb 2, 2025
commit 3f47da85da9eae2b4c92a25a61708e7a95e07aac
15 changes: 15 additions & 0 deletions tests/test_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
from vtkmodules.vtkRenderingAnnotation import vtkAnnotatedCubeActor

from pytest import fixture
from path import Path


@fixture(scope="module")
def tmpdir(tmp_path_factory):
return Path(tmp_path_factory.mktemp("screenshots"))


@fixture
Expand Down Expand Up @@ -92,3 +98,12 @@ def test_show(wp, assy, sk, monkeypatch):

# show a raw vtkProp
show(vtkAxesActor(), [vtkAnnotatedCubeActor()])


def test_screenshot(wp, tmpdir):

# smoke test for now

with tmpdir:
show(wp, interact=False, screenshot="img.png")
assert Path("img.png").exists()
Loading