Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dferrochio committed May 16, 2024
1 parent 3df70cd commit a333099
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,4 @@ def test_producer_flush(self) -> None:
producer = instrumentation.instrument_producer(producer)
producer.produce(topic="topic-1", key="key-1", value="value-1")
msg = producer.flush()
self.assertIsNotNone(msg)
self.assertIsNotNone(msg)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from confluent_kafka import Consumer, Producer
from typing import Optional

from confluent_kafka import Consumer, Producer


class MockConsumer(Consumer):
def __init__(self, queue, config):
self._queue = queue
Expand All @@ -21,14 +23,14 @@ def poll(self, timeout=None):

class MockedMessage:
def __init__(
self,
topic: str,
partition: int,
offset: int,
headers,
key: Optional[str]=None,
value=Optional[str]=None
):
self,
topic: str,
partition: int,
offset: int,
headers,
key: Optional[str] = None,
value: Optional[str] = None,
):
self._topic = topic
self._partition = partition
self._offset = offset
Expand Down Expand Up @@ -70,12 +72,12 @@ def produce(
offset=0,
headers=[],
key=kwargs.get("key"),
value=kwargs.get("value")
value=kwargs.get("value"),
)
)

def poll(self, timeout=None):
def poll(self, *args, **kwargs):
return len(self._queue)

def flush(self, timeout=None):
def flush(self, *args, **kwargs):
return len(self._queue)

0 comments on commit a333099

Please sign in to comment.