Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set the asyncio default before deprecation #1199

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,14 @@ pythonVersion = "3.8"
typeCheckingMode = "strict"
useLibraryCodeForTypes = true
reportGeneralTypeIssues = true

[tool.pytest.ini_options]
addopts = "-ra -v"
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
filterwarnings = "ignore::DeprecationWarning:websockets"
markers = [
"serial: mark a test that must run by itself",
"wait_for_idle: mark a test that waits for the model to be idle",
"bundle: mark a test that uses a bundle",
]
Empty file added tests/validate/__init__.py
Empty file.
24 changes: 6 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@
envlist = py3,py38,py39,py310,py311,docs
skipsdist=True

[pytest]
markers =
serial: mark a test that must run by itself
wait_for_idle: mark a test that waits for the model to be idle
bundle: mark a test that uses a bundle
asyncio_mode = auto
filterwarnings =
ignore::DeprecationWarning:websockets

[testenv]
usedevelop=True
commands =
pip install urllib3<2
pip install pylxd
python -m pytest --tb native -ra -v -s -k 'not integration' -m 'not serial' {posargs}
pytest --tb native -s -k 'not integration' -m 'not serial' {posargs}
passenv =
HOME
TEST_AGENTS
Expand All @@ -33,7 +24,6 @@ deps =
typing-inspect
paramiko
ipdb
mock
pytest
pytest-asyncio
Twine
Expand All @@ -57,9 +47,8 @@ envdir = {toxworkdir}/py3
commands =
pip install urllib3<2
pip install pylxd
python -m pytest \
pytest \
--tb native \
-ra -v \
-k 'integration' \
--ignore {toxinidir}/tests/integration/test_crossmodel.py \
--ignore {toxinidir}/tests/integration/test_model.py \
Expand All @@ -71,9 +60,8 @@ envdir = {toxworkdir}/py3
commands =
pip install urllib3<2
pip install pylxd
python -m pytest \
pytest \
--tb native \
-ra -v \
-m 'not serial' \
{posargs} \
{toxinidir}/tests/integration/test_crossmodel.py \
Expand All @@ -84,7 +72,7 @@ envdir = {toxworkdir}/py3
commands =
pip install urllib3<2
pip install pylxd
python -m pytest --tb native -ra -v {toxinidir}/tests/unit {posargs}
pytest {toxinidir}/tests/unit {posargs}

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

[testenv:validate]
envdir = {toxworkdir}/validate
commands = python -m pytest --tb native -ra -vv tests/validate
commands = pytest -vvv tests/validate

[testenv:example]
envdir = {toxworkdir}/py3
Expand Down
Loading