aboutsummaryrefslogtreecommitdiffstats
path: root/tox.ini
blob: 91f8dccc566265830ec626aa3d7d054650999700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
##############################################################################
# Copyright (c) 2019 opnfv.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

# 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 = weblint,pep8,py27
skipsdist = True
sitepackages = True

[testenv]
basepython = python2.7
usedevelop = True
install_command = pip install -U {opts} {packages}
deps =
  -rrequirements.txt
  -rtest-requirements.txt
commands=
  py.test \
  --basetemp={envtmpdir} \
  --cov=opnfv_testapi \
  --cov-report term-missing \
  --cov-report xml \
  {posargs}
setenv=
  HOME = {envtmpdir}
  PYTHONPATH = {toxinidir}

[testenv:weblint]
deps = nodeenv
commands =
  nodeenv --force -r node-requirements.txt {envdir}/npmenv
  bash -c 'ln -f -s {envdir}/npmenv/bin/node {envdir}/bin/node'
  {envdir}/npmenv/bin/htmllint --cwd {toxinidir}/3rd_party/
  {envdir}/npmenv/bin/csslint {toxinidir}/3rd_party/
whitelist_externals = bash

[testenv:pep8]
deps = flake8
commands = flake8 opnfv_testapi

[flake8]
# H803 skipped on purpose per list discussion.
# E123, E125 skipped as they are invalid PEP-8.

show-source = True
ignore = E123,E125,H803,W503
builtins = _
exclude = build,dist,doc,legacy,.eggs,.git,.tox,.venv,testapi_venv,venv

[pytest]
testpaths = opnfv_testapi/tests
python_functions = test_*