confluentinc / confluent-kafka-python

Confluent's Kafka Python Client
http://docs.confluent.io/current/clients/confluent-kafka-python
Other
3.72k stars 882 forks source link

Cannot Unit test producer that takes confluent_kafka.Producer as dependency #1738

Open dineshkumare5 opened 1 month ago

dineshkumare5 commented 1 month ago

Description

confluent_kafka.Producer class has Owner. This is making any class that takes a dependency on Producer not testable.

How to reproduce

Create a class that takes dependency on Producer object. The Producer object cannot be mocked.

Checklist

Please provide the following information: