File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 26
26
27
27
@pytest .fixture
28
28
def client (conn ):
29
- return KafkaClient (api_version = (0 , 9 ))
29
+ cli = KafkaClient (api_version = (0 , 9 ))
30
+ yield cli
31
+ cli .close ()
30
32
31
33
@pytest .fixture
32
34
def coordinator (client ):
33
- return ConsumerCoordinator (client , SubscriptionState (), Metrics ())
35
+ c = ConsumerCoordinator (client , SubscriptionState (), Metrics ())
36
+ yield c
37
+ c .close ()
34
38
35
39
36
40
def test_init (client , coordinator ):
@@ -400,6 +404,8 @@ def patched_coord(mocker, coordinator):
400
404
return_value = 1 )
401
405
mocker .patch .object (coordinator ._client , 'ready' , return_value = True )
402
406
mocker .patch .object (coordinator ._client , 'send' )
407
+ mocker .patch .object (coordinator , '_start_heartbeat_thread' )
408
+ mocker .patch .object (coordinator , '_close_heartbeat_thread' )
403
409
mocker .spy (coordinator , '_failed_request' )
404
410
mocker .spy (coordinator , '_handle_offset_commit_response' )
405
411
mocker .spy (coordinator , '_handle_offset_fetch_response' )
You can’t perform that action at this time.
0 commit comments