-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
105 lines (100 loc) · 3.17 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
[tox]
envlist = lint,py{38,39,310}-{wheel,sdist},coverage
isolated_build = True
requires =
poetry>=1.2.0
[baseenv]
skip_install = True
allowlist_externals =
/usr/bin/file
C:\Program Files\Git\usr\bin\file.EXE
pytest
pre-commit
poetry
find
sh
commands =
file "{envpython}"
"{envpython}" --version
poetry --version --ansi
# intentionally using --no-root so that later we can choose to use the
# wheel or the editable version
poetry install --only=dev --no-root --ansi
[testenv]
passenv = *
skip_install = True
allowlist_externals =
{[baseenv]allowlist_externals}
commands =
{[baseenv]commands}
poetry build --ansi
{wheel}: # install the wheel
{wheel}: sh -c "find dist -name '*.whl'"
{wheel}: sh -c "find dist -name '*.whl' | xargs pip install --force-reinstall --no-deps"
{sdist}: # install the sdist
{sdist}: sh -c "find dist -name '*.tar.gz'"
{sdist}: sh -c "find dist -name '*.tar.gz' | xargs pip install --force-reinstall --no-deps"
# yes, two --version is correct
pytest --version --version
pytest -c tox.ini --html=.reports/{envname}/test-report.html --junit-xml=.reports/{envname}/junit.xml {posargs}
[testenv:lint]
passenv = *
skip_install = True
allowlist_externals =
{[baseenv]allowlist_externals}
commands =
{[baseenv]commands}
# intentionally using --only-root to install the editable version
poetry install --only-root --ansi
pre-commit run --color=always --verbose --all-files {posargs}
[testenv:coverage]
# NOTE: does not use the pytest settings from tox.ini, uses pyproject.toml
# NOTE: use poetry to install --only-root instead of tox's usedevelop
# usedevelop = true
passenv = *
allowlist_externals =
{[baseenv]allowlist_externals}
commands =
{[baseenv]commands}
# intentionally using --only-root to install the editable version
poetry install --only-root --ansi
pytest {posargs}
coverage lcov
# these options are used when running for all tox envs that runs pytest
# EXCEPT 'coverage', which uses the settings from pyproject.toml
[pytest]
minversion = 7.1
# make XPASS ("unexpectedly passing") result to fail the test suite
xfail_strict = true
addopts =
# report the reasons for all tests that skipped, xfailed, xpassed, etc EXCEPT passed/Passed w/ Output
-ra
# colorize
--force-sugar
--color=yes
# execute doctests directly from docstrings of your classes and functions
--doctest-modules
--doctest-continue-on-failure
# show complete traceback
--tb=long
# show local variable values in traceback
--showlocals
# raise errors if using an unregistered marker
--strict-markers
# raise errors if the config is bad
--strict-config
# let's adopt the future mode already
--import-mode=importlib
# NOTE: this is actually set in the env definition, so that we get the
# env name properly
# # generate report based upon tox env name
# "--html=.reports/test-report-{envname}.html",
# html report should be single file
--self-contained-html
# parallelize tests across available cpu cores
-n=auto
filterwarnings =
error
log_cli_level = debug
testpaths = .
pythonpath = .