Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Feb 15, 2024
1 parent d9b32b4 commit ff7cd83
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_evented_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import numpy as np
import pytest

from psygnal import SignalInstance

try:
import pydantic.version

Expand Down Expand Up @@ -245,3 +247,20 @@ class Foo:

assert get_evented_namespace(Foo) == "my_events"
assert is_evented(Foo)


def test_name_conflicts() -> None:
# https://github.com/pyapp-kit/psygnal/pull/269

@evented
@dataclass
class Foo:
name: str

obj = Foo("foo")
assert obj.name == "foo"
group = obj.events
assert isinstance(group, SignalGroup)
assert "name" in group
assert isinstance(group.name, SignalInstance)
assert group["name"] is group.name

0 comments on commit ff7cd83

Please sign in to comment.