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

[async rest] Add coverage for the import error raised within the async rest transport layer. #2200

Open
ohmayr opened this issue Sep 27, 2024 · 0 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.

Comments

@ohmayr
Copy link
Contributor

ohmayr commented Sep 27, 2024

Add unit test coverage for the following import error within rest_asyncio.py. file:

try:
    import aiohttp # type: ignore
    from google.auth.aio.transport.sessions import AsyncAuthorizedSession # type: ignore
    from google.api_core import rest_streaming_async # type: ignore
{# NOTE: `pragma: NO COVER` is needed since the coverage for presubmits isn't combined. #}
except ImportError as e:  # pragma: NO COVER
    raise ImportError("`rest_asyncio` transport requires the library to be installed with the `async_rest` extra. Install the library with the `async_rest` extra using `pip install {{ api.naming.warehouse_package_name }}[async_rest]`") from e

We want to make sure the error is raised to the user correctly if they don't have the right deps installed.

@vchudnov-g vchudnov-g assigned ohmayr and unassigned parthea Sep 27, 2024
@vchudnov-g vchudnov-g added type: process A process-related concern. May include testing, release, or the like. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Sep 27, 2024
@vchudnov-g vchudnov-g changed the title Add coverage for the import error raised within the async rest transport layer. [async rest] Add coverage for the import error raised within the async rest transport layer. Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

3 participants