blob: 03c4c0749317e4678395df6331404a64be137683 [file] [log] [blame]
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07001[tox]
Christian Heimesdbf18352016-11-30 13:33:02 +01002minversion = 2.4
Paul Kehrer4cf6e782017-10-12 06:06:01 +08003envlist = py27,pypy,py34,py35,py36,docs,pep8,py3pep8
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07004
5[testenv]
Chris Wolfe0b26ab22016-11-05 23:00:37 -05006extras =
7 test
Alex Gaynor83a0f482013-08-10 15:48:57 -04008deps =
Paul Kehrere5359852017-09-13 09:30:51 +08009 # This must be kept in sync with Jenkinsfile and .travis/install.sh
10 coverage==4.3.4
Alex Stapleton3888a842014-03-24 23:05:53 +000011 ./vectors
Paul Kehrer9b6ae9c2015-09-15 18:30:55 -050012passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME
Alex Gaynorff61cd32013-10-03 09:52:08 -070013commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050014 pip list
Donald Stufft62143e42014-11-13 08:17:36 -050015 # We use parallel mode and then combine here so that coverage.py will take
16 # the paths like .tox/py34/lib/python3.4/site-packages/cryptography/__init__.py
17 # and collapse them into src/cryptography/__init__.py.
18 coverage run --parallel-mode -m pytest --capture=no --strict {posargs}
19 coverage combine
Alex Gaynor3e81fb22013-11-05 16:29:19 -080020 coverage report -m
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070021
Paul Kehrer63df0102017-06-19 00:59:13 -100022# This target disables coverage on pypy because of performance problems with
23# coverage.py on pypy.
24[testenv:pypy-nocoverage]
25basepython = pypy
26commands =
27 pip list
28 pytest --capture=no --strict {posargs}
29
Alex Gaynor7c8ed9e2017-08-14 23:25:01 -040030# This target disables coverage on pypy because of performance problems with
31# coverage.py on pypy.
32[testenv:pypy3-nocoverage]
33basepython = pypy3
34commands =
35 pip list
36 pytest --capture=no --strict {posargs}
37
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070038[testenv:docs]
Chris Wolfe0b26ab22016-11-05 23:00:37 -050039extras =
40 docstest
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070041basepython = python2.7
Donald Stufft235fa712013-08-11 17:47:17 -040042commands =
Paul Kehrera3facfa2017-10-11 19:49:27 +080043 sphinx-build -j4 -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
44 sphinx-build -j4 -T -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
45 sphinx-build -j4 -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
46 sphinx-build -j4 -T -W -b spelling docs docs/_build/html
Paul Kehrerb525adf2014-09-29 15:18:23 -050047 doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/
Donald Stufft942e91d2015-02-12 21:39:51 -050048 python setup.py check --restructuredtext --strict
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070049
Paul Kehrer986b1902014-03-02 16:35:21 -040050[testenv:docs-linkcheck]
Paul Kehrer562b9a92016-11-13 05:46:04 -080051extras =
Paul Kehrer986b1902014-03-02 16:35:21 -040052deps =
53 sphinx
54basepython = python2.7
55commands =
56 sphinx-build -W -b linkcheck docs docs/_build/html
57
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070058[testenv:pep8]
Chris Wolfe0b26ab22016-11-05 23:00:37 -050059extras =
60 pep8test
Alex Gaynor5b8126f2014-05-17 22:34:56 -070061commands =
62 flake8 .
Alex Gaynor967c03b2013-10-21 20:22:50 -070063
Alex Gaynorc510e492013-10-31 11:37:11 -070064[testenv:py3pep8]
Terry Chiaac85fa92015-08-16 13:55:46 +080065basepython = python3
Chris Wolfe0b26ab22016-11-05 23:00:37 -050066extras =
67 pep8test
Alex Gaynord8387832014-05-17 22:35:16 -070068commands =
69 flake8 .
Alex Gaynorc510e492013-10-31 11:37:11 -070070
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100071[testenv:randomorder]
72deps =
73 {[testenv]deps}
74 pytest-random
75commands =
76 py.test --capture=no --strict --random {posargs}
77
Alex Gaynor967c03b2013-10-21 20:22:50 -070078[flake8]
Terry Chia5cec1bf2015-03-22 11:49:08 +080079exclude = .tox,*.egg,.git,_build,.hypothesis
Alex Stapletonbafceb62014-03-22 08:50:07 +000080select = E,W,F,N,I
Alex Stapleton707b0082014-04-20 22:24:41 +010081application-import-names = cryptography,cryptography_vectors,tests
Alex Gaynor95f2c2b2014-08-19 16:18:01 -070082
83[doc8]
84extensions = rst
Terry Chia36b35b12014-12-14 15:32:16 +080085
86[pytest]
87addopts = -r s
88markers =
89 requires_backend_interface: this test requires a specific backend interface
90 supported: parametrized test requiring only_if and skip_message