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
Test GUI only on win
  • Loading branch information
adam-urbanczyk committed Jun 12, 2025
commit 2ad988424266d9c86b7a50d3765b8e69256077d7
19 changes: 16 additions & 3 deletions tests/test_fig.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@

from pytest import fixture, mark

from sys import platform


@fixture(scope="module")
def fig():
return Figure()


@mark.gui
@mark.skipif(platform != "win32", reason="CI with UI only works on win for now")
def test_fig(fig):

# showables
Expand All @@ -24,21 +27,31 @@ def test_fig(fig):
loc = Location()
act = vtkAxesActor()

showables = (s, wp, assy, sk, ctrl_pts, v, loc, act)

# individual showables
fig.show(s, wp, assy, sk, ctrl_pts, v, loc, act)
fig.show(*showables)

# fit
fig.fit()

# clear
fig.clear()

# clear with an arg
fig.show(s).clear(s)

# lists of showables
fig.show(s.Edges()).show([Vector(), Vector(0, 1)])

# displaying nonsense does not throw
fig.show("a").show(["a", 1234])

# pop
fig.show(s, color="red")
fig.pop()
for el in showables:
fig.show(el, color="red")
fig.pop()

# test singleton behavior of fig
fig2 = Figure()
assert fig is fig2