Chip Boling | 67b674a | 2019-02-08 11:42:18 -0600 | [diff] [blame] | 1 | ; |
| 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 |
| 18 | envlist = py27 |
| 19 | minversion = 2.5.0 |
| 20 | |
| 21 | [package] |
| 22 | name = pyvoltha |
| 23 | |
| 24 | [cov] |
| 25 | xml = --cov-report xml:{toxworkdir}/{envname}coverage.xml |
| 26 | term = --cov-report term-missing |
| 27 | html = --cov-report html:{toxworkdir}/{envname}cov |
| 28 | branch = --cov-branch |
| 29 | directory =--cov {envsitepackagesdir}/{[package]name} |
| 30 | coverage = {[cov]xml} {[cov]term} {[cov]html} {[cov]branch} {[cov]directory} |
| 31 | cov_fail_under=100 |
| 32 | |
| 33 | [pylama] |
| 34 | format = pylint |
| 35 | skip = */.tox/*,*/.env/* |
| 36 | linters = pep8,pylint |
| 37 | analysis_dirs = {[package]name} test |
| 38 | analysis = pylama {[pylama]analysis_dirs} |
| 39 | |
| 40 | [pylama:pep8] |
| 41 | max_line_length=99 |
| 42 | ignore = E203, W503, R0903 |
| 43 | |
| 44 | [pylama:test/*] |
| 45 | ignore = C0111,R0201,R0903 |
| 46 | |
Chip Boling | 67b674a | 2019-02-08 11:42:18 -0600 | [diff] [blame] | 47 | [pytest] |
| 48 | passenv = {env:PYTEST_ARGS} |
| 49 | flags =-vvl {env:PYTEST_ARGS:} |
| 50 | cov-fail-under=100 |
| 51 | unit_results =--junitxml={toxworkdir}/{envname}_results.xml |
| 52 | test = py.test {[pytest]flags} {[pytest]unit_results} |
| 53 | with_metrics = {[pytest]test} {[cov]coverage} |
| 54 | |
Chip Boling | ce2daf6 | 2019-02-12 13:53:39 -0600 | [diff] [blame] | 55 | [nosetests] |
| 56 | passenv = |
| 57 | |
Chip Boling | 67b674a | 2019-02-08 11:42:18 -0600 | [diff] [blame] | 58 | [testenv] |
Chip Boling | ce2daf6 | 2019-02-12 13:53:39 -0600 | [diff] [blame] | 59 | changedir = test/unit |
Chip Boling | 67b674a | 2019-02-08 11:42:18 -0600 | [diff] [blame] | 60 | basepython = |
| 61 | py27: python2.7 |
| 62 | ;py3: python3 |
| 63 | envdir = |
| 64 | py27: {toxworkdir}/.py27 |
| 65 | ;py3: {toxworkdir}/.py3 |
| 66 | setenv = |
| 67 | COVERAGE_FILE = {envdir}/.coverage |
Chip Boling | ce2daf6 | 2019-02-12 13:53:39 -0600 | [diff] [blame] | 68 | PYTHONPATH = {toxinidir}:{toxinidir}/pyvoltha/protos/third_party |
| 69 | |
Chip Boling | 67b674a | 2019-02-08 11:42:18 -0600 | [diff] [blame] | 70 | commands = |
Chip Boling | ce2daf6 | 2019-02-12 13:53:39 -0600 | [diff] [blame] | 71 | py27: nosetests {posargs} |
Chip Boling | 67b674a | 2019-02-08 11:42:18 -0600 | [diff] [blame] | 72 | ; 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 Boling | 67b674a | 2019-02-08 11:42:18 -0600 | [diff] [blame] | 81 | |
| 82 | deps = |
| 83 | nose |
| 84 | -r{toxinidir}/requirements.txt |
| 85 | -r{toxinidir}/test-requirements.txt |