It seems like the OverrideIniAction compatibility code added in pytest 9 does not play nicely with addopts, and strictness options configured that way now get silently ignored since efa9eff.
pytest.ini:
[pytest]
addopts = --strict-markers --strict-config
does_not_exist = True
test_x.py:
import pytest
@pytest.mark.doesnotexist
def test_x():
pass
with 8.4.2:
==================================== ERRORS ====================================
__________________________ ERROR collecting test_x.py __________________________
'doesnotexist' not found in `markers` configuration option
=========================== short test summary info ============================
ERROR test_x.py - Failed: 'doesnotexist' not found in `markers` configuration option
=============================== 1 error in 0.07s ===============================
ERROR: Unknown config option: does_not_exist
with 9.0.x:
=============================== warnings summary ===============================
[...]/src/_pytest/config/__init__.py:1420
[...]/src/_pytest/config/__init__.py:1420: PytestConfigWarning: Unknown config option: does_not_exist
self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
test_x.py:3
[...]/markertest/test_x.py:3: PytestUnknownMarkWarning: Unknown pytest.mark.doesnotexist - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
@pytest.mark.doesnotexist
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== 1 passed, 2 warnings in 0.07s =========================
It seems like the
OverrideIniActioncompatibility code added in pytest 9 does not play nicely withaddopts, and strictness options configured that way now get silently ignored since efa9eff.pytest.ini:
test_x.py:
with 8.4.2:
with 9.0.x: