Skip to content

Commit

Permalink
Fixed failed tests on Kokoro (Spanner + Translate) [(googleapis#1192)](
Browse files Browse the repository at this point in the history
…GoogleCloudPlatform/python-docs-samples#1192)

* Fixed failed tests on Kokoro (Spanner + Translate)

* Update quickstart_test.py
  • Loading branch information
michaelawyu authored and Jon Wayne Parrott committed Nov 3, 2017
1 parent 52e04c6 commit dae800f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions samples/samples/quickstart_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import os

from google.cloud import spanner
import google.cloud.exceptions
import google.cloud.spanner.client
import mock
import pytest

Expand All @@ -27,13 +25,13 @@

@pytest.fixture
def patch_instance():
original_instance = google.cloud.spanner.client.Client.instance
original_instance = spanner.Client.instance

def new_instance(self, unused_instance_name):
return original_instance(self, SPANNER_INSTANCE)

instance_patch = mock.patch(
'google.cloud.spanner.client.Client.instance',
'google.cloud.spanner.Client.instance',
side_effect=new_instance,
autospec=True)

Expand Down
2 changes: 1 addition & 1 deletion samples/samples/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def query_data_with_index(
ALTER TABLE Albums ADD COLUMN MarketingBudget INT64
"""
from google.cloud.proto.spanner.v1 import type_pb2
from google.cloud.spanner_v1.proto import type_pb2

spanner_client = spanner.Client()
instance = spanner_client.instance(instance_id)
Expand Down

0 comments on commit dae800f

Please sign in to comment.