1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
Description: Skip tests that depend on google-cloud-sdk if not installed
This is not currently in Debian - see RFP #759578.
Author: chrysn <chrysn@fsfe.org>, Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: not-needed
--- a/tests/test_remote_gs/Snakefile
+++ b/tests/test_remote_gs/Snakefile
@@ -1,15 +1,19 @@
-from snakemake.remote import GS
-import google.auth
try:
- GS = GS.RemoteProvider()
+ from snakemake.remote import GS
+except WorkflowError:
+ print("skipping test_remote_gs: The Python 3 package 'google-cloud-sdk' needs to be installed to use GS remote() file functionality. No module named 'google.cloud'")
+else:
+ import google.auth
+ try:
+ GS = GS.RemoteProvider()
- rule copy:
- input:
- GS.remote("gcp-public-data-landsat/LC08/01/001/003/LC08_L1GT_001003_20170430_20170501_01_RT/LC08_L1GT_001003_20170430_20170501_01_RT_MTL.txt")
- output:
- "landsat-data.txt"
- shell:
- "cp {input} {output}"
-except google.auth.exceptions.DefaultCredentialsError:
- # ignore the test if not authenticated
- print("skipping test_remote_gs because we are not authenticated with gcloud")
+ rule copy:
+ input:
+ GS.remote("gcp-public-data-landsat/LC08/01/001/003/LC08_L1GT_001003_20170430_20170501_01_RT/LC08_L1GT_001003_20170430_20170501_01_RT_MTL.txt")
+ output:
+ "landsat-data.txt"
+ shell:
+ "cp {input} {output}"
+ except google.auth.exceptions.DefaultCredentialsError:
+ # ignore the test if not authenticated
+ print("skipping test_remote_gs because we are not authenticated with gcloud")
--- a/tests/test_google_lifesciences.py
+++ b/tests/test_google_lifesciences.py
@@ -1,8 +1,12 @@
import os
import sys
import tempfile
+import pytest
-from google.cloud import storage
+try:
+ from google.cloud import storage
+except ImportError:
+ pass # will skip due to no credentials
sys.path.insert(0, os.path.dirname(__file__))
|