Skip to content

Commit c044d28

Browse files
committed
more explicit assertions for old test
1 parent 276aed7 commit c044d28

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

hypothesis-python/tests/cover/test_simple_collections.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,8 @@ def test_dictionaries_of_fixed_length(n):
122122

123123
@pytest.mark.parametrize("n", range(10))
124124
def test_lists_of_lower_bounded_length(n):
125-
x = minimal(lists(integers(), min_size=n), lambda x: sum(x) >= 2 * n)
126-
assert n <= len(x) <= 2 * n
127-
assert all(t >= 0 for t in x)
128-
assert len(x) == n or all(t > 0 for t in x)
129-
assert sum(x) == 2 * n
125+
l = minimal(lists(integers(), min_size=n), lambda x: sum(x) >= 2 * n)
126+
assert l == [] if n == 0 else [0] * (n - 1) + [n * 2]
130127

131128

132129
@flaky(min_passes=1, max_runs=3)

0 commit comments

Comments
 (0)