summaryrefslogtreecommitdiff
path: root/yoyo
diff options
context:
space:
mode:
authorOlly Cope <olly@ollycope.com>2021-05-16 17:36:26 +0000
committerOlly Cope <olly@ollycope.com>2021-05-16 17:36:26 +0000
commit59f7e699a8d9b6d006521190d2006e7af5ed5640 (patch)
treefdbcd728b2aa939ceb68d60a810b53f1866a53c5 /yoyo
parent9a6b35dbd9a552e490d30cacfcf026a0b9fee7af (diff)
downloadyoyo-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.py5
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):