From ad1296ae4788bb405ea859a0a5e6a436f33fbdfa Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Wed, 30 Nov 2022 16:47:57 +0000 Subject: [PATCH] tests: Exception for negative matrix in GEVP tested. --- tests/correlators_test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index adf4e2ba..c4980a7e 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -310,6 +310,7 @@ def test_GEVP_warnings(): with pytest.warns(DeprecationWarning): corr_mat.GEVP(0, sorted_list="Eigenvalue") + def test_GEVP_exceptions(): corr_aa = _gen_corr(1) corr_ab = 0.5 * corr_aa @@ -371,6 +372,10 @@ def test_GEVP_exceptions(): with pytest.raises(Exception): corr_0.matrix_symmetric() + n_corr_mat = -corr_mat + with pytest.raises(np.linalg.LinAlgError): + n_corr_mat.GEVP(2) + def test_matrix_symmetric(): corr_aa = _gen_corr(1)