def __init__(self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor, **kwargs) self.mapped_strategy = strategies.strategy( descriptor.hypothesis_test_requirements )
def __init__(self, shape, min_dims, max_dims, allow_ellipsis, allow_newaxis): assert 0 <= min_dims <= max_dims <= 32 SearchStrategy.__init__(self) self.shape = shape self.min_dims = min_dims self.max_dims = max_dims self.allow_ellipsis = allow_ellipsis self.allow_newaxis = allow_newaxis
def __init__(self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor, **kwargs) step_strategies = [ StepStrategy(strategies, s) for s in descriptor.test_steps() ] child_mapper = strategies.new_child_mapper() child_mapper.define_specification_for( Step, lambda sgs, _: sgs.strategy(one_of(step_strategies))) self.mapped_strategy = child_mapper.strategy([Step])
def __init__(self, shape, min_dims, max_dims, min_side, max_side): assert 0 <= min_side <= max_side assert 0 <= min_dims <= max_dims <= 32 SearchStrategy.__init__(self) self.shape = shape self.side_strat = st.integers(min_side, max_side) self.min_dims = min_dims self.max_dims = max_dims self.min_side = min_side self.max_side = max_side
def __init__(self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor, **kwargs) step_strategies = [ StepStrategy(strategies, s) for s in descriptor.test_steps() ] child_mapper = strategies.new_child_mapper() child_mapper.define_specification_for( Step, lambda sgs, _: sgs.strategy(one_of(step_strategies)) ) self.mapped_strategy = child_mapper.strategy([Step])
def __init__( self, num_shapes, base_shape=(), min_dims=0, max_dims=None, min_side=1, max_side=None, ): assert 0 <= min_side <= max_side assert 0 <= min_dims <= max_dims <= 32 SearchStrategy.__init__(self) self.base_shape = base_shape self.side_strat = st.integers(min_side, max_side) self.num_shapes = num_shapes self.min_dims = min_dims self.max_dims = max_dims self.min_side = min_side self.max_side = max_side self.size_one_allowed = self.min_side <= 1 <= self.max_side
def __init__(self,strategies,descriptor): SearchStrategy.__init__(self,strategies,descriptor) self.int_strategy = strategies.strategy(int)
def __init__( self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor,**kwargs) self.mapped_strategy = strategies.strategy(one_of([Leaf, Split]))
def __init__( self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor,**kwargs) self.mapped_strategy = strategies.strategy((BinaryTree, BinaryTree))
def __init__( self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor,**kwargs) self.mapped_strategy = strategies.strategy(int)
def __init__(self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor, **kwargs) self.mapped_strategy = strategies.strategy((BinaryTree, BinaryTree))
def __init__(self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor, **kwargs) self.mapped_strategy = strategies.strategy(int)
def __init__(self, elements, size): SearchStrategy.__init__(self) self.__length = st.integers(0, ceil(size**0.5)) self.__elements = elements
def __init__(self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor, **kwargs) self.mapped_strategy = strategies.strategy(one_of([Leaf, Split]))
def __init__(self, p): SearchStrategy.__init__(self) self.__p = p
def __init__(self, strategies, descriptor): SearchStrategy.__init__(self, strategies, descriptor) self.int_strategy = strategies.strategy(int)
def __init__(self, elements, size): SearchStrategy.__init__(self) self.__length = st.integers(0, ceil(size ** 0.5)) self.__elements = elements
def __init__(self, poison_chance): SearchStrategy.__init__(self) self.__poison_chance = poison_chance self.__ints = st.integers(0, 10)
def __init__(self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor, **kwargs) self.mapped_strategy = strategies.strategy( descriptor.hypothesis_test_requirements)
def __init__( self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor,**kwargs) self.mapped_strategy = strategies.strategy([HeavilyBranchingTree])
def hypothesis_parametrize(argspec: Union[Tuple[str], str], strategy: SearchStrategy, max_examples=10): return pytest.mark.parametrize(argspec, (strategy.example() for i in range(max_examples)))
def __init__(self, strategies, descriptor, **kwargs): SearchStrategy.__init__(self, strategies, descriptor, **kwargs) self.mapped_strategy = strategies.strategy([HeavilyBranchingTree])