From 52cb6bfad5da48e1717919c7693e86d1fb785eb6 Mon Sep 17 00:00:00 2001 From: Chris Kerr Date: Sun, 24 May 2020 18:59:18 +0300 Subject: [PATCH] Don't check the sign when the value is zero --- test/test_gaunt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_gaunt.py b/test/test_gaunt.py index e33f7b9..07e62cb 100644 --- a/test/test_gaunt.py +++ b/test/test_gaunt.py @@ -56,8 +56,10 @@ def test_sympy_gaunt_vs_wigner(lmkp): def test_python_vs_sympy_gaunt2(lmkp): L, M, K, P = lmkp sympy_result = sympy_matrix_element_G(L, M, K, P) + sympy_sign = sympy.sign(sympy_result) python_result, sign = gaunt._modified_gaunt_squared(L, K, P, M) - assert sign == sympy.sign(sympy_result) + if sympy_sign != 0: + assert sign == sympy_sign assert_sympy_equal( python_result, sympy_result ** 2, -- GitLab