Skip to content

Commit

Permalink
Improve disambiguators coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Dec 3, 2024
1 parent cbae84f commit dd7e821
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"CI", settings(suppress_health_check=[HealthCheck.too_slow]), deadline=None
)

if "CI" in os.environ:
if "CI" in os.environ: # pragma: nocover
settings.load_profile("CI")

unstructure_strats = one_of(just(s) for s in UnstructureStrategy)
5 changes: 1 addition & 4 deletions tests/test_disambiguators.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ class A:
assert fn({}) is A
assert fn(asdict(cl(*vals, **kwargs))) is cl

attr_names = {a.name for a in fields(cl)}

if "xyz" not in attr_names:
assert fn({"xyz": 1}) is A # Uses the fallback.
assert fn({"xyz": 1}) is A # Uses the fallback.


@settings(suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.too_slow])
Expand Down
2 changes: 1 addition & 1 deletion tests/untyped.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def gen_attr_names() -> Iterable[str]:
def _create_hyp_class(
attrs_and_strategy: list[tuple[_CountingAttr, st.SearchStrategy[PosArgs]]],
frozen=None,
):
) -> SearchStrategy[tuple]:
"""
A helper function for Hypothesis to generate attrs classes.
Expand Down

0 comments on commit dd7e821

Please sign in to comment.