From 6d8bce87554463c1ce8ab1dadde9b080c59ddf43 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 5 Nov 2021 12:23:58 +0000 Subject: [PATCH] Additional tests for exceptional cases of correlate added --- tests/pyerrors_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/pyerrors_test.py b/tests/pyerrors_test.py index 687144cc..4171dfe2 100644 --- a/tests/pyerrors_test.py +++ b/tests/pyerrors_test.py @@ -297,6 +297,14 @@ def test_correlate(): corr2 = pe.correlate(my_obs2, my_obs1) assert corr1 == corr2 + my_obs3 = pe.Obs([np.random.rand(100)], ['t'], idl=[range(2, 102)]) + with pytest.raises(Exception): + pe.correlate(my_obs1, my_obs3) + + my_obs4 = pe.Obs([np.random.rand(99)], ['t']) + with pytest.raises(Exception): + pe.correlate(my_obs1, my_obs4) + def test_irregular_error_propagation(): obs_list = [pe.Obs([np.random.rand(100)], ['t']),