Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AsyncTestCase.published_messages #36

Merged
merged 1 commit into from Sep 14, 2020
Merged

Fix AsyncTestCase.published_messages #36

merged 1 commit into from Sep 14, 2020

Conversation

nvllsvm
Copy link
Contributor

@nvllsvm nvllsvm commented Sep 14, 2020

The current implementation expects all calls to publish_message to be
made with kwargs. Calling publish_message with positional arguments or a
mix of the two results in an exception. For example, KeyError: 'exchange'
is raised when the call was made solely with positional arguments. Ex.

self.publish_message('a', 'b', 'c', 'd')

Specifically, https://github.com/gmr/avroconsumer/blob/master/avroconsumer.py#L85-L87

The fixed implmentation simply expands both args and kwargs.

Tested in python 3.7 and 3.8

The current implementation expects all calls to publish_message to be
made with kwargs. Calling publish_message with positional arguments or a
mix of the two results in an exception. For example, `KeyError: 'exchange'`
is raised when the call was made solely with positional arguments. Ex.

    self.publish_message('a', 'b', 'c', 'd')

The fixed implmentation simply expands both args and kwargs.

Tested in python 3.7 and 3.8
@gmr gmr merged commit 9cf1a43 into gmr:3.20 Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants