diff --git a/tests/test-pathencode.py b/tests/test-pathencode.py --- a/tests/test-pathencode.py +++ b/tests/test-pathencode.py @@ -125,7 +125,8 @@ def makepart(rng, k): p = pickfrom(rng, firsttable)(rng) l = len(p) ps = [p] - while l < k: + maxl = rng.randint(1, k) + while l < maxl: p = pickfrom(rng, resttable)(rng) l += len(p) ps.append(p)