schrodinger.test.hypothesis.strategies.indices module¶
- schrodinger.test.hypothesis.strategies.indices.indices(ordered_collection)[source]¶
Strategy that returns an index within a non-empty collection
- Parameters
ordered_collection (collections.abc.Sequence) – Any collection that supports len and indexing
- Return type
int
- Returns
An index
- schrodinger.test.hypothesis.strategies.indices.index_lists(ordered_collection)[source]¶
Strategy that returns a subset of index_lists in any collection that supports indexing and len
- Parameters
ordered_collection (collections.abc.Sequence) – Any object that supports len and indexing
- Return type
list(int)
- Returns
A subset of index_lists in the collection
- schrodinger.test.hypothesis.strategies.indices.slice_pairs(ordered_collection)[source]¶
A strategy that returns a tuple of (start, end) indices in a collection.
- Parameters
draw (function) – A function supplied by the hypothesis decorator
ordered_collection (collections.abc.Sequence) – Any object that supports len and indexing
- Return type
tuple(int, int)
- Returns
A tuple of (start, end) indices in collection