blob: cb882a8aa339cd065d635c8ab6237fc0e5953638 [file] [log] [blame]
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07001[tox]
Christian Heimesdbf18352016-11-30 13:33:02 +01002minversion = 2.4
Paul Kehrer4ee1cb92018-06-27 20:07:14 -07003envlist = py27,pypy,py34,py35,py36,py37,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 =
Paul Kehrere3d2fc12018-03-05 20:50:10 -040040 docs
Chris Wolfe0b26ab22016-11-05 23:00:37 -050041 docstest
Paul Kehrer056c9dd2018-05-12 15:17:06 -040042basepython = python3
Donald Stufft235fa712013-08-11 17:47:17 -040043commands =
Paul Kehrera3facfa2017-10-11 19:49:27 +080044 sphinx-build -j4 -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
45 sphinx-build -j4 -T -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
46 sphinx-build -j4 -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
47 sphinx-build -j4 -T -W -b spelling docs docs/_build/html
Paul Kehrerb525adf2014-09-29 15:18:23 -050048 doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/
Donald Stufft942e91d2015-02-12 21:39:51 -050049 python setup.py check --restructuredtext --strict
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070050
Paul Kehrer986b1902014-03-02 16:35:21 -040051[testenv:docs-linkcheck]
Paul Kehrer562b9a92016-11-13 05:46:04 -080052extras =
Paul Kehrer986b1902014-03-02 16:35:21 -040053deps =
54 sphinx
55basepython = python2.7
56commands =
57 sphinx-build -W -b linkcheck docs docs/_build/html
58
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070059[testenv:pep8]
Chris Wolfe0b26ab22016-11-05 23:00:37 -050060extras =
61 pep8test
Alex Gaynor5b8126f2014-05-17 22:34:56 -070062commands =
63 flake8 .
Alex Gaynor967c03b2013-10-21 20:22:50 -070064
Alex Gaynorc510e492013-10-31 11:37:11 -070065[testenv:py3pep8]
Terry Chiaac85fa92015-08-16 13:55:46 +080066basepython = python3
Chris Wolfe0b26ab22016-11-05 23:00:37 -050067extras =
68 pep8test
Alex Gaynord8387832014-05-17 22:35:16 -070069commands =
70 flake8 .
Alex Gaynorc510e492013-10-31 11:37:11 -070071
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100072[testenv:randomorder]
73deps =
74 {[testenv]deps}
75 pytest-random
76commands =
Ville Skyttä40c6d402018-05-13 16:23:49 +020077 pytest --capture=no --strict --random {posargs}
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100078
Alex Gaynor967c03b2013-10-21 20:22:50 -070079[flake8]
Terry Chia5cec1bf2015-03-22 11:49:08 +080080exclude = .tox,*.egg,.git,_build,.hypothesis
Alex Stapletonbafceb62014-03-22 08:50:07 +000081select = E,W,F,N,I
Alex Stapleton707b0082014-04-20 22:24:41 +010082application-import-names = cryptography,cryptography_vectors,tests
Alex Gaynor95f2c2b2014-08-19 16:18:01 -070083
84[doc8]
85extensions = rst
Terry Chia36b35b12014-12-14 15:32:16 +080086
87[pytest]
88addopts = -r s
89markers =
90 requires_backend_interface: this test requires a specific backend interface
91 supported: parametrized test requiring only_if and skip_message
Alex Gaynor2e85a922018-07-16 11:18:33 -040092 wycheproof_tests: this test runs a wycheproof fixture