Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 1 | [tox] |
Christian Heimes | dbf1835 | 2016-11-30 13:33:02 +0100 | [diff] [blame] | 2 | minversion = 2.4 |
Paul Kehrer | 4cf6e78 | 2017-10-12 06:06:01 +0800 | [diff] [blame^] | 3 | envlist = py27,pypy,py34,py35,py36,docs,pep8,py3pep8 |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 4 | |
| 5 | [testenv] |
Chris Wolfe | 0b26ab2 | 2016-11-05 23:00:37 -0500 | [diff] [blame] | 6 | extras = |
| 7 | test |
Alex Gaynor | 83a0f48 | 2013-08-10 15:48:57 -0400 | [diff] [blame] | 8 | deps = |
Paul Kehrer | e535985 | 2017-09-13 09:30:51 +0800 | [diff] [blame] | 9 | # This must be kept in sync with Jenkinsfile and .travis/install.sh |
| 10 | coverage==4.3.4 |
Alex Stapleton | 3888a84 | 2014-03-24 23:05:53 +0000 | [diff] [blame] | 11 | ./vectors |
Paul Kehrer | 9b6ae9c | 2015-09-15 18:30:55 -0500 | [diff] [blame] | 12 | passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME |
Alex Gaynor | ff61cd3 | 2013-10-03 09:52:08 -0700 | [diff] [blame] | 13 | commands = |
Paul Kehrer | 7cf4c30 | 2015-06-06 08:45:09 -0500 | [diff] [blame] | 14 | pip list |
Donald Stufft | 62143e4 | 2014-11-13 08:17:36 -0500 | [diff] [blame] | 15 | # 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 Gaynor | 3e81fb2 | 2013-11-05 16:29:19 -0800 | [diff] [blame] | 20 | coverage report -m |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 21 | |
Paul Kehrer | 63df010 | 2017-06-19 00:59:13 -1000 | [diff] [blame] | 22 | # This target disables coverage on pypy because of performance problems with |
| 23 | # coverage.py on pypy. |
| 24 | [testenv:pypy-nocoverage] |
| 25 | basepython = pypy |
| 26 | commands = |
| 27 | pip list |
| 28 | pytest --capture=no --strict {posargs} |
| 29 | |
Alex Gaynor | 7c8ed9e | 2017-08-14 23:25:01 -0400 | [diff] [blame] | 30 | # This target disables coverage on pypy because of performance problems with |
| 31 | # coverage.py on pypy. |
| 32 | [testenv:pypy3-nocoverage] |
| 33 | basepython = pypy3 |
| 34 | commands = |
| 35 | pip list |
| 36 | pytest --capture=no --strict {posargs} |
| 37 | |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 38 | [testenv:docs] |
Chris Wolfe | 0b26ab2 | 2016-11-05 23:00:37 -0500 | [diff] [blame] | 39 | extras = |
| 40 | docstest |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 41 | basepython = python2.7 |
Donald Stufft | 235fa71 | 2013-08-11 17:47:17 -0400 | [diff] [blame] | 42 | commands = |
Paul Kehrer | a3facfa | 2017-10-11 19:49:27 +0800 | [diff] [blame] | 43 | 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 Kehrer | b525adf | 2014-09-29 15:18:23 -0500 | [diff] [blame] | 47 | doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/ |
Donald Stufft | 942e91d | 2015-02-12 21:39:51 -0500 | [diff] [blame] | 48 | python setup.py check --restructuredtext --strict |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 49 | |
Paul Kehrer | 986b190 | 2014-03-02 16:35:21 -0400 | [diff] [blame] | 50 | [testenv:docs-linkcheck] |
Paul Kehrer | 562b9a9 | 2016-11-13 05:46:04 -0800 | [diff] [blame] | 51 | extras = |
Paul Kehrer | 986b190 | 2014-03-02 16:35:21 -0400 | [diff] [blame] | 52 | deps = |
| 53 | sphinx |
| 54 | basepython = python2.7 |
| 55 | commands = |
| 56 | sphinx-build -W -b linkcheck docs docs/_build/html |
| 57 | |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 58 | [testenv:pep8] |
Chris Wolfe | 0b26ab2 | 2016-11-05 23:00:37 -0500 | [diff] [blame] | 59 | extras = |
| 60 | pep8test |
Alex Gaynor | 5b8126f | 2014-05-17 22:34:56 -0700 | [diff] [blame] | 61 | commands = |
| 62 | flake8 . |
Alex Gaynor | 967c03b | 2013-10-21 20:22:50 -0700 | [diff] [blame] | 63 | |
Alex Gaynor | c510e49 | 2013-10-31 11:37:11 -0700 | [diff] [blame] | 64 | [testenv:py3pep8] |
Terry Chia | ac85fa9 | 2015-08-16 13:55:46 +0800 | [diff] [blame] | 65 | basepython = python3 |
Chris Wolfe | 0b26ab2 | 2016-11-05 23:00:37 -0500 | [diff] [blame] | 66 | extras = |
| 67 | pep8test |
Alex Gaynor | d838783 | 2014-05-17 22:35:16 -0700 | [diff] [blame] | 68 | commands = |
| 69 | flake8 . |
Alex Gaynor | c510e49 | 2013-10-31 11:37:11 -0700 | [diff] [blame] | 70 | |
Paul Kehrer | 1ecc7f1 | 2014-11-20 19:47:12 -1000 | [diff] [blame] | 71 | [testenv:randomorder] |
| 72 | deps = |
| 73 | {[testenv]deps} |
| 74 | pytest-random |
| 75 | commands = |
| 76 | py.test --capture=no --strict --random {posargs} |
| 77 | |
Alex Gaynor | 967c03b | 2013-10-21 20:22:50 -0700 | [diff] [blame] | 78 | [flake8] |
Terry Chia | 5cec1bf | 2015-03-22 11:49:08 +0800 | [diff] [blame] | 79 | exclude = .tox,*.egg,.git,_build,.hypothesis |
Alex Stapleton | bafceb6 | 2014-03-22 08:50:07 +0000 | [diff] [blame] | 80 | select = E,W,F,N,I |
Alex Stapleton | 707b008 | 2014-04-20 22:24:41 +0100 | [diff] [blame] | 81 | application-import-names = cryptography,cryptography_vectors,tests |
Alex Gaynor | 95f2c2b | 2014-08-19 16:18:01 -0700 | [diff] [blame] | 82 | |
| 83 | [doc8] |
| 84 | extensions = rst |
Terry Chia | 36b35b1 | 2014-12-14 15:32:16 +0800 | [diff] [blame] | 85 | |
| 86 | [pytest] |
| 87 | addopts = -r s |
| 88 | markers = |
| 89 | requires_backend_interface: this test requires a specific backend interface |
| 90 | supported: parametrized test requiring only_if and skip_message |