X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Ftox.ini;h=e0d6a31c779d480a4b9a2387cbf2329f9afc2ddb;hp=789bbebdecabf8f09702a6ccac257b36367427ab;hb=bf79352ca652b228c5c216564cc512b635e3c5e4;hpb=68858c1915122c2dbc8999a5cd3229694abf5f3a diff --git a/modules/libjuju/tox.ini b/modules/libjuju/tox.ini index 789bbeb..e0d6a31 100644 --- a/modules/libjuju/tox.ini +++ b/modules/libjuju/tox.ini @@ -4,13 +4,21 @@ # and then run "tox" from this directory. [tox] -envlist = py35 +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 = pytest pytest-asyncio @@ -19,10 +27,40 @@ deps = asynctest ipdb -[testenv:py35] -# default tox env excludes integration tests -commands = py.test -ra -v -s -x -n auto -k 'not integration' {posargs} +[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 {posargs} juju tests +deps = + flake8 + +[testenv:lint] +envdir = {toxworkdir}/py35 +commands = + flake8 --ignore E501 {posargs} juju +deps = + flake8 [testenv:integration] -basepython=python3 -commands = py.test -ra -v -s -x -n auto {posargs} +envdir = {toxworkdir}/py3 +commands = 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/_*