From 9722a545003d986a8c843783952a536b6ea6ecdd Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Mon, 4 Jun 2018 15:08:19 -0400 Subject: [PATCH] CI/BUG: Skip bigquery tests where no creds are found Author: Phillip Cloud Closes #1468 from cpcloud/fix-bq-creds and squashes the following commits: ce6929b [Phillip Cloud] CI/BUG: Skip bigquery tests where no creds are found --- ibis/bigquery/tests/test_client.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ibis/bigquery/tests/test_client.py b/ibis/bigquery/tests/test_client.py index e838b24ea9ba..8221de0460f6 100644 --- a/ibis/bigquery/tests/test_client.py +++ b/ibis/bigquery/tests/test_client.py @@ -401,9 +401,15 @@ def test_parted_column(client, kind, option, expected_fn): def test_cross_project_query(): - con = ibis.bigquery.connect( - project_id='ibis-gbq', - dataset_id='bigquery-public-data.stackoverflow') + ga = pytest.importorskip('google.auth') + + try: + con = ibis.bigquery.connect( + project_id='ibis-gbq', + dataset_id='bigquery-public-data.stackoverflow') + except ga.exceptions.DefaultCredentialsError: + pytest.skip("no credentials found, skipping") + table = con.table('posts_questions') expr = table[table.tags.contains('ibis')][['title', 'tags']] result = expr.compile() @@ -455,8 +461,14 @@ def test_exists_database_different_project(client, name, expected): def test_repeated_project_name(): - con = ibis.bigquery.connect( - project_id='ibis-gbq', dataset_id='ibis-gbq.testing') + ga = pytest.importorskip('google.auth') + + try: + con = ibis.bigquery.connect( + project_id='ibis-gbq', dataset_id='ibis-gbq.testing') + except ga.exceptions.DefaultCredentialsError: + pytest.skip("no credentials found, skipping") + assert 'functional_alltypes' in con.list_tables()