def test_check_chi_range(): wrong_values = (3 * np.pi, - 3 * np.pi) for value in wrong_values: # 0 is always a correct value with pytest.raises(ValueError) as excinfo: check_gamma_mu_chi_range(0, 0, value) assert ("ValueError: Chi value is not inside correct range" in excinfo.exconly())
def test_check_gamma_mu_chi_range(): wrong_values = (3 * np.pi, - 3 * np.pi) for value in wrong_values: # 0 is always a correct value angles = [0, 0, 0] for ii in range(3): angles[ii] = value with pytest.raises(ValueError): check_gamma_mu_chi_range(*angles)