tox.ini 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. [tox]
  2. envlist = py{3.7,3.8,3.9}-{cherrypy,tornado}-{v3004.2,v3005.1,v3006.0,master},py{3.10}-{cherrypy,tornado}-{v3006.0,master},coverage,flake8
  3. skip_missing_interpreters = true
  4. skipsdist = false
  5. [testenv]
  6. passenv = TOXENV, CI, TRAVIS, TRAVIS_*, CODECOV_*
  7. deps = -r{toxinidir}/tests/requirements.txt
  8. v3004.2: salt==3004.2
  9. v3004.2: jinja2<3.1
  10. v3005.1: salt==3005.1
  11. v3006.0: salt==3006.0
  12. py3.7-{cherrypy,tornado}-{v3004.2,v3005.1,v3006.0}: importlib-metadata<5.0.0
  13. master: git+https://github.com/saltstack/salt.git@master#egg=salt
  14. changedir = {toxinidir}
  15. setenv = COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
  16. commands =
  17. cherrypy: pytest -v --cov=pepper/ --cov-config=tox.ini --cov-report= {posargs} --salt-api-backend=rest_cherrypy
  18. tornado: pytest -v --cov=pepper/ --cov-config=tox.ini --cov-report= {posargs} --salt-api-backend=rest_tornado
  19. [testenv:flake8]
  20. deps =
  21. -r {toxinidir}/tests/requirements.txt
  22. flake8
  23. commands = flake8 tests/ pepper/ scripts/pepper setup.py
  24. [testenv:coverage]
  25. skip_install = True
  26. deps =
  27. coverage >= 7.0.5, < 8
  28. setenv = COVERAGE_FILE={toxworkdir}/.coverage
  29. changedir = {toxinidir}
  30. commands =
  31. coverage erase
  32. coverage combine
  33. coverage report -m
  34. coverage html
  35. coverage xml -o {toxworkdir}/coverage.xml
  36. [testenv:codecov]
  37. deps = codecov
  38. skip_install = True
  39. changedir = {toxinidir}
  40. commands = codecov --file "{toxworkdir}/coverage.xml"
  41. [testenv:http]
  42. skip_install = True
  43. basepython = python36
  44. deps =
  45. changedir = {toxinidir}/htmlcov
  46. commands = python -m http.server
  47. [pytest]
  48. addopts = --showlocals --log-file /tmp/pepper-runtests.log --show-capture=no -ra
  49. testpaths = tests
  50. norecursedirs = .git .tox
  51. usefixtures = pepperconfig
  52. [flake8]
  53. max-line-length = 119
  54. [coverage:run]
  55. branch = true
  56. source = pepper/
  57. omit =
  58. */.tox/*
  59. */tests/*
  60. */setup.py
  61. [coverage:report]
  62. skip_covered = True
  63. show_missing = True