blob: b32b8b6597f146dbb4b70a9e5207b266d933d914 [file] [log] [blame]
Chip Boling67b674a2019-02-08 11:42:18 -06001;
2; Copyright 2017 the original author or authors.
3;
4; Licensed under the Apache License, Version 2.0 (the "License");
5; you may not use this file except in compliance with the License.
6; You may obtain a copy of the License at
7;
8; http://www.apache.org/licenses/LICENSE-2.0
9;
10; Unless required by applicable law or agreed to in writing, software
11; distributed under the License is distributed on an "AS IS" BASIS,
12; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13; See the License for the specific language governing permissions and
14; limitations under the License.
15;
16[tox]
17;envlist = py27, py36, py3-analysis, py3-test
18envlist = py27
19minversion = 2.5.0
20
21[package]
22name = pyvoltha
23
24[cov]
25xml = --cov-report xml:{toxworkdir}/{envname}coverage.xml
26term = --cov-report term-missing
27html = --cov-report html:{toxworkdir}/{envname}cov
28branch = --cov-branch
29directory =--cov {envsitepackagesdir}/{[package]name}
30coverage = {[cov]xml} {[cov]term} {[cov]html} {[cov]branch} {[cov]directory}
31cov_fail_under=100
32
33[pylama]
34format = pylint
35skip = */.tox/*,*/.env/*
36linters = pep8,pylint
37analysis_dirs = {[package]name} test
38analysis = pylama {[pylama]analysis_dirs}
39
40[pylama:pep8]
41max_line_length=99
42ignore = E203, W503, R0903
43
44[pylama:test/*]
45ignore = C0111,R0201,R0903
46
Chip Boling67b674a2019-02-08 11:42:18 -060047[pytest]
48passenv = {env:PYTEST_ARGS}
49flags =-vvl {env:PYTEST_ARGS:}
50cov-fail-under=100
51unit_results =--junitxml={toxworkdir}/{envname}_results.xml
52test = py.test {[pytest]flags} {[pytest]unit_results}
53with_metrics = {[pytest]test} {[cov]coverage}
54
Chip Bolingce2daf62019-02-12 13:53:39 -060055[nosetests]
56passenv =
57
Chip Boling67b674a2019-02-08 11:42:18 -060058[testenv]
Chip Bolingce2daf62019-02-12 13:53:39 -060059changedir = test/unit
Chip Boling67b674a2019-02-08 11:42:18 -060060basepython =
61 py27: python2.7
62 ;py3: python3
63envdir =
64 py27: {toxworkdir}/.py27
65 ;py3: {toxworkdir}/.py3
66setenv =
67 COVERAGE_FILE = {envdir}/.coverage
Chip Bolingce2daf62019-02-12 13:53:39 -060068 PYTHONPATH = {toxinidir}:{toxinidir}/pyvoltha/protos/third_party
69
Chip Boling67b674a2019-02-08 11:42:18 -060070commands =
Chip Bolingce2daf62019-02-12 13:53:39 -060071 py27: nosetests {posargs}
Chip Boling67b674a2019-02-08 11:42:18 -060072; py3-test: {[pytest]with_metrics} test
73; py3-no-coverage: {[pytest]test} test
74; py3-unit: {[pytest]with_metrics} test/unit
75; py3-component: {[pytest]with_metrics} test/component
76; py3-adhoc: {posargs: bash -c 'echo must provide posargs with "tox args -- posargs"'}
77; py3-analysis: {[pylama]analysis}
78; py3-analysis: black --check {[pylama]analysis_dirs}
79; py3-black: black {[pylama]analysis_dirs}
80; py3-docs: sphinx-build -b html docs docs_out
Chip Boling67b674a2019-02-08 11:42:18 -060081
82deps =
83 nose
84 -r{toxinidir}/requirements.txt
85 -r{toxinidir}/test-requirements.txt