Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions packages/google-cloud-ndb/tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_constructor_no_args_emulator():
patch_environ = mock.patch.dict(
"google.cloud.ndb.client.os.environ",
{"DATASTORE_EMULATOR_HOST": "foo"},
clear=True,
)
with patch_environ:
with patch_credentials("testing"):
Expand All @@ -69,9 +70,14 @@ def test_constructor_no_args_emulator():

@staticmethod
def test_constructor_get_project_from_environ(environ):
environ[environment_vars.GCD_DATASET] = "gcd-project"
with patch_credentials(None):
client = client_module.Client()
patch_environ = mock.patch.dict(
"google.cloud.ndb.client.os.environ",
{environment_vars.GCD_DATASET: "gcd-project"},
clear=True,
)
with patch_environ:
with patch_credentials(None):
client = client_module.Client()
assert client.project == "gcd-project"

@staticmethod
Expand Down
Loading