| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This pull request updates the unit tests for both the publisher and subscriber clients to handle internal changes in the google-api-core library's _GapicCallable. Specifically, it safely retrieves metadata from wrapped methods by falling back to _default_metadata if _metadata is not present. Additionally, some minor import cleanups were performed. There are no review comments, and I have no feedback to provide.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Problem
The test_init_default_client_info tests in google-cloud-pubsub (for both Publisher and Subscriber) were brittle because they peeked into the private internal attributes of _GapicCallable (from google-api-core) to verify metadata.
Recent refactoring in google-api-core renamed/removed the _metadata attribute, causing these tests to fail with AttributeError: '_GapicCallable' object has no attribute '_metadata'.
Solution
Refactored test_init_default_client_info in test_publisher_client.py and test_subscriber_client.py to use mocking instead of peeking into internal state.
Why this is important
Blocks: #17642