Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sampled_from() should work with collections.OrderedDict #688

Closed
a3kov opened this issue Jun 10, 2017 · 4 comments
Closed

Sampled_from() should work with collections.OrderedDict #688

a3kov opened this issue Jun 10, 2017 · 4 comments
Labels
bug something is clearly wrong here

Comments

@a3kov
Copy link

a3kov commented Jun 10, 2017

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

@mithrandi
Copy link
Contributor

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.

@alexwlchan
Copy link
Contributor

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

@alexwlchan
Copy link
Contributor

Okay, patch is up for review.

@alexwlchan alexwlchan added the bug something is clearly wrong here label Jun 11, 2017
@alexwlchan
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is clearly wrong here
Projects
None yet
Development

No branches or pull requests

3 participants