tox.ini 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. [tox]
  2. isolated_build = True
  3. minversion = 3.5.3
  4. distshare = {homedir}/.tox/distshare
  5. # make sure to update environment list in travis.yml and appveyor.yml
  6. envlist =
  7. linting
  8. py27
  9. py34
  10. py35
  11. py36
  12. py37
  13. py38
  14. py39
  15. pypy
  16. pypy3
  17. {py27,py37}-{pexpect,xdist,twisted,numpy,pluggymaster}
  18. py27-nobyte-xdist
  19. doctesting
  20. py37-freeze
  21. docs
  22. [testenv]
  23. commands =
  24. {env:_PYTEST_TOX_COVERAGE_RUN:} pytest {posargs:{env:_PYTEST_TOX_DEFAULT_POSARGS:}}
  25. coverage: coverage combine
  26. coverage: coverage report
  27. passenv = USER USERNAME COVERAGE_* TRAVIS PYTEST_ADDOPTS
  28. setenv =
  29. _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_PEXPECT:} {env:_PYTEST_TOX_POSARGS_TWISTED:} {env:_PYTEST_TOX_POSARGS_XDIST:}
  30. # Configuration to run with coverage similar to Travis/Appveyor, e.g.
  31. # "tox -e py37-coverage".
  32. coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m
  33. coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
  34. coverage: COVERAGE_FILE={toxinidir}/.coverage
  35. coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc
  36. nobyte: PYTHONDONTWRITEBYTECODE=1
  37. lsof: _PYTEST_TOX_POSARGS_LSOF=--lsof
  38. pexpect: _PYTEST_TOX_PLATFORM=linux|darwin
  39. pexpect: _PYTEST_TOX_POSARGS_PEXPECT=-m uses_pexpect
  40. twisted: _PYTEST_TOX_POSARGS_TWISTED=testing/test_unittest.py
  41. xdist: _PYTEST_TOX_POSARGS_XDIST=-n auto
  42. extras = testing
  43. deps =
  44. numpy: numpy
  45. pexpect: pexpect
  46. pluggymaster: git+https://github.com/pytest-dev/pluggy.git@master
  47. twisted: twisted
  48. twisted: unittest2
  49. xdist: pytest-xdist>=1.13
  50. {env:_PYTEST_TOX_EXTRA_DEP:}
  51. platform = {env:_PYTEST_TOX_PLATFORM:.*}
  52. [testenv:py27-subprocess]
  53. deps =
  54. pytest-xdist>=1.13
  55. py27: mock
  56. nose
  57. commands =
  58. pytest -n auto --runpytest=subprocess {posargs}
  59. [testenv:linting]
  60. skip_install = True
  61. basepython = python3
  62. deps = pre-commit>=1.11.0
  63. commands = pre-commit run --all-files --show-diff-on-failure
  64. [testenv:docs]
  65. basepython = python3
  66. usedevelop = True
  67. changedir = doc/en
  68. deps = -r{toxinidir}/doc/en/requirements.txt
  69. commands =
  70. sphinx-build -W -b html . _build
  71. [testenv:doctesting]
  72. basepython = python3
  73. skipsdist = True
  74. deps =
  75. {[testenv]deps}
  76. PyYAML
  77. commands =
  78. {env:_PYTEST_TOX_COVERAGE_RUN:} pytest doc/en
  79. {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest
  80. [testenv:regen]
  81. changedir = doc/en
  82. skipsdist = True
  83. basepython = python3
  84. deps =
  85. sphinx
  86. PyYAML
  87. regendoc>=0.6.1
  88. dataclasses
  89. whitelist_externals =
  90. rm
  91. make
  92. commands =
  93. # don't show hypothesis plugin info in docs, see #4602
  94. pip uninstall hypothesis -y
  95. rm -rf /tmp/doc-exec*
  96. rm -rf {envdir}/.pytest_cache
  97. make regen
  98. [testenv:jython]
  99. changedir = testing
  100. commands =
  101. {envpython} {envbindir}/py.test-jython {posargs}
  102. [testenv:py37-freeze]
  103. changedir = testing/freeze
  104. # Disable PEP 517 with pip, which does not work with PyInstaller currently.
  105. deps =
  106. pyinstaller
  107. setuptools < 45.0.0
  108. commands =
  109. {envpython} create_executable.py
  110. {envpython} tox_run.py
  111. [testenv:release]
  112. decription = do a release, required posarg of the version number
  113. basepython = python3
  114. usedevelop = True
  115. passenv = *
  116. deps =
  117. colorama
  118. gitpython
  119. pre-commit>=1.11.0
  120. towncrier
  121. wheel
  122. commands = python scripts/release.py {posargs}
  123. [testenv:publish_gh_release_notes]
  124. description = create GitHub release after deployment
  125. basepython = python3
  126. usedevelop = True
  127. passenv = GH_RELEASE_NOTES_TOKEN TRAVIS_TAG TRAVIS_REPO_SLUG
  128. deps =
  129. github3.py
  130. pypandoc
  131. commands = python scripts/publish_gh_release_notes.py
  132. [pytest]
  133. minversion = 2.0
  134. addopts = -ra -p pytester --strict-markers
  135. rsyncdirs = tox.ini doc src testing
  136. python_files = test_*.py *_test.py testing/*/*.py
  137. python_classes = Test Acceptance
  138. python_functions = test
  139. # NOTE: "doc" is not included here, but gets tested explicitly via "doctesting".
  140. testpaths = testing
  141. norecursedirs = testing/example_scripts
  142. xfail_strict=true
  143. filterwarnings =
  144. error
  145. ignore:yield tests are deprecated, and scheduled to be removed in pytest 4.0:pytest.RemovedInPytest4Warning
  146. ignore:Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0:pytest.RemovedInPytest4Warning
  147. ignore::pytest.RemovedInPytest4Warning
  148. ignore:Module already imported so cannot be rewritten:pytest.PytestWarning
  149. # produced by path.local
  150. ignore:bad escape.*:DeprecationWarning:re
  151. # produced by path.readlines
  152. ignore:.*U.*mode is deprecated:DeprecationWarning
  153. # produced by pytest-xdist
  154. ignore:.*type argument to addoption.*:DeprecationWarning
  155. # produced by python >=3.5 on execnet (pytest-xdist)
  156. ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning
  157. # pytest's own futurewarnings
  158. ignore::pytest.PytestExperimentalApiWarning
  159. # Do not cause SyntaxError for invalid escape sequences in py37.
  160. default:invalid escape sequence:DeprecationWarning
  161. # ignore use of unregistered marks, because we use many to test the implementation
  162. ignore::_pytest.warning_types.PytestUnknownMarkWarning
  163. pytester_example_dir = testing/example_scripts
  164. markers =
  165. # dummy markers for testing
  166. foo
  167. bar
  168. baz
  169. # conftest.py reorders tests moving slow ones to the end of the list
  170. slow
  171. # experimental mark for all tests using pexpect
  172. uses_pexpect
  173. [flake8]
  174. max-line-length = 120
  175. ignore = E203,W503
  176. [isort]
  177. ; This config mimics what reorder-python-imports does.
  178. force_single_line = 1
  179. known_localfolder = pytest,_pytest
  180. known_third_party = test_source,test_excinfo
  181. force_alphabetical_sort_within_sections = 1