Merge "Fix bug #502"
[osm/N2VC.git] / modules / libjuju / tox.ini
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]
7 envlist = lint,py3
8 skipsdist=True
9
10 [pytest]
11 markers =
12 serial: mark a test that must run by itself
13
14 [testenv]
15 basepython=python3
16 usedevelop=True
17 # for testing with other python versions
18 commands = py.test --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
19 passenv =
20 HOME
21 TEST_AGENTS
22 deps =
23 pytest
24 pytest-asyncio
25 pytest-xdist
26 mock
27 asynctest
28 ipdb
29
30 [testenv:py3]
31 # default tox env excludes integration and serial tests
32 commands =
33 # These need to be installed in a specific order
34 pip install urllib3==1.22
35 pip install pylxd
36 py.test --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
37
38 [testenv:lint]
39 envdir = {toxworkdir}/py3
40 commands =
41 flake8 --ignore E501 {posargs} juju tests
42 deps =
43 flake8
44
45 [testenv:lint]
46 envdir = {toxworkdir}/py35
47 commands =
48 flake8 --ignore E501 {posargs} juju
49 deps =
50 flake8
51
52 [testenv:integration]
53 envdir = {toxworkdir}/py3
54 commands = py.test --tb native -ra -v -s -n auto -k 'integration' -m 'not serial' {posargs}
55
56 [testenv:serial]
57 # tests that can't be run in parallel
58 envdir = {toxworkdir}/py3
59 commands = py.test --tb native -ra -v -s {posargs:-m 'serial'}
60
61 [testenv:example]
62 envdir = {toxworkdir}/py3
63 commands = python {posargs}
64
65 [flake8]
66 exclude = juju/client/_*