From a4797c38b142c95d513d59a67bfacaaa42a208c6 Mon Sep 17 00:00:00 2001 From: Devon Hudson Date: Mon, 10 Jun 2024 14:24:53 -0600 Subject: [PATCH] Use Optional for param --- sygnal/gcmpushkin.py | 2 +- tests/test_gcm.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sygnal/gcmpushkin.py b/sygnal/gcmpushkin.py index 9388fadb..bbd97334 100644 --- a/sygnal/gcmpushkin.py +++ b/sygnal/gcmpushkin.py @@ -196,7 +196,7 @@ def __init__(self, name: str, sygnal: "Sygnal", config: Dict[str, Any]) -> None: "Config field fcm_options, if set, must be a dictionary of options" ) - def _load_credentials(self, proxy_url: str | None) -> None: + def _load_credentials(self, proxy_url: Optional[str]) -> None: self.credentials: Optional[Credentials] = None if self.api_version is APIVersion.V1: diff --git a/tests/test_gcm.py b/tests/test_gcm.py index 2ddc22c9..294d9b48 100644 --- a/tests/test_gcm.py +++ b/tests/test_gcm.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import json -from typing import TYPE_CHECKING, Any, AnyStr, Dict, List, Tuple +from typing import TYPE_CHECKING, Any, AnyStr, Dict, List, Optional, Tuple from unittest.mock import MagicMock from sygnal.gcmpushkin import APIVersion, GcmPushkin @@ -117,7 +117,7 @@ def preload_with_response( self.preloaded_response = DummyResponse(code) self.preloaded_response_payload = response_payload - def _load_credentials(self, proxy_url: str | None) -> None: + def _load_credentials(self, proxy_url: Optional[str]) -> None: if self.api_version is APIVersion.V1: self.credentials = TestCredentials() # type: ignore[assignment] self.google_auth_request = None # type: ignore[assignment]