tox.ini 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Tox (https://tox.readthedocs.io/) is a tool for running tests in multiple
  2. # virtualenvs. This configuration file helps to run the test suite on all
  3. # supported Python versions. To use it, "python -m pip install tox" and
  4. # then run "tox" from this directory.
  5. [tox]
  6. skipsdist = true
  7. envlist =
  8. py3
  9. flake8
  10. docs
  11. isort
  12. # Add environment to use the default python3 installation
  13. [testenv:py3]
  14. basepython = python3
  15. [testenv]
  16. usedevelop = true
  17. # OBJC_DISABLE_INITIALIZE_FORK_SAFETY fixes hung tests for MacOS users. (#30806)
  18. passenv = DJANGO_SETTINGS_MODULE PYTHONPATH HOME DISPLAY OBJC_DISABLE_INITIALIZE_FORK_SAFETY
  19. setenv =
  20. PYTHONDONTWRITEBYTECODE=1
  21. deps =
  22. py{3,36,37}: -rtests/requirements/py3.txt
  23. postgres: -rtests/requirements/postgres.txt
  24. mysql: -rtests/requirements/mysql.txt
  25. oracle: -rtests/requirements/oracle.txt
  26. changedir = tests
  27. commands =
  28. {envpython} runtests.py {posargs}
  29. [testenv:flake8]
  30. basepython = python3
  31. usedevelop = false
  32. deps = flake8
  33. changedir = {toxinidir}
  34. commands = flake8 .
  35. [testenv:docs]
  36. basepython = python3
  37. usedevelop = false
  38. whitelist_externals =
  39. make
  40. deps =
  41. Sphinx
  42. pyenchant
  43. sphinxcontrib-spelling
  44. changedir = docs
  45. commands =
  46. make spelling
  47. [testenv:isort]
  48. basepython = python3
  49. usedevelop = false
  50. deps = isort
  51. changedir = {toxinidir}
  52. commands = isort --recursive --check-only --diff django tests scripts
  53. [testenv:javascript]
  54. usedevelop = false
  55. deps =
  56. changedir = {toxinidir}
  57. whitelist_externals = npm
  58. commands =
  59. npm install
  60. npm test