Skip to content

Commit

Permalink
Tighten test to ensure coverage
Browse files Browse the repository at this point in the history
Reducing the number of possible elements ensures that the unique-with-explicit-fill code is fully excercised.
  • Loading branch information
Zac-HD committed Sep 17, 2018
1 parent 6eede4a commit 6c89b37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hypothesis-python/tests/numpy/test_gen_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import hypothesis.strategies as st
import hypothesis.extra.numpy as nps
from hypothesis import given, assume, settings
from hypothesis import HealthCheck, given, assume, settings
from hypothesis.errors import InvalidArgument
from tests.common.debug import minimal, find_any
from tests.common.utils import checks_deprecated_behaviour
Expand Down Expand Up @@ -240,8 +240,9 @@ def test_may_fill_with_nan_when_unique_is_set():


def test_is_still_unique_with_nan_fill():
@settings(suppress_health_check=HealthCheck.all())
@given(nps.arrays(
dtype=float, elements=st.floats(allow_nan=False), shape=10,
dtype=float, elements=st.integers(0, 9), shape=10,
unique=True, fill=st.just(float('nan'))))
def test(xs):
assert len(set(xs)) == len(xs)
Expand Down

0 comments on commit 6c89b37

Please sign in to comment.