[med-svn] [Git][med-team/snakemake][main] fix skipping test if no google.auth

Rebecca N. Palmer (@rnpalmer-guest) gitlab at salsa.debian.org
Sun Nov 12 14:02:58 GMT 2023



Rebecca N. Palmer pushed to branch main at Debian Med / snakemake


Commits:
f2169307 by Rebecca N. Palmer at 2023-11-12T14:01:14+00:00
fix skipping test if no google.auth

- - - - -


1 changed file:

- debian/patches/0009-skip-test-without-google-cloud-sdk.patch


Changes:

=====================================
debian/patches/0009-skip-test-without-google-cloud-sdk.patch
=====================================
@@ -42,7 +42,7 @@ Forwarded: not-needed
 +        print("skipping test_remote_gs because we are not authenticated with gcloud")
 --- a/tests/test_google_lifesciences.py
 +++ b/tests/test_google_lifesciences.py
-@@ -2,9 +2,13 @@ import os
+@@ -2,18 +2,23 @@ import os
  import requests
  import sys
  import tempfile
@@ -53,8 +53,21 @@ Forwarded: not-needed
 +try:
 +    import google.auth
 +    from google.cloud import storage
++    def has_google_credentials():
++        credentials, _ = google.auth.default()
++        return credentials
 +except ImportError:
-+    pass # will skip due to no credentials
++    def has_google_credentials():
++        return False # will skip due to no credentials
  
  sys.path.insert(0, os.path.dirname(__file__))
  
+ from common import *
+ 
+ 
+-def has_google_credentials():
+-    credentials, _ = google.auth.default()
+-    return credentials
+ 
+ 
+ google_credentials = pytest.mark.skipif(



View it on GitLab: https://salsa.debian.org/med-team/snakemake/-/commit/f216930706f36a27c43a3fa4ff36173a12ea625c

-- 
View it on GitLab: https://salsa.debian.org/med-team/snakemake/-/commit/f216930706f36a27c43a3fa4ff36173a12ea625c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20231112/0ddae827/attachment-0001.htm>


More information about the debian-med-commit mailing list