I updated Python Hypothesis and it seems that choices()
is now deprecated.
Documentation does some handwaving about data()
and sampled_from()
, but it's not clear how those should be used in place of choices()
.
My code looks something line this:
@precondition(lambda self: not self.flash_light.crossed)
@rule(choice=st.choices)
def make_forward_move(self, choice):
persons = [x for x in self.persons if not x.crossed]
pers1 = choice(persons)
persons.remove(pers1)
pers2 = choice(persons)