Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit a750c86

Browse files
committed
test: add explicit credentials and project to test
Tests need to be able to run in environments without any default credentials. This requires the test to explictly set the credentials and the project that should be used.
1 parent 064d9dc commit a750c86

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/unit/spanner_dbapi/test_connection.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,14 @@ def test_custom_database_role(self):
830830
from google.cloud.spanner_dbapi import connect
831831

832832
role = "some_role"
833-
connection = connect("test-instance", "test-database", database_role=role)
833+
connection = connect(
834+
"test-instance",
835+
"test-database",
836+
project="test-project",
837+
database_role=role,
838+
credentials=AnonymousCredentials(),
839+
client_options={"api_endpoint": "none"},
840+
)
834841
self.assertEqual(connection.database.database_role, role)
835842

836843
def test_invalid_custom_client_connection(self):

0 commit comments

Comments
 (0)