Skip to content

Commit 35a5e61

Browse files
committed
Better test docstrings.
1 parent df32990 commit 35a5e61

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/test_priority.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,19 @@ def test_stream_repr(self):
4242
assert repr(s) == "Stream<id=80, weight=16>"
4343

4444

45-
class TestPriorityTree(object):
45+
class TestPriorityTreeOutput(object):
46+
"""
47+
These tests use Hypothesis to attempt to bound the output of iterating over
48+
the priority tree. In particular, their goal is to ensure that the output
49+
of the tree is "good enough": that it meets certain requirements on
50+
fairness and equidistribution.
51+
"""
4652
@given(STREAMS_AND_WEIGHTS)
4753
def test_period_of_repetition(self, streams_and_weights):
4854
"""
49-
The period of repetition of a priority sequence is given by the
50-
formula: sum(weights) / gcd(weights). Once that many values have been
51-
pulled out, the sequence should repeat identically.
55+
The period of repetition of a priority sequence is given by the sum of
56+
the weights of the streams. Once that many values have been pulled out
57+
the sequence repeats identically.
5258
"""
5359
p = priority.PriorityTree()
5460
weights = []

0 commit comments

Comments
 (0)