X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=tox.ini;h=d2674c9798414608308f698d0925e226f03b1deb;hp=502214f1638e3abeaeb72ff5dce615c19ffd312d;hb=d598914ec9d1be351c0c15739629a910d0ff59a5;hpb=4b81dfabae6b883bd5cde9c97614bcb410103429 diff --git a/tox.ini b/tox.ini index 502214f..d2674c9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,31 +1,68 @@ -# 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. +# Copyright 2019 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. [tox] -envlist = lint,py35 +envlist = cover, flake8, pylint skipsdist=True [testenv] -basepython=python3 -usedevelop=True -# for testing with other python versions -commands=nosetests + +[testenv:cover] +basepython = python3 deps = - nose - mock - pyyaml + nose2 + -rrequirements.txt + -rtest-requirements.txt +commands = + coverage erase + nose2 -C --coverage n2vc --plugin nose2.plugins.junitxml -s n2vc + coverage report --omit='*tests*' + coverage html -d ./cover --omit='*tests*' + coverage xml -o coverage.xml --omit='*tests*' -[testenv:lint] -envdir = {toxworkdir}/py35 +[testenv:pylint] +basepython = python3 +deps = + pylint + -rrequirements.txt commands = - flake8 --ignore E501 {posargs} juju tests + pylint -E n2vc + +[testenv:black] +basepython = python3 deps = - flake8 + black +commands = + black --check --diff n2vc -[testenv:build] +[testenv:flake8] basepython = python3 -deps = stdeb - setuptools-version-command +deps = + flake8 + -rrequirements.txt +commands = + flake8 n2vc + +[flake8] +# W503 is invalid PEP-8 +max-line-length = 88 +show-source = True +ignore = W503,E203 +exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,devops_stages/*,.rst + +[testenv:build] +deps = + stdeb + setuptools-version-command commands = python3 setup.py --command-packages=stdeb.command bdist_deb