Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Use context manager for assertRaises #537

Merged
merged 3 commits into from
Jul 6, 2016
Merged

Conversation

pferate
Copy link
Contributor

@pferate pferate commented Jul 5, 2016

Using context manager for assertRaises calls. Also needed to update files using unittest to unittest2 to be able to use context managers in Python 2.6 (was added to unittest in 2.7). Keeping the same import and usage syntax as the other files using unittest2.

@@ -25,7 +25,7 @@

from oauth2client import util
from oauth2client.client import OAuth2Credentials
from oauth2client.contrib import locked_file
from oauth2client.contrib.locked_file import CredentialsFileSymbolicLinkError

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@pferate pferate changed the title Issue 536 Use context manager for assertRaises Jul 5, 2016
@@ -53,4 +53,4 @@ def test_token_info(self):


if __name__ == '__main__':

This comment was marked as spam.

This comment was marked as spam.

@theacodes theacodes self-assigned this Jul 6, 2016
Using unittest2 for extended unit test capabilities in python 2.6.
Don't need the `if __name__ == '__main__':` clauses in the test files.
@theacodes
Copy link
Contributor

@pferate this is almost ready, only one outstanding comment (about the if __name__ stuff)

@pferate
Copy link
Contributor Author

pferate commented Jul 6, 2016

@jonparrott Is there something I missed? I took care of the if __name__ stuff in 06e7032.

I only left those checks in the /scripts/* files.

Edit: nevermind, I see that the one you referenced was the one in the /scripts/ directory.

@theacodes
Copy link
Contributor

Oh, I see, my apologies.

@nathanielmanistaatgoogle I'm merging this tests-only change. Let me know if you have any post-merge concerns.

@pferate thanks for doing this! Much appreciated!

@theacodes theacodes merged commit f25b7ab into googleapis:master Jul 6, 2016
@pferate
Copy link
Contributor Author

pferate commented Jul 6, 2016

No problem @jonparrott!

@pferate pferate deleted the issue_536 branch July 6, 2016 19:48
@theacodes theacodes mentioned this pull request Jul 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants