Skip to content

Commit eba633c

Browse files
authored
chore: clean environment for datastore tests (#16734)
clean environment for datastore tests
1 parent 7e15fce commit eba633c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/google-cloud-datastore/tests/unit/test_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
from typing import Any, Dict
16+
import os
1617

1718
import mock
1819
import pytest
@@ -115,6 +116,7 @@ def _make_client(
115116
)
116117

117118

119+
@mock.patch.dict(os.environ, clear=True)
118120
def test_client_ctor_w_project_no_environ():
119121
# Some environments (e.g. AppVeyor CI) run in GCE, so
120122
# this test would fail artificially.
@@ -127,6 +129,7 @@ def test_client_ctor_w_project_no_environ():
127129

128130

129131
@pytest.mark.parametrize("database_id", [None, "somedb"])
132+
@mock.patch.dict(os.environ, clear=True)
130133
def test_client_ctor_w_implicit_inputs(database_id):
131134
from google.cloud.datastore.client import _CLIENT_INFO, _DATASTORE_BASE_URL, Client
132135

0 commit comments

Comments
 (0)