X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Ftox.ini;fp=modules%2Flibjuju%2Ftox.ini;h=350a1fc114fe79fd5fab38ce2f4fe58cd24ddcd1;hp=0000000000000000000000000000000000000000;hb=e2051cca7dac12aa09f6ed33555dcc4548c4b52b;hpb=9d18c22a0dc9e295adda50601fc5e2f45d2c9b8a diff --git a/modules/libjuju/tox.ini b/modules/libjuju/tox.ini new file mode 100644 index 0000000..350a1fc --- /dev/null +++ b/modules/libjuju/tox.ini @@ -0,0 +1,66 @@ +# Tox (http://tox.testrun.org/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = lint,py3 +skipsdist=True + +[pytest] +markers = + serial: mark a test that must run by itself + +[testenv] +basepython=python3 +usedevelop=True +# for testing with other python versions +commands = py.test --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs} +passenv = + HOME + TEST_AGENTS +deps = + asynctest + ipdb + mock + pytest + pytest-asyncio + pytest-xdist + Twine + # use fork to pick up fix for https://github.com/aaugustin/websockets/pull/528 + git+https://github.com/johnsca/websockets@bug/client-redirects#egg=websockets + +[testenv:py3] +# default tox env excludes integration and serial tests +commands = + # These need to be installed in a specific order + pip install urllib3==1.22 + pip install pylxd + py.test --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs} + +[testenv:lint] +envdir = {toxworkdir}/py3 +commands = + flake8 --ignore E501,W504 {posargs} juju tests +deps = + flake8 + +[testenv:integration] +envdir = {toxworkdir}/py3 +commands = + # These need to be installed in a specific order + pip install urllib3==1.22 + pip install pylxd + py.test --tb native -ra -v -s -n auto -k 'integration' -m 'not serial' {posargs} + +[testenv:serial] +# tests that can't be run in parallel +envdir = {toxworkdir}/py3 +commands = py.test --tb native -ra -v -s {posargs:-m 'serial'} + +[testenv:example] +envdir = {toxworkdir}/py3 +commands = python {posargs} + +[flake8] +exclude = juju/client/_*