Skip to content

Commit 8263f59

Browse files
authored
Mark googke-auth as untyped (#1181)
1 parent 09ff0e4 commit 8263f59

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

google_nest_sdm/google_nest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def CreateCreds(args: argparse.Namespace) -> Credentials:
155155
# If there are no (valid) credentials available, let the user log in.
156156
if not creds or not creds.valid:
157157
if creds and creds.expired and creds.refresh_token:
158-
creds.refresh(Request())
158+
creds.refresh(Request()) # type: ignore[no-untyped-call]
159159
else:
160160
if not args.client_id or not args.client_secret:
161161
raise ValueError("Required flag --client_id or --client_secret missing")
@@ -182,7 +182,7 @@ def CreateCreds(args: argparse.Namespace) -> Credentials:
182182
raise
183183
with open(token_cache, "wb") as token:
184184
pickle.dump(creds, token)
185-
return creds
185+
return creds # type: ignore[no-untyped-call]
186186

187187

188188
def PrintStructure(structure: Structure, output_type: str) -> None:

google_nest_sdm/subscriber_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def refresh_creds(creds: Credentials) -> Credentials:
3838
This is not part of the subscriber API, exposed only to facilitate testing.
3939
"""
4040
try:
41-
creds.refresh(Request())
41+
creds.refresh(Request()) # type: ignore[no-untyped-call]
4242
except RefreshError as err:
4343
raise AuthException(f"Authentication refresh failure: {err}") from err
4444
except TransportError as err:
@@ -165,7 +165,7 @@ async def _async_get_client(self) -> pubsub_v1.SubscriberAsyncClient:
165165
DIAGNOSTICS.increment("create_subscription.creds_error")
166166
raise AuthException(f"Access token failure: {err}") from err
167167
_LOGGER.debug("Credentials refreshed, new expiry %s", creds.expiry)
168-
self._creds = creds
168+
self._creds = creds # type: ignore[no-untyped-call]
169169
self._client = pubsub_v1.SubscriberAsyncClient(credentials=self._creds)
170170
return self._client
171171

tests/test_subscriber_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ async def test_refresh_creds() -> None:
3131
@pytest.mark.parametrize(
3232
("raised", "expected"),
3333
[
34-
(RefreshError(), AuthException),
35-
(TransportError(), SubscriberException),
36-
(GoogleAuthError(), SubscriberException),
34+
(RefreshError(), AuthException), # type: ignore[no-untyped-call]
35+
(TransportError(), SubscriberException), # type: ignore[no-untyped-call]
36+
(GoogleAuthError(), SubscriberException), # type: ignore[no-untyped-call]
3737
],
3838
)
3939
async def test_refresh_creds_error(raised: Exception, expected: Any) -> None:

0 commit comments

Comments
 (0)