nox.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright 2016 Google
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from __future__ import absolute_import
  15. import nox
  16. @nox.session
  17. @nox.parametrize('py', ['2.7'])
  18. def tests(session, py):
  19. session.interpreter = 'python{}'.format(py)
  20. session.install('mock', 'pytest', 'pytest-cov')
  21. session.install('-e', '.[oauth2client]')
  22. session.run(
  23. 'py.test',
  24. '--quiet',
  25. '--cov=google_reauth',
  26. '--cov-config=.coveragerc',
  27. 'tests',
  28. *session.posargs
  29. )
  30. @nox.session
  31. def lint(session):
  32. session.install('flake8', 'docutils', 'pygments')
  33. session.run('flake8', 'google_reauth')
  34. session.run(
  35. 'python', 'setup.py', 'check', '--restructuredtext', '--strict')