Skip to content

Commit 4aaf7be

Browse files
chore: adopt pytest>=9.0.0 config (#4861)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 332dcdc commit 4aaf7be

File tree

3 files changed

+1815
-1768
lines changed

3 files changed

+1815
-1768
lines changed

.config/requirements-lock.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file was autogenerated by uv via the following command:
22
# uv export --no-dev --no-emit-package ansible-core --no-emit-package resolvelib --no-emit-package ruamel-yaml-clib --no-emit-package tomli --no-emit-package typing-extensions --no-emit-project --no-hashes -o .config/requirements-lock.txt
3-
ansible-compat==25.11.0
3+
ansible-compat==25.12.0
44
# via ansible-lint
55
attrs==25.4.0
66
# via

pyproject.toml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ dev = [
8282
"psutil>=7.0.0",
8383
"pylint>=3.3.8",
8484
"pyrsistent>=0.20.0",
85-
"pytest>=7.2.2",
85+
"pytest>=9",
8686
"pytest-instafail>=0.5.0",
8787
"pytest-mock>=3.15.0",
8888
"pytest-plus>=0.8.1",
@@ -102,7 +102,7 @@ lint = [
102102
"pip>=25.2",
103103
"pre-commit>=4.1",
104104
"pre-commit-uv>=4.1.4",
105-
"pytest>=7.2.2",
105+
"pytest>=9",
106106
"setuptools>=51.1.1",
107107
]
108108
pkg = [
@@ -460,19 +460,15 @@ reportPossiblyUnboundVariable = false
460460
reportPrivateImportUsage = false
461461

462462
# spell-checker:ignore filterwarnings norecursedirs optionflags
463-
[tool.pytest.ini_options]
463+
[tool.pytest]
464464
# do not add options here as this will likely break either console runs or IDE
465465
# integration like vscode or pycharm
466-
addopts = "-p no:pytest_cov --durations=10 --failed-first"
466+
addopts = ["--durations=10", "--failed-first", "-p no:pytest_cov"]
467467
doctest_optionflags = ["ALLOW_UNICODE", "ELLIPSIS"]
468468
filterwarnings = [
469-
"error",
470-
# https://sourceforge.net/p/ruamel-yaml/tickets/452/
471-
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning",
472-
# https://github.com/spdx/tools-python/issues/507
473-
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
474469
# We raise one non critical warning from our own conftest.py:
475470
"always::pytest.PytestWarning",
471+
"error",
476472
# py312 ansible-core
477473
# https://github.com/ansible/ansible/issues/81906
478474
"ignore:'importlib.abc.TraversableResources' is deprecated and slated for removal in Python 3.14:DeprecationWarning",
@@ -491,11 +487,11 @@ norecursedirs = [
491487
".cache",
492488
".config",
493489
".eggs",
490+
".eggs",
494491
".git",
495492
".github",
496493
".mypy_cache",
497494
".projects",
498-
".eggs",
499495
".tox",
500496
"__pycache__",
501497
"ansible_collections",
@@ -510,17 +506,17 @@ norecursedirs = [
510506
"test/schemas",
511507
]
512508
python_files = [
513-
"test_*.py",
514509
# Ref: https://docs.pytest.org/en/latest/reference.html#confval-python_files
515510
# Needed to discover legacy nose test modules:
516511
"Test*.py",
517512
# Needed to discover embedded Rule tests
518513
"rules/*.py",
514+
"test_*.py",
519515
]
520516
# Using --pyargs instead of testpath as we embed some tests
521517
# See: https://github.com/pytest-dev/pytest/issues/6451#issuecomment-687043537
522518
# testpaths =
523-
xfail_strict = true
519+
strict_xfail = true
524520

525521
[tool.ruff]
526522
cache-dir = "./.cache/.ruff"

0 commit comments

Comments
 (0)