Skip to content

Commit df4a1e0

Browse files
committed
chore: move pytest config from tox.ini to pyproject.toml
1 parent b8cc949 commit df4a1e0

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,12 @@ useLibraryCodeForTypes = true
218218
reportGeneralTypeIssues = true
219219

220220
[tool.pytest.ini_options]
221+
addopts = "-ra -v"
221222
asyncio_default_fixture_loop_scope = "function"
223+
asyncio_mode = "auto"
224+
filterwarnings = "ignore::DeprecationWarning:websockets"
225+
markers = [
226+
"serial: mark a test that must run by itself",
227+
"wait_for_idle: mark a test that waits for the model to be idle",
228+
"bundle: mark a test that uses a bundle",
229+
]

tox.ini

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@
88
envlist = py3,py38,py39,py310,py311,docs
99
skipsdist=True
1010

11-
[pytest]
12-
markers =
13-
serial: mark a test that must run by itself
14-
wait_for_idle: mark a test that waits for the model to be idle
15-
bundle: mark a test that uses a bundle
16-
asyncio_mode = auto
17-
filterwarnings =
18-
ignore::DeprecationWarning:websockets
19-
2011
[testenv]
2112
usedevelop=True
2213
commands =
2314
pip install urllib3<2
2415
pip install pylxd
25-
python -m pytest --tb native -ra -v -s -k 'not integration' -m 'not serial' {posargs}
16+
pytest --tb native -s -k 'not integration' -m 'not serial' {posargs}
2617
passenv =
2718
HOME
2819
TEST_AGENTS
@@ -33,7 +24,6 @@ deps =
3324
typing-inspect
3425
paramiko
3526
ipdb
36-
mock
3727
pytest
3828
pytest-asyncio
3929
Twine
@@ -57,9 +47,8 @@ envdir = {toxworkdir}/py3
5747
commands =
5848
pip install urllib3<2
5949
pip install pylxd
60-
python -m pytest \
50+
pytest \
6151
--tb native \
62-
-ra -v \
6352
-k 'integration' \
6453
--ignore {toxinidir}/tests/integration/test_crossmodel.py \
6554
--ignore {toxinidir}/tests/integration/test_model.py \
@@ -71,9 +60,8 @@ envdir = {toxworkdir}/py3
7160
commands =
7261
pip install urllib3<2
7362
pip install pylxd
74-
python -m pytest \
63+
pytest \
7564
--tb native \
76-
-ra -v \
7765
-m 'not serial' \
7866
{posargs} \
7967
{toxinidir}/tests/integration/test_crossmodel.py \
@@ -84,7 +72,7 @@ envdir = {toxworkdir}/py3
8472
commands =
8573
pip install urllib3<2
8674
pip install pylxd
87-
python -m pytest --tb native -ra -v {toxinidir}/tests/unit {posargs}
75+
pytest {toxinidir}/tests/unit {posargs}
8876

8977
[testenv:serial]
9078
# tests that can't be run in parallel
@@ -94,11 +82,11 @@ envdir = {toxworkdir}/py3
9482
commands =
9583
pip install urllib3<2
9684
pip install pylxd
97-
python -m pytest --tb native -ra -v -s {posargs:-m 'serial'}
85+
pytest --tb native -s {posargs:-m 'serial'}
9886

9987
[testenv:validate]
10088
envdir = {toxworkdir}/validate
101-
commands = python -m pytest --tb native -ra -vv tests/validate
89+
commands = pytest -vvv tests/validate
10290

10391
[testenv:example]
10492
envdir = {toxworkdir}/py3

0 commit comments

Comments
 (0)