Skip to content

Commit 3135692

Browse files
committed
Updated attribute handler test to use mock
1 parent 54245b2 commit 3135692

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_attribute.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ async def test_handler_initialise(mocker: MockerFixture):
7070
handler_mock = mocker.patch.object(handler, "initialise")
7171
attr = AttrR(Int(), handler=handler)
7272

73-
await attr.initialise(mocker.ANY)
73+
ctrlr = mocker.Mock()
74+
await attr.initialise(ctrlr)
7475

7576
# The handler initialise method should be called from the attribute
76-
handler_mock.assert_called_once_with(mocker.ANY)
77+
handler_mock.assert_called_once_with(ctrlr)
7778

7879
handler = SimpleHandler()
7980
attr = AttrW(Int(), handler=handler)

0 commit comments

Comments
 (0)