Skip to content

Commit

Permalink
Update test_reset_choice_recursion to account for extra reset_choices()
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed May 22, 2022
1 parent 95de221 commit 5ec1541
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ def test_reset_choice_recursion():
x = 0

def get_choices(widget):
# import pdb; pdb.set_trace()
nonlocal x
x += 1
return list(range(x))
Expand All @@ -438,13 +439,14 @@ def get_choices(widget):
def f(c):
pass

assert f.c.choices == (0,)
# Constructing the gui already calls reset_choices() once
assert f.c.choices == (0, 1)

container = widgets.Container(widgets=[f])
container.reset_choices()
assert f.c.choices == (0, 1)
container.reset_choices()
assert f.c.choices == (0, 1, 2)
container.reset_choices()
assert f.c.choices == (0, 1, 2, 3)


def test_progressbar():
Expand Down

0 comments on commit 5ec1541

Please sign in to comment.