enable errors on callbacks in testing. fix broken test.

This commit is contained in:
Zack Dever
2016-04-25 14:48:50 -07:00
parent 0300edb353
commit 87e71b4e78
2 changed files with 4 additions and 1 deletions

View File

@@ -15,3 +15,6 @@ except ImportError:
pass
logging.getLogger(__name__).addHandler(NullHandler())
from kafka.future import Future
Future.error_on_callbacks = True # always fail during testing

View File

@@ -548,7 +548,7 @@ def test_send_offset_fetch_request_success(patched_coord, partitions):
patched_coord._client.send.return_value = _f
future = patched_coord._send_offset_fetch_request(partitions)
(node, request), _ = patched_coord._client.send.call_args
response = OffsetFetchResponse[0]([('foobar', [(0, 0), (1, 0)])])
response = OffsetFetchResponse[0]([('foobar', [(0, 123, b'', 0), (1, 234, b'', 0)])])
_f.success(response)
patched_coord._handle_offset_fetch_response.assert_called_with(
future, response)