@@ -840,6 +840,7 @@ async def test_force_commit(self, *, consumer):
840840 async def test_commit_tps (self , * , consumer ):
841841 consumer ._handle_attached = AsyncMock (name = "_handle_attached" )
842842 consumer ._commit_offsets = AsyncMock (name = "_commit_offsets" )
843+ consumer .app .producer .flush = AsyncMock ()
843844 consumer ._filter_committable_offsets = Mock (name = "filt" )
844845 consumer ._filter_committable_offsets .return_value = {
845846 TP1 : 4 ,
@@ -942,6 +943,7 @@ async def test_handle_attached(self, *, consumer):
942943 async def test_commit_offsets (self , * , consumer ):
943944 consumer ._commit = AsyncMock (name = "_commit" )
944945 consumer .current_assignment .update ({TP1 , TP2 })
946+ consumer .app .producer .flush = AsyncMock ()
945947 await consumer ._commit_offsets (
946948 {
947949 TP1 : 3003 ,
@@ -959,6 +961,7 @@ async def test_commit_offsets(self, *, consumer):
959961 async def test_commit_offsets__did_not_commit (self , * , consumer ):
960962 consumer .in_transaction = False
961963 consumer ._commit = AsyncMock (return_value = False )
964+ consumer .app .producer .flush = AsyncMock ()
962965 consumer .current_assignment .update ({TP1 , TP2 })
963966 consumer .app .tables = Mock (name = "app.tables" )
964967 await consumer ._commit_offsets (
@@ -973,6 +976,7 @@ async def test_commit_offsets__did_not_commit(self, *, consumer):
973976 @pytest .mark .asyncio
974977 async def test_commit_offsets__in_transaction (self , * , consumer ):
975978 consumer .in_transaction = True
979+ consumer .app .producer .flush = AsyncMock ()
976980 consumer .transactions .commit = AsyncMock ()
977981 consumer .current_assignment .update ({TP1 , TP2 })
978982 ret = await consumer ._commit_offsets (
@@ -991,6 +995,7 @@ async def test_commit_offsets__in_transaction(self, *, consumer):
991995 @pytest .mark .asyncio
992996 async def test_commit_offsets__no_committable_offsets (self , * , consumer ):
993997 consumer .current_assignment .clear ()
998+ consumer .app .producer .flush = AsyncMock ()
994999 assert not await consumer ._commit_offsets (
9951000 {
9961001 TP1 : 3003 ,
0 commit comments