From 1b3e82270a8ca72cbfd90a6a9a73b641a57111bd Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Mon, 5 Aug 2019 15:35:04 -0700 Subject: [PATCH] BigQuery: Remove redundant service account key code sample. (#8891) * Remove redundant service account key code sample. * Remove unused import. --- bigquery/docs/snippets.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/bigquery/docs/snippets.py b/bigquery/docs/snippets.py index 8697eb74e080..249fbf7baafa 100644 --- a/bigquery/docs/snippets.py +++ b/bigquery/docs/snippets.py @@ -26,7 +26,6 @@ import os import time -import mock import pytest import six @@ -126,27 +125,6 @@ def test_create_client_default_credentials(): assert client is not None -def test_create_client_json_credentials(): - """Create a BigQuery client with Application Default Credentials""" - with open(os.environ["GOOGLE_APPLICATION_CREDENTIALS"]) as creds_file: - creds_file_data = creds_file.read() - - open_mock = mock.mock_open(read_data=creds_file_data) - - with mock.patch("io.open", open_mock): - # [START bigquery_client_json_credentials] - from google.cloud import bigquery - - # Explicitly use service account credentials by specifying the private - # key file. All clients in google-cloud-python have this helper. - client = bigquery.Client.from_service_account_json( - "path/to/service_account.json" - ) - # [END bigquery_client_json_credentials] - - assert client is not None - - def test_list_datasets_by_label(client, to_delete): dataset_id = "list_datasets_by_label_{}".format(_millis()) dataset = bigquery.Dataset(client.dataset(dataset_id))