Hypothesis: Sampled_from() should work with collections.OrderedDict

Created on 10 Jun 2017  路  4Comments  路  Source: HypothesisWorks/hypothesis

OrderedDict should satisfy the replayability requirement, so sampling from it should be possible.
Currently it raises exception:
HypothesisDeprecationWarning: Cannot sample from odict_values

bug

All 4 comments

You could throw in a list call to stop Hypothesis complaining.

However, the iteration order of an OrderedDict is stable (obviously), so I think this ought to be allowed, unless there's some nuance I missed here.

Yep, this seems like a straight up bug/oversight. Patch shortly.

Okay, patch is up for review.

@corehack This should be fixed in Hypothesis 3.11.3. Thanks for the report!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zac-HD picture Zac-HD  路  4Comments

thedrow picture thedrow  路  3Comments

goodspark picture goodspark  路  8Comments

rsokl picture rsokl  路  4Comments

pckroon picture pckroon  路  4Comments