summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/tox.ini
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-02-23 15:14:12 +0800
committerAric Gardner <agardner@linuxfoundation.org>2017-02-24 21:56:48 +0000
commite50681fa31b03439949b0d74baa8f498687dc101 (patch)
tree8efd820570520395cfcc04387c58990be36708af /utils/test/testapi/tox.ini
parentd22a0be616fb01a3239fed87df9e7145381234a6 (diff)
leverage tox to facilitate the development
Before submitting a patch, we need to execute flake8, unittest, open coverage report, now with the help of tox any pytest, we can process them all with only one command. pytest is choosen here is because of its useful assert showcase, and powerful properties and healthy ecosystem(plugins of mock etc) Change-Id: I7ee89da370da08cc2bc70f7d3b1e2741d7d2e1e8 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/tox.ini')
-rw-r--r--utils/test/testapi/tox.ini41
1 files changed, 41 insertions, 0 deletions
diff --git a/utils/test/testapi/tox.ini b/utils/test/testapi/tox.ini
new file mode 100644
index 000000000..81c9dfab1
--- /dev/null
+++ b/utils/test/testapi/tox.ini
@@ -0,0 +1,41 @@
+# 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 = py27,pep8
+skipsdist = True
+sitepackages = True
+
+[testenv]
+usedevelop = True
+install_command = pip install -U {opts} {packages}
+deps =
+ -rrequirements.txt
+ -rtest-requirements.txt
+commands=
+ py.test \
+ --basetemp={envtmpdir} \
+ --cov \
+ {posargs}
+setenv=
+ HOME = {envtmpdir}
+ PYTHONPATH = {toxinidir}
+
+[testenv:pep8]
+deps = flake8
+commands = flake8 {toxinidir}
+
+[flake8]
+# H803 skipped on purpose per list discussion.
+# E123, E125 skipped as they are invalid PEP-8.
+
+show-source = True
+ignore = E123,E125,H803,E501
+builtins = _
+exclude = build,dist,doc,legacy,.eggs,.git,.tox,.venv,testapi_venv,venv
+
+[pytest]
+testpaths = opnfv_testapi/tests
+python_functions = test_*