| Adam Israel | dcdf82b | 2017-08-15 15:26:43 -0400 | [diff] [blame] | 1 | # Tox (http://tox.testrun.org/) is a tool for running tests |
| 2 | # in multiple virtualenvs. This configuration file will run the |
| 3 | # test suite on all supported python versions. To use it, "pip install tox" |
| 4 | # and then run "tox" from this directory. |
| 5 | |
| 6 | [tox] |
| Adam Israel | 1a15d1c | 2017-10-23 12:00:49 -0400 | [diff] [blame] | 7 | envlist = lint,py35 |
| Adam Israel | dcdf82b | 2017-08-15 15:26:43 -0400 | [diff] [blame] | 8 | skipsdist=True |
| 9 | |
| 10 | [testenv] |
| Adam Israel | 1a15d1c | 2017-10-23 12:00:49 -0400 | [diff] [blame] | 11 | basepython=python3 |
| Adam Israel | dcdf82b | 2017-08-15 15:26:43 -0400 | [diff] [blame] | 12 | usedevelop=True |
| Adam Israel | 1a15d1c | 2017-10-23 12:00:49 -0400 | [diff] [blame] | 13 | # for testing with other python versions |
| 14 | commands = py.test -ra -v -s -x -n auto {posargs} |
| Adam Israel | dcdf82b | 2017-08-15 15:26:43 -0400 | [diff] [blame] | 15 | passenv = |
| 16 | HOME |
| 17 | deps = |
| 18 | pytest |
| 19 | pytest-asyncio |
| 20 | pytest-xdist |
| 21 | mock |
| 22 | asynctest |
| 23 | ipdb |
| 24 | |
| 25 | [testenv:py35] |
| 26 | # default tox env excludes integration tests |
| 27 | commands = py.test -ra -v -s -x -n auto -k 'not integration' {posargs} |
| 28 | |
| Adam Israel | 1a15d1c | 2017-10-23 12:00:49 -0400 | [diff] [blame] | 29 | [testenv:lint] |
| 30 | envdir = {toxworkdir}/py35 |
| 31 | commands = |
| 32 | flake8 --ignore E501 {posargs} juju |
| 33 | deps = |
| 34 | flake8 |
| 35 | |
| Adam Israel | dcdf82b | 2017-08-15 15:26:43 -0400 | [diff] [blame] | 36 | [testenv:integration] |
| Adam Israel | 1a15d1c | 2017-10-23 12:00:49 -0400 | [diff] [blame] | 37 | envdir = {toxworkdir}/py35 |
| 38 | |
| 39 | [flake8] |
| 40 | exclude = juju/client/_* |