summaryrefslogtreecommitdiff
path: root/grc/tests/test_expr_utils.py
diff options
context:
space:
mode:
authorHåkon Vågsether <hauk142@gmail.com>2021-01-05 21:12:42 +0100
committerMartin Braun <martin@gnuradio.org>2021-01-11 06:59:25 -0800
commitb0389688b9c158345b3c1e819b0b90292fb6b492 (patch)
treef308827af77e0da1ab4bc419e20d9545bf048f60 /grc/tests/test_expr_utils.py
parent6d0a28f833aea97486eb2b6b8844f24caa65a872 (diff)
grc: Clean up test_expr_utils.py
Signed-off-by: Håkon Vågsether <hauk142@gmail.com>
Diffstat (limited to 'grc/tests/test_expr_utils.py')
-rw-r--r--grc/tests/test_expr_utils.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/grc/tests/test_expr_utils.py b/grc/tests/test_expr_utils.py
index 29fa552b60..637fb34a35 100644
--- a/grc/tests/test_expr_utils.py
+++ b/grc/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)