diff --git a/packages/google-cloud-datastore/tests/unit/test_client.py b/packages/google-cloud-datastore/tests/unit/test_client.py index 83aa4ac170f2..60ac417d72c0 100644 --- a/packages/google-cloud-datastore/tests/unit/test_client.py +++ b/packages/google-cloud-datastore/tests/unit/test_client.py @@ -13,6 +13,7 @@ # limitations under the License. from typing import Any, Dict +import os import mock import pytest @@ -115,6 +116,7 @@ def _make_client( ) +@mock.patch.dict(os.environ, clear=True) def test_client_ctor_w_project_no_environ(): # Some environments (e.g. AppVeyor CI) run in GCE, so # this test would fail artificially. @@ -127,6 +129,7 @@ def test_client_ctor_w_project_no_environ(): @pytest.mark.parametrize("database_id", [None, "somedb"]) +@mock.patch.dict(os.environ, clear=True) def test_client_ctor_w_implicit_inputs(database_id): from google.cloud.datastore.client import _CLIENT_INFO, _DATASTORE_BASE_URL, Client