Skip to content

Commit dac2bef

Browse files
committed
fix flake8
1 parent 7fe4e3f commit dac2bef

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tests/common/_async/consumer.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
if sys.version_info >= (3, 11):
2121
from asyncio import timeout
2222
else:
23-
from async_timeout import timeout
23+
from async_timeout import timeout # noqa: F401
2424

2525
from confluent_kafka.cimpl import Consumer
2626
from confluent_kafka.error import ConsumeError, KeyDeserializationError, ValueDeserializationError
@@ -48,9 +48,9 @@ def __aiter__(self):
4848
async def __anext__(self):
4949
return await self.poll(None)
5050

51-
async def poll(self, timeout: int = -1):
52-
timeout = None if timeout == -1 else timeout
53-
async with asyncio.timeout(timeout):
51+
async def poll(self, poll_timeout: int = -1):
52+
poll_timeout = None if poll_timeout == -1 else poll_timeout
53+
async with asyncio.timeout(poll_timeout):
5454
while True:
5555
# Zero timeout here is what makes it non-blocking
5656
msg = super().poll(0)
@@ -67,8 +67,8 @@ def __init__(self, conf):
6767
self._value_deserializer = conf_copy.pop('value.deserializer', None)
6868
super().__init__(conf_copy)
6969

70-
async def poll(self, timeout=-1):
71-
msg = await super().poll(timeout)
70+
async def poll(self, poll_timeout=-1):
71+
msg = await super().poll(poll_timeout)
7272

7373
if msg is None:
7474
return None
@@ -96,7 +96,7 @@ async def poll(self, timeout=-1):
9696
msg.set_value(value)
9797
return msg
9898

99-
def consume(self, num_messages=1, timeout=-1):
99+
def consume(self, num_messages=1, consume_timeout=-1):
100100
"""
101101
:py:func:`Consumer.consume` not implemented, use
102102
:py:func:`DeserializingConsumer.poll` instead

tests/integration/integration_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def verify_producer():
213213
# Global variable to track garbage collection of suppressed on_delivery callbacks
214214
DrOnlyTestSuccess_gced = 0
215215

216+
216217
@pytest.mark.skip(reason="This test must be run as a standalone script")
217218
def test_producer_dr_only_error():
218219
"""

0 commit comments

Comments
 (0)