def test_configure_flow_reset_error_permutations(sampler): """Assert an error is raised in the permutations input is invalid""" with pytest.raises(TypeError) as excinfo: NestedSampler.configure_flow_reset(sampler, 5, None) assert 'permutations` must be' in str(excinfo.value)
def test_configure_flow_reset(sampler, weights, permutations): """Assert the attributes evaluate to false if the inputs are false""" NestedSampler.configure_flow_reset(sampler, weights, permutations) assert sampler.reset_weights == float(weights) assert sampler.reset_permutations == float(permutations)
def test_configure_flow_reset_error_weights(sampler): """Assert an error is raised in the weights input is invalid""" with pytest.raises(TypeError) as excinfo: NestedSampler.configure_flow_reset(sampler, None, 5) assert 'weights` must be' in str(excinfo.value)
def test_configure_flow_reset_false(sampler): """Assert the attributes evaluate to false if the inputs are false""" NestedSampler.configure_flow_reset(sampler, False, False) assert not sampler.reset_weights assert not sampler.reset_permutations