Last active
December 8, 2015 05:07
-
-
Save tomprince/a560033e73d052274620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hypothesis.strategies import * | |
def subset_strat(strategies): | |
def build(keys): | |
return fixed_dictionaries({key: strategies[key] for key in keys}) | |
return sets(sampled_from(strategies.keys())).flatmap(build) | |
if __name__ == "__main__": | |
print(subset_strat({"abc": integers(), "def": text()}).example()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment