From 7609a6e83a6488262a0fe02e0850dc294a729758 Mon Sep 17 00:00:00 2001
From: Dmitry Balabka <dmitry.balabka@ecentria.com>
Date: Thu, 19 Sep 2024 19:02:24 +0300
Subject: [PATCH] Fix tests

---
 dask_cloudprovider/gcp/instances.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dask_cloudprovider/gcp/instances.py b/dask_cloudprovider/gcp/instances.py
index 09fee60d..0f9ff17c 100644
--- a/dask_cloudprovider/gcp/instances.py
+++ b/dask_cloudprovider/gcp/instances.py
@@ -673,7 +673,10 @@ def refresh_client(self):
             import google.auth
 
             # Obtain Application Default Credentials
-            credentials, _ = google.auth.default()
+            try:
+                credentials, _ = google.auth.default()
+            except google.auth.exceptions.DefaultCredentialsError:
+                credentials = None
 
         # Use the credentials to build a service client
         return googleapiclient.discovery.build(