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 #349 and #350) - Updated `test_jwt` module docstring to reflect actual purpose
139 lines
3.1 KiB
INI
139 lines
3.1 KiB
INI
[tox]
|
|
envlist = py26,py27,py33,py34,pypy,gae,cover
|
|
|
|
[testenv]
|
|
basedeps = keyring
|
|
mock>=1.3.0
|
|
pycrypto>=2.6
|
|
cryptography>=1.0
|
|
pyopenssl>=0.14
|
|
webtest
|
|
nose
|
|
flask
|
|
unittest2
|
|
deps = {[testenv]basedeps}
|
|
django
|
|
setenv =
|
|
pypy: with_gmp=no
|
|
DJANGO_SETTINGS_MODULE=tests.contrib.test_django_settings
|
|
commands = nosetests --ignore-files=test_appengine\.py {posargs}
|
|
|
|
[coverbase]
|
|
basepython = python2.7
|
|
commands =
|
|
nosetests \
|
|
--with-coverage \
|
|
--cover-package=oauth2client \
|
|
--cover-package=tests \
|
|
--cover-erase \
|
|
--cover-tests \
|
|
--cover-branches \
|
|
--ignore-files=contrib/test_appengine\.py
|
|
nosetests \
|
|
--with-coverage \
|
|
--cover-package=oauth2client.contrib.appengine \
|
|
--cover-package=tests.contrib.test_appengine \
|
|
--with-gae \
|
|
--cover-tests \
|
|
--cover-branches \
|
|
--gae-application=tests/data \
|
|
--gae-lib-root={env:GAE_PYTHONPATH} \
|
|
--logging-level=INFO \
|
|
tests/contrib/test_appengine.py
|
|
deps = {[testenv]deps}
|
|
coverage
|
|
nosegae
|
|
|
|
[testenv:py26]
|
|
basepython =
|
|
python2.6
|
|
commands =
|
|
nosetests \
|
|
--ignore-files=test_appengine\.py \
|
|
--ignore-files=test_django_orm\.py \
|
|
--ignore-files=test_django_settings\.py \
|
|
--ignore-files=test_django_util\.py \
|
|
--exclude-dir=oauth2client/contrib/django_util \
|
|
{posargs}
|
|
deps = {[testenv]basedeps}
|
|
nose-exclude
|
|
|
|
[testenv:py33]
|
|
basepython =
|
|
python3.3
|
|
commands =
|
|
nosetests \
|
|
--ignore-files=test_appengine\.py \
|
|
--ignore-files=test_django_orm\.py \
|
|
--ignore-files=test_django_settings\.py \
|
|
--ignore-files=test_django_util\.py \
|
|
--exclude-dir=oauth2client/contrib/django_util \
|
|
{posargs}
|
|
deps = {[testenv]basedeps}
|
|
nose-exclude
|
|
|
|
[testenv:cover]
|
|
basepython = {[coverbase]basepython}
|
|
commands =
|
|
{[coverbase]commands}
|
|
coverage report --show-missing --fail-under 80
|
|
deps =
|
|
{[coverbase]deps}
|
|
|
|
[testenv:coveralls]
|
|
basepython = {[coverbase]basepython}
|
|
commands =
|
|
{[coverbase]commands}
|
|
coverage report --show-missing
|
|
coveralls
|
|
deps =
|
|
{[coverbase]deps}
|
|
coveralls
|
|
passenv = {[testenv:system-tests]passenv}
|
|
|
|
[testenv:docs]
|
|
basepython = python2.7
|
|
deps =
|
|
{[testenv:cover]deps}
|
|
python-gflags
|
|
pyyaml
|
|
sphinx>=1.3b2
|
|
sphinx-rtd-theme
|
|
webapp2
|
|
commands = {toxinidir}/scripts/build-docs
|
|
|
|
[testenv:gae]
|
|
basepython = python2.7
|
|
deps = {[testenv]basedeps}
|
|
nosegae
|
|
commands =
|
|
nosetests \
|
|
--with-gae \
|
|
--gae-application=tests/data \
|
|
--logging-level=INFO \
|
|
tests/contrib/test_appengine.py
|
|
setenv:
|
|
PYTHONPATH={env:GAE_PYTHONPATH:}
|
|
|
|
[testenv:system-tests]
|
|
basepython =
|
|
python2.7
|
|
commands =
|
|
{toxinidir}/scripts/run_system_tests.sh
|
|
deps =
|
|
pycrypto>=2.6
|
|
cryptography>=1.0
|
|
pyopenssl>=0.14
|
|
passenv = GOOGLE_* OAUTH2CLIENT_* TRAVIS*
|
|
|
|
[testenv:system-tests3]
|
|
basepython =
|
|
python3.4
|
|
commands =
|
|
{toxinidir}/scripts/run_system_tests.sh
|
|
deps =
|
|
pycrypto>=2.6
|
|
cryptography>=1.0
|
|
pyopenssl>=0.14
|
|
passenv = {[testenv:system-tests]passenv}
|