From 5adc3e0c76679772e6f5623dc4488fe332f34dfc Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Tue, 24 Jan 2023 10:10:52 +0000 Subject: [PATCH] test: sin2 cos2 test for error propagation added. --- tests/obs_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/obs_test.py b/tests/obs_test.py index cc0203c1..b01ed034 100644 --- a/tests/obs_test.py +++ b/tests/obs_test.py @@ -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'])