Skip to content

Commit dd7e821

Browse files
committed
Improve disambiguators coverage
1 parent cbae84f commit dd7e821

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"CI", settings(suppress_health_check=[HealthCheck.too_slow]), deadline=None
1010
)
1111

12-
if "CI" in os.environ:
12+
if "CI" in os.environ: # pragma: nocover
1313
settings.load_profile("CI")
1414

1515
unstructure_strats = one_of(just(s) for s in UnstructureStrategy)

tests/test_disambiguators.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ class A:
130130
assert fn({}) is A
131131
assert fn(asdict(cl(*vals, **kwargs))) is cl
132132

133-
attr_names = {a.name for a in fields(cl)}
134-
135-
if "xyz" not in attr_names:
136-
assert fn({"xyz": 1}) is A # Uses the fallback.
133+
assert fn({"xyz": 1}) is A # Uses the fallback.
137134

138135

139136
@settings(suppress_health_check=[HealthCheck.filter_too_much, HealthCheck.too_slow])

tests/untyped.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def gen_attr_names() -> Iterable[str]:
167167
def _create_hyp_class(
168168
attrs_and_strategy: list[tuple[_CountingAttr, st.SearchStrategy[PosArgs]]],
169169
frozen=None,
170-
):
170+
) -> SearchStrategy[tuple]:
171171
"""
172172
A helper function for Hypothesis to generate attrs classes.
173173

0 commit comments

Comments
 (0)