How can I write a strategy for subsequences of given sequence?
For example given a list
elements = list(range(5))
I want a strategy
sub_elements = *strategy*(elements)
which generates
[]
[0]
[0, 2]
[1, 3, 4]
[0, 1, 2, 3, 4]
simple approach with combination of strategies.lists & strategies.sampled_from like
>>> from hypothesis import strategies
>>> strategies.lists(strategies.sampled_from(elements))
won't work because it doesn't take into account original elements count.