Skip to content

Commit

Permalink
TST: increase number of hypothesis examples per test run to 500
Browse files Browse the repository at this point in the history
  • Loading branch information
qwhelan committed Feb 16, 2020
1 parent 61eea5a commit cd72634
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions bottleneck/tests/reduce_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
)


hy_array_gen = hy_arrays(
dtype=one_of(integer_dtypes(sizes=(32, 64)), floating_dtypes(sizes=(32, 64))),
shape=array_shapes(),
)


def _hypothesis_helper(func, array, skip_all_nans=False):
slow_func = eval("bn.slow.%s" % func.__name__)
ndim = array.ndim
Expand Down Expand Up @@ -57,23 +63,15 @@ def _hypothesis_helper(func, array, skip_all_nans=False):
@pytest.mark.parametrize(
"func", (bn.nanmin, bn.nanmax, bn.anynan, bn.allnan), ids=lambda x: x.__name__
)
@hypothesis.given(
array=hy_arrays(
dtype=one_of(integer_dtypes(sizes=(32, 64)), floating_dtypes(sizes=(32, 64))),
shape=array_shapes(),
)
)
@hypothesis.given(array=hy_array_gen)
@hypothesis.settings(max_examples=500)
def test_reduce_hypothesis(func, array):
_hypothesis_helper(func, array)


@pytest.mark.parametrize("func", (bn.nanargmin, bn.nanargmax), ids=lambda x: x.__name__)
@hypothesis.given(
array=hy_arrays(
dtype=one_of(integer_dtypes(sizes=(32, 64)), floating_dtypes(sizes=(32, 64))),
shape=array_shapes(),
)
)
@hypothesis.given(array=hy_array_gen)
@hypothesis.settings(max_examples=500)
def test_reduce_hypothesis_errata(func, array):
_hypothesis_helper(func, array, skip_all_nans=True)

Expand Down

0 comments on commit cd72634

Please sign in to comment.