Skip to content

Commit

Permalink
Better check for surprising change in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed Sep 13, 2018
1 parent bb127e2 commit 648af24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ def choice(seq=None, p=None, temperature=None, index=False):
>>> bin = [0, 0]
>>> for i in range(1000):
... bin[choice([0, 1], p=[0.4, 0.6], temperature=100.0)] += 1
>>> assert abs(bin[0] - bin[1]) == 50, "%s == %s" % (bin[0], bin[1])
>>> assert abs(bin[0] - bin[1]) <= 50, "%s <= 50" % abs(bin[0] - bin[1])
"""
if seq is None and p is None:
raise Exception("seq and p can't both be None")
Expand Down

0 comments on commit 648af24

Please sign in to comment.