-
Notifications
You must be signed in to change notification settings - Fork 125
Explicit auth tests #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicit auth tests #170
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
nox.py
Outdated
@@ -21,6 +20,12 @@ def default(session): | |||
'pytest', | |||
os.path.join('.', 'tests', 'unit'), | |||
os.path.join('.', 'tests', 'system.py'), | |||
os.path.join('.', 'tests', 'unit'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like unit tests got included twice.
tests/system.py
Outdated
@@ -205,6 +220,7 @@ def test_should_be_able_to_get_results_from_query(self, gbq_connector): | |||
assert pages is not None | |||
|
|||
|
|||
@pytest.mark.local_auth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like test_get_application_default_credentials_does_not_throw_error
and test_get_application_default_credentials_returns_credentials
are working just fine on Travis if you want to move this to the test_get_user_account_credentials_XXX
methods.
Also, fixes failure in nox config when AUTH environment variable is not set.
This doesn't seem to be skipping local auth tests no matter where I put the mark. :-(
|
Discovery, though not solution - if there's a legacy-style We could try and resolve, or move to new-style tests (which would be preferable, but non-zero work) |
Ugh. Okay, well I've wanted to move to new-style tests for a while. (Already did it with the unit tests.) I'll see if I can get a PR to refactor the system tests out today. |
Well, I only got to the auth tests, but it's a start. #176 |
Closing in favor of #176 changes. |
After I neglected #127 and @tswast valiantly completed the bulk, there were a couple of useful unrelated pieces that are also worth adding
Here, tests are explicitly marked with auth type so, for example, if
pytest -m 'not s_path_auth'
is run, it won't run any tests with service path authTravis is then parameterized by the command it's passed, rather than the tests themselves checking whether they're running in travis