googleapis / googleapis/google-cloud-python

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

Offen
#16,260 1 Kommentar 0 Reaktionen 1 zugewiesene Person Zugewiesen an @ohmayr Auf GitHub ansehen
priority: p2 type: process
Vorherrschende Sprache
Python
Sterne
5.4k
Forks
1.8k
Ø Merge
3 T. 4 Std.
Gemergte PRs (30 T.)
122

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.