-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: pass explicit credentials in all unit tests creating clients (#…
…369) * Removed duplicated tests * Pass mock credentials. To allow unit tests to run without connecting to the google APIs. * Used a fixture to be DRY wrt test credentials. * Used a fixture to be DRY wrt test credentials. * Used a fixture to be DRY wrt test credentials. * Document the fixture.
- Loading branch information
Showing
3 changed files
with
62 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import google.auth.credentials | ||
import mock | ||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def creds(): | ||
""" | ||
Provide test creds to unit tests so that they can run without | ||
GOOGLE_APPLICATION_CREDENTIALS set. | ||
""" | ||
yield mock.Mock(spec=google.auth.credentials.Credentials) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.