Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Nov 21, 2024
1 parent 7e2984b commit d5ef19f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/psygnal/_evented_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class Config:
f"{prop!r} is not."
)
for field in fields:
if not hasattr(cls, field):
if field not in model_fields and not hasattr(cls, field):
warnings.warn(
f"property {prop!r} cannot depend on unrecognized attribute "
f"name: {field!r}",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_evented_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ class Config:


def test_unrecognized_property_dependencies():
with pytest.warns(UserWarning, match="Unrecognized field dependency: 'b'"):
with pytest.warns(UserWarning, match="cannot depend on unrecognized attribute"):

class M(EventedModel):
x: int
Expand Down

0 comments on commit d5ef19f

Please sign in to comment.