diff --git a/.github/workflows/run-all-tests.yml b/.github/workflows/run-all-tests.yml index b1602d8..948dce2 100644 --- a/.github/workflows/run-all-tests.yml +++ b/.github/workflows/run-all-tests.yml @@ -44,7 +44,7 @@ jobs: python -m pip install -e ".[tests]" - name: Test with pytest including hypothesis tests run: >- - pytest tests + pytest tests --hypothesis-profile=ci test-coverage: runs-on: ubuntu-latest diff --git a/tests/conftest.py b/tests/conftest.py index 7a4dc90..b54dbc5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,9 +8,14 @@ from hypothesis import HealthCheck from hypothesis import settings -settings.register_profile("exhaustive", max_examples=10_000) +settings.register_profile( + "exhaustive", + max_examples=10_000, + suppress_health_check=[HealthCheck.too_slow], +) settings.register_profile( "coverage", max_examples=10, suppress_health_check=[HealthCheck.too_slow], ) +settings.register_profile("ci", suppress_health_check=[HealthCheck.too_slow]) diff --git a/tests/hypothesis/test_functions.py b/tests/hypothesis/test_functions.py index 6a7ce69..7e42ded 100644 --- a/tests/hypothesis/test_functions.py +++ b/tests/hypothesis/test_functions.py @@ -18,7 +18,9 @@ coords=st.one_of( st.lists( st.tuples( - st.floats(allow_subnormal=False), + st.floats( + allow_subnormal=False, + ), st.floats(allow_subnormal=False), ), ), @@ -41,7 +43,7 @@ def test_fuzz_centroid( if area == 0 or math.isnan(area): assert math.isnan(center[0]) assert math.isnan(center[1]) - else: + else: # pragma: no cover assert isinstance(center[0], float) assert isinstance(center[1], float) assert len(center) == 2 @@ -196,8 +198,18 @@ def test_fuzz_compare_geo_interface( @given( points=st.lists( st.tuples( - st.floats(allow_nan=False, allow_infinity=False, allow_subnormal=False), - st.floats(allow_nan=False, allow_infinity=False, allow_subnormal=False), + st.floats( + allow_nan=False, + allow_infinity=False, + allow_subnormal=False, + width=32, + ), + st.floats( + allow_nan=False, + allow_infinity=False, + allow_subnormal=False, + width=32, + ), ), ), )