Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

More informative error when failing to open secrets file. #349

Closed
wants to merge 1 commit into from

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Dec 2, 2015

Fixes #348.

@dhermes
Copy link
Contributor Author

dhermes commented Dec 2, 2015

PS Sorry if tests fail. I am with a temporary machine and it was becoming cumbersome.

@dhermes
Copy link
Contributor Author

dhermes commented Dec 2, 2015

@waprin You seem to know more about Django than I do 😀

It seems 1.8.7 was release on Nov. 24 (2015) and is causing some test failures which weren't previously an issue.

  • 2.6: Not sure, but seems to be a feature in unittest2 that didn't make it into Python 2.6
  • 2.7, 3.4 and pypy: AppRegistryNotReady: Apps aren't loaded yet.
  • 3.3: An ImportError. It seems django is dropping support for Python 3.3 in releases >=1.9

(Though in Python 2.6, the only error is my use of self.assertRaises as a context manager.)

@waprin
Copy link
Contributor

waprin commented Dec 3, 2015

@dhermes #350 adds a commit fixes the app isue for py27 /Django 1.9. It overlaps with the Django decorator PR which is still to be merged. The fact that django_orm did slightly hacky things to setup the Django env has caused these annoyances. Nathaniel seems skeptical of using the lots-of-files Django convention in the PR but I think these type of problems makes a case for just following Django conventions when possible (and might be easier to swallow once its in contrib package).

As for your 2.6 problem, sounds like you just need to just not use assertRaises (also, surprised this library still needs to support 2.6). Given Django isn't supporting 3.3, maybe we should setup the tox environment to not run the Django tests in the 3.3 testenv, but I'm still a bit confused because the Django code looks like it does a version check and backports the feature. Investigating now.

@dhermes
Copy link
Contributor Author

dhermes commented Dec 3, 2015

Thanks.

@dhermes dhermes closed this Dec 3, 2015
@dhermes dhermes deleted the fix-348 branch December 3, 2015 19:09
dhermes added a commit to dhermes/oauth2client that referenced this pull request Dec 5, 2015
In particular

- Upgraded some unit test modules to `unittest2`.
- Got to 100% line coverage in `test_jwt`, `test_clientsecrets`,
  and `test_service_account` by using `self.assertRaises`
  instead of `self.fail()`
- In some places used `self.assertRaises` as a context manager so
  the thrown exception can be inspected / compared against. This
  is done instead of manually catching the exception and
  holding on to it (`unittest2` backports this feature from
  `unittest` that was not available in Python 2.6)
- Added license to `test_multistore_file`
- Removed legacy `python2.4` hashbang from `test_jwt` and
  `test_service_account`
- Added `unittest2` as a test dependency in `tox.ini`
- Updated `test_clientsecrets.test_load_by_filename_missing_file`
  to use the `self.assertRaises` context manager (this was
  a problem in googleapis#349 and googleapis#350)
- Updated `test_jwt` module docstring to reflect actual purpose
dhermes added a commit to dhermes/oauth2client that referenced this pull request Dec 14, 2015
In particular

- Upgraded some unit test modules to `unittest2`.
- Got to 100% line coverage in `test_jwt`, `test_clientsecrets`,
  and `test_service_account` by using `self.assertRaises`
  instead of `self.fail()`
- In some places used `self.assertRaises` as a context manager so
  the thrown exception can be inspected / compared against. This
  is done instead of manually catching the exception and
  holding on to it (`unittest2` backports this feature from
  `unittest` that was not available in Python 2.6)
- Added license to `test_multistore_file`
- Removed legacy `python2.4` hashbang from `test_jwt` and
  `test_service_account`
- Added `unittest2` as a test dependency in `tox.ini`
- Updated `test_clientsecrets.test_load_by_filename_missing_file`
  to use the `self.assertRaises` context manager (this was
  a problem in googleapis#349 and googleapis#350)
- Updated `test_jwt` module docstring to reflect actual purpose
dhermes added a commit to dhermes/oauth2client that referenced this pull request Dec 14, 2015
In particular

- Upgraded some unit test modules to `unittest2`.
- Got to 100% line coverage in `test_jwt`, `test_clientsecrets`,
  and `test_service_account` by using `self.assertRaises`
  instead of `self.fail()`
- In some places used `self.assertRaises` as a context manager so
  the thrown exception can be inspected / compared against. This
  is done instead of manually catching the exception and
  holding on to it (`unittest2` backports this feature from
  `unittest` that was not available in Python 2.6)
- Added license to `test_multistore_file`
- Removed legacy `python2.4` hashbang from `test_jwt` and
  `test_service_account`
- Added `unittest2` as a test dependency in `tox.ini`
- Updated `test_clientsecrets.test_load_by_filename_missing_file`
  to use the `self.assertRaises` context manager (this was
  a problem in googleapis#349 and googleapis#350)
- Updated `test_jwt` module docstring to reflect actual purpose
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.

3 participants