confluent-kafka-python icon indicating copy to clipboard operation
confluent-kafka-python copied to clipboard

Cannot Unit test producer that takes confluent_kafka.Producer as dependency

Open dineshkumare5 opened this issue 1 year ago • 0 comments

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:

  • [x] confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()):
  • [ ] Apache Kafka broker version:
  • [ ] Client configuration: {...}
  • [ ] Operating system:
  • [ ] Provide client logs (with 'debug': '..' as necessary)
  • [ ] Provide broker log excerpts
  • [ ] Critical issue

dineshkumare5 avatar May 06 '24 11:05 dineshkumare5