From 00ba382e244355f53627e85256faee7abe1dc920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20V=C3=A5gsether?= Date: Tue, 5 Jan 2021 21:12:42 +0100 Subject: [PATCH] grc: Clean up test_expr_utils.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Vågsether --- tests/test_expr_utils.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/test_expr_utils.py b/tests/test_expr_utils.py index 29fa552..637fb34 100644 --- a/tests/test_expr_utils.py +++ b/tests/test_expr_utils.py @@ -8,7 +8,6 @@ id_getter = operator.itemgetter(0) expr_getter = operator.itemgetter(1) -@pytest.mark.xfail(reason="core/utils/expr_utils.py:97: TypeError: '<' not supported between instances of 'NoneType' and 'str'") def test_simple(): objects = [ ['c', '2 * a + b'], @@ -18,26 +17,24 @@ def test_simple(): ] expected = [ - ['a', '1'], ['d', '5'], + ['a', '1'], ['b', '2 * a + unknown * d'], ['c', '2 * a + b'], ] - out = expr_utils.sort_objects2(objects, id_getter, expr_getter) + out = expr_utils.sort_objects(objects, id_getter, expr_getter) assert out == expected -@pytest.mark.xfail(reason="core/utils/expr_utils.py:97: TypeError: '<' not supported between instances of 'NoneType' and 'str'") -def test_other(): +def test_circular(): test = [ ['c', '2 * a + b'], ['a', '1'], ['b', '2 * c + unknown'], ] - expr_utils.sort_objects2(test, id_getter, expr_getter, check_circular=False) - - with pytest.raises(RuntimeError): - expr_utils.sort_objects2(test, id_getter, expr_getter) + # Should fail due to circular dependency + with pytest.raises(Exception): + expr_utils.sort_objects(test, id_getter, expr_getter)