def test_flow__class(flow_class, result_class, sampler): """Test the correct class is imported and used""" NestedSampler.configure_flow_proposal(sampler, flow_class, {}, False) assert isinstance(sampler._flow_proposal, result_class)
def test_unknown_flow_class(sampler): """Test to check the error raised if an unknown class is used""" with pytest.raises(ValueError) as excinfo: NestedSampler.configure_flow_proposal(sampler, 'GWProposal', {}, False) assert 'Unknown flow class' in str(excinfo.value)
def test_no_flow_proposal_class(sampler): """Test the default flow class""" NestedSampler.configure_flow_proposal(sampler, None, {}, False) assert isinstance(sampler._flow_proposal, FlowProposal)