blob: 350a1fc114fe79fd5fab38ce2f4fe58cd24ddcd1 [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 =
Adam Israelcaf6efb2019-03-27 19:07:43 -040023 asynctest
24 ipdb
25 mock
Adam Israeldcdf82b2017-08-15 15:26:43 -040026 pytest
27 pytest-asyncio
28 pytest-xdist
Adam Israelcaf6efb2019-03-27 19:07:43 -040029 Twine
30 # use fork to pick up fix for https://github.com/aaugustin/websockets/pull/528
31 git+https://github.com/johnsca/websockets@bug/client-redirects#egg=websockets
Adam Israeldcdf82b2017-08-15 15:26:43 -040032
Adam Israelb0943662018-08-02 15:32:00 -040033[testenv:py3]
34# default tox env excludes integration and serial tests
35commands =
36 # These need to be installed in a specific order
37 pip install urllib3==1.22
38 pip install pylxd
39 py.test --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
40
41[testenv:lint]
42envdir = {toxworkdir}/py3
43commands =
Adam Israelcaf6efb2019-03-27 19:07:43 -040044 flake8 --ignore E501,W504 {posargs} juju tests
Adam Israel1a15d1c2017-10-23 12:00:49 -040045deps =
46 flake8
47
Adam Israeldcdf82b2017-08-15 15:26:43 -040048[testenv:integration]
Adam Israelb0943662018-08-02 15:32:00 -040049envdir = {toxworkdir}/py3
Adam Israelcaf6efb2019-03-27 19:07:43 -040050commands =
51 # These need to be installed in a specific order
52 pip install urllib3==1.22
53 pip install pylxd
54 py.test --tb native -ra -v -s -n auto -k 'integration' -m 'not serial' {posargs}
Adam Israelb0943662018-08-02 15:32:00 -040055
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/_*