Skip to content

Commit

Permalink
tests: Allow multiple 'golden' results for agglomeration test on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarteberg committed Aug 4, 2017
1 parent 1a4a8ab commit f0b188f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions integration_tests/testpyagglom.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
# The 'golden' results depend on std::unordered, and therefore
# the expected answer is different on Mac and Linux.
if platform.system() == "Darwin":
expected_unique = 239
expected_unique = [239]
else:
expected_unique = 233
# Depending on which linux stdlib we use, we might get different results
expected_unique = [232, 233]

result_unique = len(numpy.unique(res))
assert result_unique == expected_unique, \
"Expected {} unique labels (including 0) in the resulting segmentation, but got {}"\
assert result_unique in expected_unique, \
"Wrong number of unique labels in the segmentation. Expected one of {}, but got {}"\
.format(expected_unique, len(numpy.unique(res)))

print("SUCCESS")

0 comments on commit f0b188f

Please sign in to comment.