Skip to content

Commit

Permalink
chore: remove some code repetition
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Jul 21, 2021
1 parent 4699a1b commit b2af8b2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/unit/v1/test_base_client.py
Expand Up @@ -146,11 +146,11 @@ def test_emulator_channel(self):
)

emulator_host = "localhost:8081"
credentials = _make_credentials()
database = "quanta"
with mock.patch("os.getenv") as getenv:
getenv.return_value = emulator_host

credentials = _make_credentials()
database = "quanta"
credentials.id_token = None
client = self._make_one(
project=self.PROJECT, credentials=credentials, database=database
)
Expand All @@ -166,13 +166,9 @@ def test_emulator_channel(self):
# NOTE: On windows, emulation requires an insecure channel. If this is
# altered to use a secure channel, start by verifying that it still
# works as expected on windows.
emulator_host = "localhost:8081"
with mock.patch("os.getenv") as getenv:
getenv.return_value = emulator_host

credentials = _make_credentials()
credentials.id_token = "test"
database = "quanta"
client = self._make_one(
project=self.PROJECT, credentials=credentials, database=database
)
Expand Down

0 comments on commit b2af8b2

Please sign in to comment.