@@ -148,7 +148,7 @@ async def test_service_specify_entity_id(hass, calls):
148148
149149 hass .bus .async_fire ("test_event" )
150150 await hass .async_block_till_done ()
151- assert 1 == len (calls )
151+ assert len (calls ) == 1
152152 assert ["hello.world" ] == calls [0 ].data .get (ATTR_ENTITY_ID )
153153
154154
@@ -170,7 +170,7 @@ async def test_service_specify_entity_id_list(hass, calls):
170170
171171 hass .bus .async_fire ("test_event" )
172172 await hass .async_block_till_done ()
173- assert 1 == len (calls )
173+ assert len (calls ) == 1
174174 assert ["hello.world" , "hello.world2" ] == calls [0 ].data .get (ATTR_ENTITY_ID )
175175
176176
@@ -192,10 +192,10 @@ async def test_two_triggers(hass, calls):
192192
193193 hass .bus .async_fire ("test_event" )
194194 await hass .async_block_till_done ()
195- assert 1 == len (calls )
195+ assert len (calls ) == 1
196196 hass .states .async_set ("test.entity" , "hello" )
197197 await hass .async_block_till_done ()
198- assert 2 == len (calls )
198+ assert len (calls ) == 2
199199
200200
201201async def test_trigger_service_ignoring_condition (hass , calls ):
@@ -268,17 +268,17 @@ async def test_two_conditions_with_and(hass, calls):
268268 hass .states .async_set (entity_id , 100 )
269269 hass .bus .async_fire ("test_event" )
270270 await hass .async_block_till_done ()
271- assert 1 == len (calls )
271+ assert len (calls ) == 1
272272
273273 hass .states .async_set (entity_id , 101 )
274274 hass .bus .async_fire ("test_event" )
275275 await hass .async_block_till_done ()
276- assert 1 == len (calls )
276+ assert len (calls ) == 1
277277
278278 hass .states .async_set (entity_id , 151 )
279279 hass .bus .async_fire ("test_event" )
280280 await hass .async_block_till_done ()
281- assert 1 == len (calls )
281+ assert len (calls ) == 1
282282
283283
284284async def test_automation_list_setting (hass , calls ):
@@ -302,11 +302,11 @@ async def test_automation_list_setting(hass, calls):
302302
303303 hass .bus .async_fire ("test_event" )
304304 await hass .async_block_till_done ()
305- assert 1 == len (calls )
305+ assert len (calls ) == 1
306306
307307 hass .bus .async_fire ("test_event_2" )
308308 await hass .async_block_till_done ()
309- assert 2 == len (calls )
309+ assert len (calls ) == 2
310310
311311
312312async def test_automation_calling_two_actions (hass , calls ):
@@ -368,15 +368,15 @@ async def test_shared_context(hass, calls):
368368 assert event_mock .call_count == 2
369369
370370 # Verify automation triggered evenet for 'hello' automation
371- args , kwargs = event_mock .call_args_list [0 ]
371+ args , _ = event_mock .call_args_list [0 ]
372372 first_trigger_context = args [0 ].context
373373 assert first_trigger_context .parent_id == context .id
374374 # Ensure event data has all attributes set
375375 assert args [0 ].data .get (ATTR_NAME ) is not None
376376 assert args [0 ].data .get (ATTR_ENTITY_ID ) is not None
377377
378378 # Ensure context set correctly for event fired by 'hello' automation
379- args , kwargs = first_automation_listener .call_args
379+ args , _ = first_automation_listener .call_args
380380 assert args [0 ].context is first_trigger_context
381381
382382 # Ensure the 'hello' automation state has the right context
@@ -385,7 +385,7 @@ async def test_shared_context(hass, calls):
385385 assert state .context is first_trigger_context
386386
387387 # Verify automation triggered evenet for 'bye' automation
388- args , kwargs = event_mock .call_args_list [1 ]
388+ args , _ = event_mock .call_args_list [1 ]
389389 second_trigger_context = args [0 ].context
390390 assert second_trigger_context .parent_id == first_trigger_context .id
391391 # Ensure event data has all attributes set
0 commit comments