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 13cb051
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
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 13cb051

Please sign in to comment.