-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
63 lines (56 loc) · 2.53 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
# Documentation: https://tox.wiki/en/latest/config.html
[tox]
requires = tox>4
skip_missing_interpreters = false
env_list =
# pytest-pt doesn't work with pytest 5.x on Python ≥3.10
py{3.7,3.8,3.9}-pytest5
py{3.7,3.8,3.9,3.10,3.11,3.12}-pytest7
py{3.8,3.9,3.10,3.11,3.12}-pytest8
# XXX tox can't seem to find python3.6, though it's there.
#py3.6-pytest{5,7}
# See: https://tox.wiki/en/latest/config.html#ignore_base_python_conflict
# When ignore_base_python_conflict = true (the default), tox might ignore
# any base_python settings for a particular testenv and instead just go
# ahead and use whatever it can find that it thinks is the right version.
# We instead want an error if the base_python is thought to be an
# incorrect version for an environment with pyN.M in the name.
ignore_base_python_conflict = false
[testenv]
use_develop = True # install as editable, where possible
deps =
./ # pytest-pt
pytest4: pytest==4.*
pytest5: pytest==5.*
pytest6: pytest==6.*
pytest7: pytest==7.*
pytest8: pytest==8.*
allowlist_externals = ./check-py-ver
commands =
# pytest will fail if there are no tests to run. Thus, using -k
# separately on both the one test from *.pt and the one test from
# *_test.py will ensure that both tests are being collected and run.
./check-py-ver
pytest -qq -k pt_test {posargs}
pytest -qq -k regular_test {posargs}
# Specifying explicit paths to Pythons here doesn't seem to work; tox
# complains about "env name py3.8-pytest5 conflicting with base python...",
# regardless of the ignore_base_python_conflict setting. (More details at
# <https://stackoverflow.com/q/77823499/107294>.) So for the moment, we
# hack this by just having the Test script add all of the pythonz Pythons'
# bin/ dirs to the path, and tox seems to find the right ones.
# <https://stackoverflow.com/a/67308364/107294> might provide some
# useful hints as to how to do this better.
#
#base_python =
# py3.7: /home/cjs/.pythonz/pythons/CPython-3.7.17/bin/python3.7
# py3.8: /home/cjs/.pythonz/pythons/CPython-3.8.18/bin/python3
# py3.9: /home/cjs/.pythonz/pythons/CPython-3.9.18/bin/python
####################################################################
# Pytest 5.x configuration
# This is used by pytest 5.x, which does not read pyproject.toml files.
# It is ignored by pytest ≥ 6.0, which finds the pyproject.toml file
# first and reads only that for options.
[pytest]
addopts = -p pytest_pt
testpaths = tsrc/