From 77ce1b0254306b42ca4d7e0137376caee9b5bd16 Mon Sep 17 00:00:00 2001 From: jsimonweb Date: Fri, 29 Jun 2018 12:17:20 -0700 Subject: [PATCH 1/2] Fix python Cloud Spanner tests. --- spanner/cloud-client/snippets_test.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/spanner/cloud-client/snippets_test.py b/spanner/cloud-client/snippets_test.py index 01c3b1da84db..0b8d966539d9 100644 --- a/spanner/cloud-client/snippets_test.py +++ b/spanner/cloud-client/snippets_test.py @@ -51,6 +51,19 @@ def temporary_database(spanner_instance): database_id = unique_database_id() snippets.create_database(SPANNER_INSTANCE, database_id) snippets.insert_data(SPANNER_INSTANCE, database_id) + snippets.write_struct_data(SPANNER_INSTANCE, database_id) + database = spanner_instance.database(database_id) + database.reload() + yield database + database.drop() + +@pytest.fixture(scope='module') +def temporary_database_with_all_columns(spanner_instance): + database_id = unique_database_id() + snippets.create_database(SPANNER_INSTANCE, database_id) + snippets.insert_data(SPANNER_INSTANCE, database_id) + snippets.add_column(SPANNER_INSTANCE, database_id) + snippets.add_timestamp_column(SPANNER_INSTANCE, database_id) database = spanner_instance.database(database_id) database.reload() yield database @@ -213,10 +226,11 @@ def test_add_timestamp_column(temporary_database, capsys): @pytest.mark.slow -def test_update_data_with_timestamp(temporary_database, capsys): +def test_update_data_with_timestamp(temporary_database_with_all_columns, + capsys): snippets.update_data_with_timestamp( SPANNER_INSTANCE, - temporary_database.database_id) + temporary_database_with_all_columns.database_id) out, _ = capsys.readouterr() From ce1e06a8dbb309196cb7599af4a7fc53276a262d Mon Sep 17 00:00:00 2001 From: jsimonweb Date: Fri, 29 Jun 2018 12:36:26 -0700 Subject: [PATCH 2/2] Lint. --- spanner/cloud-client/snippets_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spanner/cloud-client/snippets_test.py b/spanner/cloud-client/snippets_test.py index 0b8d966539d9..7d51e8fbb0ee 100644 --- a/spanner/cloud-client/snippets_test.py +++ b/spanner/cloud-client/snippets_test.py @@ -57,6 +57,7 @@ def temporary_database(spanner_instance): yield database database.drop() + @pytest.fixture(scope='module') def temporary_database_with_all_columns(spanner_instance): database_id = unique_database_id()