diff --git a/tests/test_evented_model.py b/tests/test_evented_model.py index 5906cbd8..ebc6db41 100644 --- a/tests/test_evented_model.py +++ b/tests/test_evented_model.py @@ -202,13 +202,8 @@ class User(EventedModel): u1_id_events = Mock() u2_id_events = Mock() - with pytest.warns( - FutureWarning, - match="Accessing SignalInstance attribute 'connect' on a SignalGroup " - "is deprecated", - ): - user1.events.connect(user1_events) - user1.events.connect(user1_events) + user1.events.connect(user1_events) + user1.events.connect(user1_events) user1.events.id.connect(u1_id_events) user2.events.id.connect(u2_id_events) diff --git a/tests/test_group.py b/tests/test_group.py index 78f9a9e5..2e69401e 100644 --- a/tests/test_group.py +++ b/tests/test_group.py @@ -67,7 +67,13 @@ def test_signal_group_connect(direct: bool): group = MyGroup() if direct: # the callback wants the emitted arguments directly - group.all.connect_direct(mock) + + with pytest.warns( + FutureWarning, + match="Accessing SignalInstance attribute 'connect_direct' on a SignalGroup" + " is deprecated", + ): + group.connect_direct(mock) else: # the callback will receive an EmissionInfo tuple # (SignalInstance, arg_tuple) diff --git a/typesafety/test_group.yml b/typesafety/test_group.yml index e0033c01..5a71124e 100644 --- a/typesafety/test_group.yml +++ b/typesafety/test_group.yml @@ -13,9 +13,10 @@ reveal_type(T.e) # N: Revealed type is "psygnal._group_descriptor.SignalGroupDescriptor" reveal_type(t.e) # N: Revealed type is "psygnal._group.SignalGroup" reveal_type(t.e['x']) # N: Revealed type is "psygnal._signal.SignalInstance" + # TODO: change after removing getattr deprecation reveal_type(t.e.x) # N: Revealed type is "Any" - @t.e.x.connect + @t.e['x'].connect def func(x: int) -> None: pass