Skip to content

Commit 38d35c6

Browse files
committed
fix test bug with unshow
1 parent 474b72a commit 38d35c6

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

test/tests/test_all.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,20 @@ def callback():
4343
ps.set_user_callback(callback)
4444
ps.show(10)
4545

46+
# Make sure that unshow worked, and we stopped short of 10 loop iterations
4647
self.assertLess(counts[0], 4)
4748

49+
50+
# Make sure unshow doesn't mess up subsequent calls
51+
counts[0] = 0
52+
def callback():
53+
counts[0] = counts[0] + 1
54+
ps.set_user_callback(callback)
55+
ps.show(3)
56+
self.assertEqual(counts[0], 3)
57+
58+
ps.clear_user_callback()
59+
4860
def test_options(self):
4961
# Remember, polyscope has global state, so we're actually setting these for the remainder of the tests (lol)
5062

@@ -87,7 +99,7 @@ def test_options(self):
8799
ps.set_render_scene(True)
88100
ps.set_open_imgui_window_for_user_callback(True)
89101
ps.set_invoke_user_callback_for_nested_show(False)
90-
ps.set_give_focus_on_show(True)
102+
ps.set_give_focus_on_show(False)
91103

92104
ps.set_background_color((0.7, 0.8, 0.9))
93105
ps.set_background_color((0.7, 0.8, 0.9, 0.9))

0 commit comments

Comments
 (0)