Skip to content

Commit

Permalink
Exclude protocols from coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Oct 5, 2024
1 parent aa03580 commit c21b1fc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ source = [
[tool.coverage.report]
exclude_also = [
"^\\s*\\.\\.\\.$",
"class \\w+\\(Protocol\\)\\:",
"except AssertionError:",
"except ImportError:",
"if TYPE_CHECKING:",
Expand Down
21 changes: 21 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
Configure the tests.
Register the hypothesis 'exhaustive' profile to run 10 thousand examples.
Run this profile with ``pytest --hypothesis-profile=exhaustive``
"""

from hypothesis import HealthCheck
from hypothesis import settings

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])
2 changes: 1 addition & 1 deletion tests/hypothesis/geometry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_coordinates_repr_roundtrip(
id=st.one_of(st.none(), st.text(alphabet=string.printable)),
target_id=st.one_of(st.none(), st.text(alphabet=string.printable)),
extrude=st.one_of(st.none(), st.booleans()),
altitude_mode=st.one_of(st.none(), st.sampled_from(fastkml.enums.AltitudeMode)),
altitude_mode=st.one_of(st.none(), st.sampled_from(AltitudeMode)),
geometry=st.one_of(
st.none(),
points(srs=epsg4326),
Expand Down

0 comments on commit c21b1fc

Please sign in to comment.