confluent-kafka-python
confluent-kafka-python copied to clipboard
Cannot Unit test producer that takes confluent_kafka.Producer as dependency
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()andconfluent_kafka.libversion()): - [ ] Apache Kafka broker version:
- [ ] Client configuration:
{...} - [ ] Operating system:
- [ ] Provide client logs (with
'debug': '..'as necessary) - [ ] Provide broker log excerpts
- [ ] Critical issue