Skip to content

Commit

Permalink
*Really* allow community asyn_lpa test to have two answers (#2341)
Browse files Browse the repository at this point in the history
Fail more clearly in test_asyn_lpa, using nosetests asserts.
Note that: set(frozenset(iterable)) == set(iterable)
  • Loading branch information
aryamccarthy authored and dschult committed Dec 24, 2016
1 parent 0f926bc commit 5027566
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions networkx/algorithms/community/tests/test_asyn_lpa.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nose.tools import assert_equal
from nose.tools import assert_equal, assert_in
from networkx import asyn_lpa, Graph


Expand Down Expand Up @@ -107,4 +107,4 @@ def test_two_communities():
communities = asyn_lpa.asyn_lpa_communities(test)
result = {frozenset(c) for c in communities}
# probabilitistic result could be all nodes in one community. So test result is either.
assert(result in [ground_truth, set(frozenset(range(16)))])
assert_in(result, [ground_truth, {frozenset(range(16))}])

0 comments on commit 5027566

Please sign in to comment.