Deprecated --strict for pytest
pytest.ini has the --strict
option, which is deprecated since 6.2.0 as per Deprecations section for release 6.2.0 in the Release Notes and is to be removed in pytest 8.x.
Its successor --strict-markers
has been around since version 4.5.0 (Release Notes), and that version requirement is met in e.g. Ubuntu 20.04 (focal) and Debian 11 (Bullseye) as per Repology.
Please consider replacing --strict
with --strict-markers
.
Example of the warning output when running the tests:
============================= test session starts ==============================
platform linux -- Python 3.11.7, pytest-7.4.4, pluggy-1.4.0
rootdir: /build/python-et-xmlfile/src/et_xmlfile-1.1
configfile: pytest.ini
collected 118 items
et_xmlfile/tests/test_incremental_xmlfile.py ..xxx.....x....x....x....xx [ 22%]
x.....x.....x....x....xxx.....x....x....x....sxx.....x....s....x....xxx. [ 83%]
....x......x....x.. [100%]
=============================== warnings summary ===============================
../../../../usr/lib/python3.11/site-packages/_pytest/config/__init__.py:1316
/usr/lib/python3.11/site-packages/_pytest/config/__init__.py:1316: PytestRemovedIn8Warning: The --strict option is deprecated, use --strict-markers instead.
self.issue_config_time_warning(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html