blob: e0d6a31c779d480a4b9a2387cbf2329f9afc2ddb [file] [log] [blame]
Adam Israeldcdf82b2017-08-15 15:26:43 -04001# 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 Israelb0943662018-08-02 15:32:00 -04007envlist = lint,py3
Adam Israeldcdf82b2017-08-15 15:26:43 -04008skipsdist=True
9
Adam Israelb0943662018-08-02 15:32:00 -040010[pytest]
11markers =
12 serial: mark a test that must run by itself
13
Adam Israeldcdf82b2017-08-15 15:26:43 -040014[testenv]
Adam Israel1a15d1c2017-10-23 12:00:49 -040015basepython=python3
Adam Israeldcdf82b2017-08-15 15:26:43 -040016usedevelop=True
Adam Israel1a15d1c2017-10-23 12:00:49 -040017# for testing with other python versions
Adam Israelb0943662018-08-02 15:32:00 -040018commands = py.test --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
Adam Israeldcdf82b2017-08-15 15:26:43 -040019passenv =
20 HOME
Adam Israelb0943662018-08-02 15:32:00 -040021 TEST_AGENTS
Adam Israeldcdf82b2017-08-15 15:26:43 -040022deps =
23 pytest
24 pytest-asyncio
25 pytest-xdist
26 mock
27 asynctest
28 ipdb
29
Adam Israelb0943662018-08-02 15:32:00 -040030[testenv:py3]
31# default tox env excludes integration and serial tests
32commands =
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]
39envdir = {toxworkdir}/py3
40commands =
41 flake8 --ignore E501 {posargs} juju tests
42deps =
43 flake8
Adam Israeldcdf82b2017-08-15 15:26:43 -040044
Adam Israel1a15d1c2017-10-23 12:00:49 -040045[testenv:lint]
46envdir = {toxworkdir}/py35
47commands =
48 flake8 --ignore E501 {posargs} juju
49deps =
50 flake8
51
Adam Israeldcdf82b2017-08-15 15:26:43 -040052[testenv:integration]
Adam Israelb0943662018-08-02 15:32:00 -040053envdir = {toxworkdir}/py3
54commands = 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
58envdir = {toxworkdir}/py3
59commands = py.test --tb native -ra -v -s {posargs:-m 'serial'}
60
61[testenv:example]
62envdir = {toxworkdir}/py3
63commands = python {posargs}
Adam Israel1a15d1c2017-10-23 12:00:49 -040064
65[flake8]
66exclude = juju/client/_*