Skip to content

Commit

Permalink
fix(TestStreamClient): remove unused/unclosed mock producer (#74)
Browse files Browse the repository at this point in the history
TestStreamClient sets the producer_class to start the mock producer on startup. If a mock producer is created beforehand it is immediately overwritten and leaves an unclosed producer, raising error logs from aiokafka.
  • Loading branch information
JeroennC authored Nov 2, 2022
1 parent 47cf4d3 commit cf69bf1
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions kstreams/test_utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ def mock_streams(self) -> None:
for stream in streams:
stream.consumer_class = TestConsumer

def mock_producer(self) -> None:
producer = TestProducer()
self.stream_engine._producer = producer

def setup_mocks(self) -> None:
self.mock_producer()
self.mock_streams()

async def start(self) -> None:
Expand Down

0 comments on commit cf69bf1

Please sign in to comment.