diff --git a/samples/samples/snippets_test.py b/samples/samples/snippets_test.py index 01c3b1da84..7d51e8fbb0 100644 --- a/samples/samples/snippets_test.py +++ b/samples/samples/snippets_test.py @@ -51,6 +51,20 @@ 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 +227,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()