diff options
author | Olly Cope <olly@ollycope.com> | 2021-05-16 17:36:26 +0000 |
---|---|---|
committer | Olly Cope <olly@ollycope.com> | 2021-05-16 17:36:26 +0000 |
commit | 59f7e699a8d9b6d006521190d2006e7af5ed5640 (patch) | |
tree | fdbcd728b2aa939ceb68d60a810b53f1866a53c5 /yoyo | |
parent | 9a6b35dbd9a552e490d30cacfcf026a0b9fee7af (diff) | |
download | yoyo-59f7e699a8d9b6d006521190d2006e7af5ed5640.tar.gz |
topological sort/tests: fix spurious error for edges that are not in input
Diffstat (limited to 'yoyo')
-rw-r--r-- | yoyo/tests/test_topologicalsort.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yoyo/tests/test_topologicalsort.py b/yoyo/tests/test_topologicalsort.py index 2695dc6..be308d2 100644 --- a/yoyo/tests/test_topologicalsort.py +++ b/yoyo/tests/test_topologicalsort.py @@ -13,7 +13,10 @@ class TestTopologicalSort(object): deps.setdefault(a, set()).add(b) output = list(topologicalsort.topological_sort(nodes, deps)) for a, b in edges: - assert output.index(a) > output.index(b) + try: + assert output.index(a) > output.index(b) + except ValueError: + pass assert output == list(expected) def test_it_keeps_stable_order(self): |