Skip to content

Commit f6869fe

Browse files
committed
hypothesis: Better CI profile
1 parent a90ac1b commit f6869fe

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Run Tests
6363
id: status
6464
run: |
65-
pytest -n auto --cov=./ --cov-report=xml
65+
pytest -n auto --cov=./ --cov-report=xml --hypothesis-profile ci
6666
- name: Upload code coverage to Codecov
6767
uses: codecov/[email protected]
6868
with:

tests/conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
import pytest
2+
from hypothesis import HealthCheck, settings
23

34
from . import requires_numba, requires_numbagg
45

6+
settings.register_profile(
7+
"ci",
8+
max_examples=1000,
9+
deadline=None,
10+
suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.too_slow],
11+
)
12+
settings.register_profile(
13+
"local",
14+
max_examples=300,
15+
suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.too_slow],
16+
)
17+
518

619
@pytest.fixture(
720
scope="module",

tests/test_properties.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import hypothesis.extra.numpy as npst
99
import hypothesis.strategies as st
1010
import numpy as np
11-
from hypothesis import HealthCheck, assume, given, note, settings
11+
from hypothesis import assume, given, note
1212

1313
import flox
1414
from flox.core import groupby_reduce, groupby_scan
@@ -79,9 +79,6 @@ def not_overflowing_array(array) -> bool:
7979
return result
8080

8181

82-
@settings(
83-
max_examples=300, suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.too_slow]
84-
)
8582
@given(
8683
array=npst.arrays(
8784
elements={"allow_subnormal": False}, shape=npst.array_shapes(), dtype=array_dtype_st
@@ -170,11 +167,6 @@ def chunked_arrays(
170167
return from_array(array, chunks=("auto",) * (array.ndim - 1) + (chunks,))
171168

172169

173-
@settings(
174-
max_examples=300,
175-
deadline=None,
176-
suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.too_slow],
177-
)
178170
@given(
179171
data=st.data(),
180172
array=chunked_arrays(),
@@ -212,7 +204,6 @@ def test_scans(data, array, func):
212204
assert_equal(actual, expected, tolerance)
213205

214206

215-
@settings(suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.too_slow])
216207
@given(data=st.data(), array=chunked_arrays())
217208
def test_ffill_bfill_reverse(data, array):
218209
assume(not_overflowing_array(np.asarray(array)))

0 commit comments

Comments
 (0)