-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
75 lines (67 loc) · 2.32 KB
/
tox.ini
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
63
64
65
66
67
68
69
70
71
72
73
74
[tox]
skipsdist = True
envlist = py3-coverage,coveragereport,pep8,pylint
minversion = 3.18.0
[flake8]
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality
# H205: Use assert(Greater|Less)(Equal) for comparison
# H904: Delay string interpolations at logging calls
enable-extensions = H106,H203,H204,H205,H904
show-source = true
exclude = ./.*,build,dist
import-order-style = pep8
[coverage:run]
parallel = True
branch = True
source = searchkit
omit = tests/*
[coverage:report]
ignore_errors = True
skip_empty = True
precision = 2
fail_under = 87
[testenv]
basepython = {env:TOX_PYTHON:python3}
unit_tests = {toxinidir}/tests/unit/
pyfiles =
{toxinidir}/setup.py {toxinidir}/searchkit/ {[testenv]unit_tests}
setenv =
PYTHONHASHSEED=0
# Override the default coverage output path to tox's temp directory
# so we don't pollute the root dir.
COVERAGE_FILE={temp_dir}/.coverage
# Override the default "PYTHON" when the "-coverage" is present.
# This allows us to run additional steps on top of the default
# test run, such as changing the default interpreter to "coverage run".
coverage: PYTHON=coverage run
passenv =
TESTS_LOG_LEVEL_DEBUG
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
coverage: coverage erase
# This environment can "optionally" gather coverage data with "-coverage"
# suffix. The gathered coverage data is consumed by the "coverage"
# environment which merges the data and then generates coverage reports in
# HTML and XML formats.
stestr run --random --slowest --test-path {[testenv]unit_tests} {posargs}
[testenv:pep8]
commands = flake8 -v {posargs:{[testenv]pyfiles}}
[testenv:pylint]
commands = pylint -v --rcfile={toxinidir}/pylintrc {posargs:{[testenv]pyfiles}}
[testenv:coveragereport]
depends = py3-coverage
description =
'Generate code coverage reports from collected coverage information.
This environment depends on `py3-coverage` for generating the actual
code coverage data from the test run. To collect and generate in a
single step, run `tox -e py3-coverage,coveragereport`.'
commands =
coverage combine
coverage report
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage erase