Skip to content

Commit b847244

Browse files
committed
Fix CI
1 parent f9cc108 commit b847244

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

tests/test_Consumer.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,12 @@ def test_consumer_without_groupid():
329329
def test_callback_exception_no_system_error():
330330

331331
exception_raised = []
332-
332+
333333
def error_cb_that_raises(error):
334334
"""Error callback that raises an exception"""
335335
exception_raised.append(error)
336336
raise RuntimeError("Test exception from error_cb")
337-
337+
338338
# Create consumer with error callback that raises exception
339339
consumer = TestConsumer({
340340
'group.id': 'test-callback-systemerror-fix',
@@ -343,19 +343,19 @@ def error_cb_that_raises(error):
343343
'session.timeout.ms': 1000,
344344
'error_cb': error_cb_that_raises
345345
})
346-
346+
347347
consumer.subscribe(['test-topic'])
348-
348+
349349
# This should trigger the error callback due to connection failure
350350
# Before fix: Would get RuntimeError + SystemError
351351
# After fix: Should only get RuntimeError (no SystemError)
352352
with pytest.raises(RuntimeError) as exc_info:
353353
consumer.consume(timeout=0.1)
354-
354+
355355
# Verify we got the expected exception message
356356
assert "Test exception from error_cb" in str(exc_info.value)
357-
357+
358358
# Verify the error callback was actually called
359359
assert len(exception_raised) > 0
360-
360+
361361
consumer.close()

tests/test_Producer.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,30 +287,30 @@ def test_producer_bool_value():
287287

288288
def test_callback_exception_no_system_error():
289289
delivery_reports = []
290-
290+
291291
def delivery_cb_that_raises(err, msg):
292292
"""Delivery report callback that raises an exception"""
293293
delivery_reports.append((err, msg))
294294
raise RuntimeError("Test exception from delivery_cb")
295-
295+
296296
producer = Producer({
297297
'bootstrap.servers': 'nonexistent-broker:9092', # Will cause delivery failures
298298
'socket.timeout.ms': 100,
299299
'message.timeout.ms': 10, # Very short timeout to trigger delivery failure quickly
300300
'on_delivery': delivery_cb_that_raises
301301
})
302-
302+
303303
# Produce a message - this will trigger delivery report callback when it fails
304304
producer.produce('test-topic', value='test-message')
305-
305+
306306
# Flush to ensure delivery reports are processed
307-
# Before fix: Would get RuntimeError + SystemError
307+
# Before fix: Would get RuntimeError + SystemError
308308
# After fix: Should only get RuntimeError (no SystemError)
309309
with pytest.raises(RuntimeError) as exc_info:
310310
producer.flush(timeout=2.0) # Longer timeout to ensure delivery callback fires
311-
311+
312312
# Verify we got an exception from our callback
313313
assert "Test exception from delivery_cb" in str(exc_info.value)
314-
314+
315315
# Verify the delivery callback was actually called
316316
assert len(delivery_reports) > 0

0 commit comments

Comments
 (0)