-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
85 lines (78 loc) · 2.44 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
# SPDX-FileCopyrightText: 2023 Jonas Huber <https://github.com/jh-rli> © Reiner Lemoine Institut
# SPDX-FileCopyrightText: 2023 Ludwig Hülk <https://github.com/Ludee> © Reiner Lemoine Institut
# SPDX-License-Identifier: MIT
[tox]
minversion = 4.4.6
ignore_basepython_conflict = true
# these are the environments that will run when you
# execute `tox` in the command-line
# bellow you will find explanations for all environments
envlist =
test
lint
# configures which environments run with each python version
# the current configuration has the 'test' enviroment. This will run the
# unit test for running python version. It is not needed to state the python
# version because the installation process already ensures only supported
# versions are installed
[testenv]
basepython =
{test,lint}: {env:TOXPYTHON:python3}
passenv = *
# configures the unittest environment for python 3.6
[testenv:test]
setenv =
PYTHONPATH={toxinidir}/test
PYTHONUNBUFFERED=yes
usedevelop = true
# installs dependencies we need for testing
# by using tox, developers don't need to manage project's dependencies
# for unit testing
deps =
-r{toxinidir}/requirements.txt
coverage
pytest
pytest-cov
hypothesis
# before running the tests erases any prerecord of coverage
commands_pre =
coverage erase
# execute pytest
commands =
pytest --cov --cov-report=term-missing --cov-append --cov-config=.coveragerc --hypothesis-show-statistics {posargs}
# after executing the pytest assembles the coverage reports
commands_post =
coverage report
coverage html
coverage xml
# in previous verions, I had independent environments to manage the
# coverage reports. However, I found that doing such as pre and post
# commands facilitates many configuration details
# separates lint from build env
[testenv:lint]
deps =
ruff
skip_install = true
commands =
ruff format --check --diff {posargs:super_repo test}
ruff check --diff {posargs:super_repo test docs}
[tool:pytest]
# If a pytest section is found in one of the possible config files
# (pytest.ini, tox.ini or setup.cfg), then pytest will not look for any others,
# so if you add a pytest config section elsewhere,
# you will need to delete this section from setup.cfg.
#norecursedirs =
#migrations
addopts = -p pytest_cov
python_files =
test_*.py
*_test.py
tests.py
#addopts =
# -ra
# --strict
# --doctest-modules
# --doctest-glob=\*.rst
# --tb=short
testpaths =
test