test: sin2 cos2 test for error propagation added.

This commit is contained in:
Fabian Joswig 2023-01-24 10:10:52 +00:00
parent 9d602e4e51
commit 5adc3e0c76
No known key found for this signature in database

View file

@ -17,6 +17,13 @@ def test_fuzzy_obs(data, string, S):
my_obs.gamma_method(S=S)
@given(st.floats(allow_nan=False, allow_infinity=False, width=16))
def test_sin2_cos2(value):
Obs = pe.pseudo_Obs(value, value * 0.123, "C0")
iamzero = np.sin(Obs) ** 2 + np.cos(Obs) ** 2 - 1
assert iamzero.is_zero(atol=1e-6)
def test_Obs_exceptions():
with pytest.raises(Exception):
pe.Obs([np.random.rand(10)], ['1', '2'])