diff --git a/changelog/12083.breaking.rst b/changelog/12083.breaking.rst deleted file mode 100644 index 53a8393dfb4..00000000000 --- a/changelog/12083.breaking.rst +++ /dev/null @@ -1,9 +0,0 @@ -Fixed a bug where an invocation such as `pytest a/ a/b` would cause only tests from `a/b` to run, and not other tests under `a/`. - -The fix entails a few breaking changes to how such overlapping arguments and duplicates are handled: - -1. `pytest a/b a/` or `pytest a/ a/b` are equivalent to `pytest a`; if an argument overlaps another arguments, only the prefix remains. - -2. `pytest x.py x.py` is equivalent to `pytest x.py`; previously such an invocation was taken as an explicit request to run the tests from the file twice. - -If you rely on these behaviors, consider using :ref:`--keep-duplicates `, which retains its existing behavior (including the bug). diff --git a/changelog/12244.contrib.rst b/changelog/12244.contrib.rst deleted file mode 100644 index e39dad1cfbf..00000000000 --- a/changelog/12244.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed self-test failures when `TERM=dumb`. diff --git a/changelog/12474.contrib.rst b/changelog/12474.contrib.rst deleted file mode 100644 index bb668fd66c5..00000000000 --- a/changelog/12474.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Added scheduled GitHub Action Workflow to run Sphinx linkchecks in repo documentation. diff --git a/changelog/13072.feature.rst b/changelog/13072.feature.rst deleted file mode 100644 index 6f9fd11e540..00000000000 --- a/changelog/13072.feature.rst +++ /dev/null @@ -1,8 +0,0 @@ -Added support for displaying test session progress in the terminal tab using the `OSC 9;4; `_ ANSI sequence. -When pytest runs in a supported terminal emulator like ConEmu, Gnome Terminal, Ptyxis, Windows Terminal, Kitty or Ghostty, -you'll see the progress in the terminal tab or window, -allowing you to monitor pytest's progress at a glance. - -This feature is automatically enabled when running in a TTY. It is implemented as an internal plugin. If needed, it can be disabled as follows: -- On a user level, using ``-p no:terminalprogress`` on the command line or via an environment variable ``PYTEST_ADDOPTS='-p no:terminalprogress'``. -- On a project configuration level, using ``addopts = "-p no:terminalprogress"``. diff --git a/changelog/13330.improvement.rst b/changelog/13330.improvement.rst deleted file mode 100644 index 58350ea30ef..00000000000 --- a/changelog/13330.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -Having pytest configuration spread over more than one file (for example having both a ``pytest.ini`` file and ``pyproject.toml`` with a ``[tool.pytest.ini_options]`` table) will now print a warning to make it clearer to the user that only one of them is actually used. - --- by :user:`sgaist` diff --git a/changelog/13445.bugfix.rst b/changelog/13445.bugfix.rst deleted file mode 100644 index 1c601a1045e..00000000000 --- a/changelog/13445.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Made the type annotations of :func:`pytest.skip` and friends more spec-complaint to have them work across more type checkers. diff --git a/changelog/13522.bugfix.rst b/changelog/13522.bugfix.rst deleted file mode 100644 index 683304251aa..00000000000 --- a/changelog/13522.bugfix.rst +++ /dev/null @@ -1,5 +0,0 @@ -Fixed :fixture:`pytester` in subprocess mode ignored all :attr`pytester.plugins ` except the first. - -Fixed :fixture:`pytester` in subprocess mode silently ignored non-str :attr:`pytester.plugins `. -Now it errors instead. -If you are affected by this, specify the plugin by name, or switch the affected tests to use :func:`pytester.runpytest_inprocess ` explicitly instead. diff --git a/changelog/13537.bugfix.rst b/changelog/13537.bugfix.rst deleted file mode 100644 index 47743b24f05..00000000000 --- a/changelog/13537.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix bug in which ExceptionGroup with only Skipped exceptions in teardown was not handled correctly and showed as error. diff --git a/changelog/13574.improvement.rst b/changelog/13574.improvement.rst deleted file mode 100644 index 7820cd03fac..00000000000 --- a/changelog/13574.improvement.rst +++ /dev/null @@ -1,7 +0,0 @@ -The single argument ``--version`` no longer loads the entire plugin infrastructure, making it faster and more reliable when displaying only the pytest version. - -Passing ``--version`` twice (e.g., ``pytest --version --version``) retains the original behavior, showing both the pytest version and plugin information. - -.. note:: - - Since ``--version`` is now processed early, it only takes effect when passed directly via the command line. It will not work if set through other mechanisms, such as :envvar:`PYTEST_ADDOPTS` or :confval:`addopts`. diff --git a/changelog/13598.bugfix.rst b/changelog/13598.bugfix.rst deleted file mode 100644 index dd195112eb8..00000000000 --- a/changelog/13598.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed possible collection confusion on Windows when short paths and symlinks are involved. diff --git a/changelog/13621.contrib.rst b/changelog/13621.contrib.rst deleted file mode 100644 index c5e622b7619..00000000000 --- a/changelog/13621.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -pytest's own testsuite now handles the ``lsof`` command hanging (e.g. due to unreachable network filesystems), with the affected selftests being skipped after 10 seconds. diff --git a/changelog/13625.doc.rst b/changelog/13625.doc.rst deleted file mode 100644 index 850c81583b6..00000000000 --- a/changelog/13625.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Added missing docstrings to ``pytest_addoption()``, ``pytest_configure()``, and ``cacheshow()`` functions in ``cacheprovider.py``. diff --git a/changelog/13638.contrib.rst b/changelog/13638.contrib.rst deleted file mode 100644 index 8eb06298c77..00000000000 --- a/changelog/13638.contrib.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed deprecated :command:`gh pr new` command in :file:`scripts/prepare-release-pr.py`. -The script now uses :command:`gh pr create` which is compatible with GitHub CLI v2.0+. diff --git a/changelog/1367.feature.rst b/changelog/1367.feature.rst deleted file mode 100644 index b88480338b5..00000000000 --- a/changelog/1367.feature.rst +++ /dev/null @@ -1,28 +0,0 @@ -**Support for subtests** has been added. - -:ref:`subtests ` are an alternative to parametrization, useful in situations where the parametrization values are not all known at collection time. - -**Example** - -.. code-block:: python - - def contains_docstring(p: Path) -> bool: - """Return True if the given Python file contains a top-level docstring.""" - ... - - - def test_py_files_contain_docstring(subtests: pytest.Subtests) -> None: - for path in Path.cwd().glob("*.py"): - with subtests.test(path=str(path)): - assert contains_docstring(path) - - -Each assert failure or error is caught by the context manager and reported individually, giving a clear picture of all files that are missing a docstring. - -In addition, :meth:`unittest.TestCase.subTest` is now also supported. - -This feature was originally implemented as a separate plugin in `pytest-subtests `__, but since then has been merged into the core. - -.. note:: - - This feature is experimental and will likely evolve in future releases. By that we mean that we might change how subtests are reported on failure, but the functionality and how to use it are stable. diff --git a/changelog/13678.feature.rst b/changelog/13678.feature.rst deleted file mode 100644 index 63c7dfa399f..00000000000 --- a/changelog/13678.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -Added a new `faulthandler_exit_on_timeout` ini option set to "false" by default to let `faulthandler` interrupt the `pytest` process after a timeout in case of deadlock -- by :user:`ogrisel`. - -Previously, a `faulthandler` timeout would only dump the traceback of all threads to stderr, but would not interrupt the `pytest` process. diff --git a/changelog/13695.contrib.rst b/changelog/13695.contrib.rst deleted file mode 100644 index 675e1fc96a0..00000000000 --- a/changelog/13695.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Flush `stdout` and `stderr` in `Pytester.run` to avoid truncated outputs in `test_faulthandler.py::test_timeout` on CI -- by :user:`ogrisel`. diff --git a/changelog/13700.improvement.rst b/changelog/13700.improvement.rst deleted file mode 100644 index 40753ae5d5f..00000000000 --- a/changelog/13700.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -`--junitxml` no longer prints the `generated xml file` summary at the end of the pytest session when `--quiet` is given. diff --git a/changelog/13716.bugfix.rst b/changelog/13716.bugfix.rst deleted file mode 100644 index 5eeef4b7624..00000000000 --- a/changelog/13716.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a bug where a nonsensical invocation like ``pytest x.py[a]`` (a file cannot be parametrized) was silently treated as ``pytest x.py``. This is now a usage error. diff --git a/changelog/13719.breaking.rst b/changelog/13719.breaking.rst deleted file mode 100644 index 328c7dfcf2b..00000000000 --- a/changelog/13719.breaking.rst +++ /dev/null @@ -1 +0,0 @@ -Support for Python 3.9 is dropped following its end of life. diff --git a/changelog/13722.bugfix.rst b/changelog/13722.bugfix.rst deleted file mode 100644 index ec36f466815..00000000000 --- a/changelog/13722.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a misleading assertion failure message when using :func:`pytest.approx` on mappings with differing lengths. diff --git a/changelog/13732.improvement.rst b/changelog/13732.improvement.rst deleted file mode 100644 index 07b3d620cf6..00000000000 --- a/changelog/13732.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Previously, when filtering warnings, pytest would fail if the filter referenced a class that could not be imported. Now, this only outputs a message indicating the problem. diff --git a/changelog/13737.feature.rst b/changelog/13737.feature.rst deleted file mode 100644 index e7fe7fd3ab7..00000000000 --- a/changelog/13737.feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -Added the :confval:`strict_parametrization_ids` configuration option. - -When set, pytest emits an error if it detects non-unique parameter set IDs, -rather than automatically making the IDs unique by adding `0`, `1`, ... to them. diff --git a/changelog/13743.feature.rst b/changelog/13743.feature.rst deleted file mode 100644 index b36782487f5..00000000000 --- a/changelog/13743.feature.rst +++ /dev/null @@ -1,37 +0,0 @@ -Added support for native TOML configuration files. - -While pytest, since version 6, supports configuration in ``pyproject.toml`` files under ``[tool.pytest.ini_options]``, -it does so in an "INI compatibility mode", where all configuration values are treated as strings or list of strings. -Now, pytest supports the native TOML data model. - -In ``pyproject.toml``, the native TOML configuration is under the ``[tool.pytest]`` table. - -.. code-block:: toml - - # pyproject.toml - [tool.pytest] - minversion = "9.0" - addopts = ["-ra", "-q"] - testpaths = [ - "tests", - "integration", - ] - -The ``[tool.pytest.ini_options]`` table remains supported, but both tables cannot be used at the same time. - -If you prefer to use a separate configuration file, or don't use ``pyproject.toml``, you can use ``pytest.toml`` or ``.pytest.toml``: - -.. code-block:: toml - - # pytest.toml or .pytest.toml - [pytest] - minversion = "9.0" - addopts = ["-ra", "-q"] - testpaths = [ - "tests", - "integration", - ] - -The documentation now shows configuration snippets in both TOML and INI formats, in a tabbed interface. - -See :ref:`config file formats` for full details. diff --git a/changelog/13766.breaking.rst b/changelog/13766.breaking.rst deleted file mode 100644 index d7bd5a9a0ee..00000000000 --- a/changelog/13766.breaking.rst +++ /dev/null @@ -1,2 +0,0 @@ -Previously, pytest would assume it was running in a CI/CD environment if either of the environment variables `$CI` or `$BUILD_NUMBER` was defined; -now, CI mode is only activated if at least one of those variables is defined and set to a *non-empty* value. diff --git a/changelog/13771.contrib.rst b/changelog/13771.contrib.rst deleted file mode 100644 index fa5cc8afee5..00000000000 --- a/changelog/13771.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Skip `test_do_not_collect_symlink_siblings` on Windows environments without symlink support to avoid false negatives. diff --git a/changelog/13773.bugfix.rst b/changelog/13773.bugfix.rst deleted file mode 100644 index e3a9ff4b7a1..00000000000 --- a/changelog/13773.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed the static fixture closure calculation to properly consider transitive dependencies requested by overridden fixtures. diff --git a/changelog/13779.breaking.rst b/changelog/13779.breaking.rst deleted file mode 100644 index f7e44c27dfa..00000000000 --- a/changelog/13779.breaking.rst +++ /dev/null @@ -1,22 +0,0 @@ -**PytestRemovedIn9Warning deprecation warnings are now errors by default.** - -Following our plan to remove deprecated features with as little disruption as -possible, all warnings of type ``PytestRemovedIn9Warning`` now generate errors -instead of warning messages by default. - -**The affected features will be effectively removed in pytest 9.1**, so please consult the -:ref:`deprecations` section in the docs for directions on how to update existing code. - -In the pytest ``9.0.X`` series, it is possible to change the errors back into warnings as a -stopgap measure by adding this to your ``pytest.ini`` file: - -.. code-block:: ini - - [pytest] - filterwarnings = - ignore::pytest.PytestRemovedIn9Warning - -But this will stop working when pytest ``9.1`` is released. - -**If you have concerns** about the removal of a specific feature, please add a -comment to :issue:`13779`. diff --git a/changelog/13791.packaging.rst b/changelog/13791.packaging.rst deleted file mode 100644 index d16065e85a5..00000000000 --- a/changelog/13791.packaging.rst +++ /dev/null @@ -1,2 +0,0 @@ -Minimum requirements on ``iniconfig`` and ``packaging`` were bumped -to ``1.0.1`` and ``22.0.0``, respectively. diff --git a/changelog/13807.deprecation.rst b/changelog/13807.deprecation.rst deleted file mode 100644 index 59bd62214e1..00000000000 --- a/changelog/13807.deprecation.rst +++ /dev/null @@ -1,3 +0,0 @@ -:meth:`monkeypatch.syspath_prepend() ` now issues a deprecation warning when the prepended path contains legacy namespace packages (those using ``pkg_resources.declare_namespace()``). -Users should migrate to native namespace packages (:pep:`420`). -See :ref:`monkeypatch-fixup-namespace-packages` for details. diff --git a/changelog/13816.bugfix.rst b/changelog/13816.bugfix.rst deleted file mode 100644 index 432fc519ed5..00000000000 --- a/changelog/13816.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed :func:`pytest.approx` which now returns a clearer error message when comparing mappings with different keys. diff --git a/changelog/13823.feature.rst b/changelog/13823.feature.rst deleted file mode 100644 index b6152ff50ea..00000000000 --- a/changelog/13823.feature.rst +++ /dev/null @@ -1,18 +0,0 @@ -Added a :confval:`strict` configuration option to enable all strictness-related options. - -When set to ``true``, the :confval:`strict` option currently enables - -* :confval:`strict_config` -* :confval:`strict_markers` -* :confval:`strict_parametrization_ids` -* :confval:`strict_xfail` - -The individual strictness options can be explicitly set to override the global :confval:`strict` setting. - -The previously-deprecated ``--strict`` command-line flag now enables strict mode. - -If pytest adds new strictness options in the future, they will also be enabled in strict mode. -Therefore, you should only enable strict mode if you use a pinned/locked version of pytest, -or if you want to proactively adopt new strictness options as they are added. - -See :ref:`strict mode` for more details. diff --git a/changelog/13823.improvement.rst b/changelog/13823.improvement.rst deleted file mode 100644 index 4346d702c8c..00000000000 --- a/changelog/13823.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -Added :confval:`strict_xfail` as an alias to the ``xfail_strict`` option, -:confval:`strict_config` as an alias to the ``--strict-config`` flag, -and :confval:`strict_markers` as an alias to the ``--strict-markers`` flag. -This makes all strictness options consistently have configuration options with the prefix ``strict_``. diff --git a/changelog/13829.feature.rst b/changelog/13829.feature.rst deleted file mode 100644 index 5f80ca5ac2f..00000000000 --- a/changelog/13829.feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -Added support for ini option aliases via the ``aliases`` parameter in :meth:`Parser.addini() `. - -Plugins can now register alternative names for ini options, -allowing for more flexibility in configuration naming and supporting backward compatibility when renaming options. -The canonical name always takes precedence if both the canonical name and an alias are specified in the configuration file. diff --git a/changelog/13830.misc.rst b/changelog/13830.misc.rst deleted file mode 100644 index 0d81ce2f14f..00000000000 --- a/changelog/13830.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Configuration overrides (``-o``/``--override-ini``) are now processed during startup rather than during :func:`config.getini() `. diff --git a/changelog/13841.contrib.rst b/changelog/13841.contrib.rst deleted file mode 100644 index e5672634700..00000000000 --- a/changelog/13841.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -``tox>=4`` is now required when contributing to pytest. diff --git a/changelog/13849.bugfix.rst b/changelog/13849.bugfix.rst deleted file mode 100644 index cdcc7b83591..00000000000 --- a/changelog/13849.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Hidden ``.pytest.ini`` files are now picked up as the config file even if empty. -This was an inconsistency with non-hidden ``pytest.ini``. diff --git a/changelog/13859.improvement.rst b/changelog/13859.improvement.rst deleted file mode 100644 index b785381fd68..00000000000 --- a/changelog/13859.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Clarify the error message for `pytest.raises()` when a regex `match` fails. diff --git a/changelog/13861.improvement.rst b/changelog/13861.improvement.rst deleted file mode 100644 index 2f062404e1c..00000000000 --- a/changelog/13861.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Better sentence structure in a test's expected error message. Previously, the error message would be "expected exception must be , but got ". Now, it is "Expected , but got ". diff --git a/changelog/13865.bugfix.rst b/changelog/13865.bugfix.rst deleted file mode 100644 index f7cd94c2a30..00000000000 --- a/changelog/13865.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed `--show-capture` with `--tb=line`. diff --git a/changelog/478.feature.rst b/changelog/478.feature.rst deleted file mode 100644 index cd13ddd9733..00000000000 --- a/changelog/478.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -Support PEP420 (implicit namespace packages) as `--pyargs` target when :confval:`consider_namespace_packages` is `true` in the config. - -Previously, this option only impacted package names, now it also impacts tests discovery. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 1cc8fbaf7c0..f5e00d34cdb 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-9.0.0 release-8.4.2 release-8.4.1 release-8.4.0 diff --git a/doc/en/announce/release-9.0.0.rst b/doc/en/announce/release-9.0.0.rst new file mode 100644 index 00000000000..86dd828f045 --- /dev/null +++ b/doc/en/announce/release-9.0.0.rst @@ -0,0 +1,69 @@ +pytest-9.0.0 +======================================= + +The pytest team is proud to announce the 9.0.0 release! + +This release contains new features, improvements, bug fixes, and breaking changes, so users +are encouraged to take a look at the CHANGELOG carefully: + + https://docs.pytest.org/en/stable/changelog.html + +For complete documentation, please visit: + + https://docs.pytest.org/en/stable/ + +As usual, you can upgrade from PyPI via: + + pip install -U pytest + +Thanks to all of the contributors to this release: + +* AD +* Aditi De +* Ali Nazzal +* Bruno Oliveira +* Charles-Meldhine Madi Mnemoi +* Clément Robert +* CoretexShadow +* Cornelius Roemer +* Eero Vaher +* Florian Bruhin +* Harsha Sai +* Hossein +* Israël Hallé +* Iwithyou2025 +* James Addison +* John Litborn +* Jordan Macdonald +* Kieran Ryan +* Liam DeVoe +* Marc Mueller +* Marcos Boger +* Michał Górny +* Mulat Mekonen +* NayeemJohn +* Olivier Grisel +* Omri Golan +* Pierre Sassoulas +* Praise Tompane +* Ran Benita +* Reilly Brogan +* Samuel Gaist +* SarahPythonista +* Sorin Sbarnea +* Stu-ops +* Tanuj Rai +* bengartner +* dariomesic +* jakkdl +* karlicoss +* popododo0720 +* sazsu +* slackline +* vyuroshchin +* zapl +* 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index ca350c5f3dd..a7b0ff2e5c8 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -22,7 +22,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a cachedir: .pytest_cache rootdir: /home/sweet/project collected 0 items - cache -- .../_pytest/cacheprovider.py:555 + cache -- .../_pytest/cacheprovider.py:566 Return a cache object that can persist state between testing sessions. cache.get(key, default) @@ -128,7 +128,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfdbinary.readouterr() assert captured.out == b"hello\n" - doctest_namespace [session scope] -- .../_pytest/doctest.py:740 + doctest_namespace [session scope] -- .../_pytest/doctest.py:722 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. @@ -142,7 +142,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a For more details: :ref:`doctest_namespace`. - pytestconfig [session scope] -- .../_pytest/fixtures.py:1425 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1431 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -225,7 +225,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a * caplog.record_tuples -> list of (logger_name, level, message) tuples * caplog.clear() -> clear captured records and formatted log output string - monkeypatch -- .../_pytest/monkeypatch.py:31 + monkeypatch -- .../_pytest/monkeypatch.py:33 A convenient fixture for monkey-patching. The fixture provides these methods to modify objects, dictionaries, or @@ -254,6 +254,9 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a See :ref:`warnings` for information on warning categories. + subtests -- .../_pytest/subtests.py:129 + Provides subtests functionality. + tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:240 Return a :class:`pytest.TempPathFactory` instance for the test session. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 89f1c4e61b3..5220afc46e3 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -31,6 +31,307 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 9.0.0 (2025-11-05) +========================= + +New features +------------ + + +- `#1367 `_: **Support for subtests** has been added. + + :ref:`subtests ` are an alternative to parametrization, useful in situations where the parametrization values are not all known at collection time. + + Example: + + .. code-block:: python + + def contains_docstring(p: Path) -> bool: + """Return True if the given Python file contains a top-level docstring.""" + ... + + + def test_py_files_contain_docstring(subtests: pytest.Subtests) -> None: + for path in Path.cwd().glob("*.py"): + with subtests.test(path=str(path)): + assert contains_docstring(path) + + + Each assert failure or error is caught by the context manager and reported individually, giving a clear picture of all files that are missing a docstring. + + In addition, :meth:`unittest.TestCase.subTest` is now also supported. + + This feature was originally implemented as a separate plugin in `pytest-subtests `__, but since then has been merged into the core. + + .. note:: + + This feature is experimental and will likely evolve in future releases. By that we mean that we might change how subtests are reported on failure, but the functionality and how to use it are stable. + + +- `#13743 `_: Added support for **native TOML configuration files**. + + While pytest, since version 6, supports configuration in ``pyproject.toml`` files under ``[tool.pytest.ini_options]``, + it does so in an "INI compatibility mode", where all configuration values are treated as strings or list of strings. + Now, pytest supports the native TOML data model. + + In ``pyproject.toml``, the native TOML configuration is under the ``[tool.pytest]`` table. + + .. code-block:: toml + + # pyproject.toml + [tool.pytest] + minversion = "9.0" + addopts = ["-ra", "-q"] + testpaths = [ + "tests", + "integration", + ] + + The ``[tool.pytest.ini_options]`` table remains supported, but both tables cannot be used at the same time. + + If you prefer to use a separate configuration file, or don't use ``pyproject.toml``, you can use ``pytest.toml`` or ``.pytest.toml``: + + .. code-block:: toml + + # pytest.toml or .pytest.toml + [pytest] + minversion = "9.0" + addopts = ["-ra", "-q"] + testpaths = [ + "tests", + "integration", + ] + + The documentation now (sometimes) shows configuration snippets in both TOML and INI formats, in a tabbed interface. + + See :ref:`config file formats` for full details. + + +- `#13823 `_: Added a **"strict mode"** enabled by the :confval:`strict` configuration option. + + When set to ``true``, the :confval:`strict` option currently enables + + * :confval:`strict_config` + * :confval:`strict_markers` + * :confval:`strict_parametrization_ids` + * :confval:`strict_xfail` + + The individual strictness options can be explicitly set to override the global :confval:`strict` setting. + + The previously-deprecated ``--strict`` command-line flag now enables strict mode. + + If pytest adds new strictness options in the future, they will also be enabled in strict mode. + Therefore, you should only enable strict mode if you use a pinned/locked version of pytest, + or if you want to proactively adopt new strictness options as they are added. + + See :ref:`strict mode` for more details. + + +- `#13737 `_: Added the :confval:`strict_parametrization_ids` configuration option. + + When set, pytest emits an error if it detects non-unique parameter set IDs, + rather than automatically making the IDs unique by adding `0`, `1`, ... to them. + This can be particularly useful for catching unintended duplicates. + + +- `#13072 `_: Added support for displaying test session **progress in the terminal tab** using the `OSC 9;4; `_ ANSI sequence. + When pytest runs in a supported terminal emulator like ConEmu, Gnome Terminal, Ptyxis, Windows Terminal, Kitty or Ghostty, + you'll see the progress in the terminal tab or window, + allowing you to monitor pytest's progress at a glance. + + This feature is automatically enabled when running in a TTY. It is implemented as an internal plugin. If needed, it can be disabled as follows: + - On a user level, using ``-p no:terminalprogress`` on the command line or via an environment variable ``PYTEST_ADDOPTS='-p no:terminalprogress'``. + - On a project configuration level, using ``addopts = "-p no:terminalprogress"``. + + +- `#478 `_: Support PEP420 (implicit namespace packages) as `--pyargs` target when :confval:`consider_namespace_packages` is `true` in the config. + + Previously, this option only impacted package imports, now it also impacts tests discovery. + + +- `#13678 `_: Added a new :confval:`faulthandler_exit_on_timeout` configuration option set to "false" by default to let `faulthandler` interrupt the `pytest` process after a timeout in case of deadlock. + + Previously, a `faulthandler` timeout would only dump the traceback of all threads to stderr, but would not interrupt the `pytest` process. + + -- by :user:`ogrisel`. + + +- `#13829 `_: Added support for configuration option aliases via the ``aliases`` parameter in :meth:`Parser.addini() `. + + Plugins can now register alternative names for configuration options, + allowing for more flexibility in configuration naming and supporting backward compatibility when renaming options. + The canonical name always takes precedence if both the canonical name and an alias are specified in the configuration file. + + + +Improvements in existing functionality +-------------------------------------- + +- `#13330 `_: Having pytest configuration spread over more than one file (for example having both a ``pytest.ini`` file and ``pyproject.toml`` with a ``[tool.pytest.ini_options]`` table) will now print a warning to make it clearer to the user that only one of them is actually used. + + -- by :user:`sgaist` + + +- `#13574 `_: The single argument ``--version`` no longer loads the entire plugin infrastructure, making it faster and more reliable when displaying only the pytest version. + + Passing ``--version`` twice (e.g., ``pytest --version --version``) retains the original behavior, showing both the pytest version and plugin information. + + .. note:: + + Since ``--version`` is now processed early, it only takes effect when passed directly via the command line. It will not work if set through other mechanisms, such as :envvar:`PYTEST_ADDOPTS` or :confval:`addopts`. + + +- `#13823 `_: Added :confval:`strict_xfail` as an alias to the ``xfail_strict`` option, + :confval:`strict_config` as an alias to the ``--strict-config`` flag, + and :confval:`strict_markers` as an alias to the ``--strict-markers`` flag. + This makes all strictness options consistently have configuration options with the prefix ``strict_``. + +- `#13700 `_: `--junitxml` no longer prints the `generated xml file` summary at the end of the pytest session when `--quiet` is given. + + +- `#13732 `_: Previously, when filtering warnings, pytest would fail if the filter referenced a class that could not be imported. Now, this only outputs a message indicating the problem. + + +- `#13859 `_: Clarify the error message for `pytest.raises()` when a regex `match` fails. + + +- `#13861 `_: Better sentence structure in a test's expected error message. Previously, the error message would be "expected exception must be , but got ". Now, it is "Expected , but got ". + + +Removals and backward incompatible breaking changes +--------------------------------------------------- + +- `#12083 `_: Fixed a bug where an invocation such as `pytest a/ a/b` would cause only tests from `a/b` to run, and not other tests under `a/`. + + The fix entails a few breaking changes to how such overlapping arguments and duplicates are handled: + + 1. `pytest a/b a/` or `pytest a/ a/b` are equivalent to `pytest a`; if an argument overlaps another arguments, only the prefix remains. + + 2. `pytest x.py x.py` is equivalent to `pytest x.py`; previously such an invocation was taken as an explicit request to run the tests from the file twice. + + If you rely on these behaviors, consider using :ref:`--keep-duplicates `, which retains its existing behavior (including the bug). + + +- `#13719 `_: Support for Python 3.9 is dropped following its end of life. + + +- `#13766 `_: Previously, pytest would assume it was running in a CI/CD environment if either of the environment variables `$CI` or `$BUILD_NUMBER` was defined; + now, CI mode is only activated if at least one of those variables is defined and set to a *non-empty* value. + + +- `#13779 `_: **PytestRemovedIn9Warning deprecation warnings are now errors by default.** + + Following our plan to remove deprecated features with as little disruption as + possible, all warnings of type ``PytestRemovedIn9Warning`` now generate errors + instead of warning messages by default. + + **The affected features will be effectively removed in pytest 9.1**, so please consult the + :ref:`deprecations` section in the docs for directions on how to update existing code. + + In the pytest ``9.0.X`` series, it is possible to change the errors back into warnings as a + stopgap measure by adding this to your ``pytest.ini`` file: + + .. code-block:: ini + + [pytest] + filterwarnings = + ignore::pytest.PytestRemovedIn9Warning + + But this will stop working when pytest ``9.1`` is released. + + **If you have concerns** about the removal of a specific feature, please add a + comment to :issue:`13779`. + + + +Deprecations (removal in next major release) +-------------------------------------------- + +- `#13807 `_: :meth:`monkeypatch.syspath_prepend() ` now issues a deprecation warning when the prepended path contains legacy namespace packages (those using ``pkg_resources.declare_namespace()``). + Users should migrate to native namespace packages (:pep:`420`). + See :ref:`monkeypatch-fixup-namespace-packages` for details. + + +Bug fixes +--------- + +- `#13445 `_: Made the type annotations of :func:`pytest.skip` and friends more spec-complaint to have them work across more type checkers. + + +- `#13537 `_: Fixed a bug in which :class:`ExceptionGroup` with only ``Skipped`` exceptions in teardown was not handled correctly and showed as error. + + +- `#13598 `_: Fixed possible collection confusion on Windows when short paths and symlinks are involved. + + +- `#13716 `_: Fixed a bug where a nonsensical invocation like ``pytest x.py[a]`` (a file cannot be parametrized) was silently treated as ``pytest x.py``. This is now a usage error. + + +- `#13722 `_: Fixed a misleading assertion failure message when using :func:`pytest.approx` on mappings with differing lengths. + + +- `#13773 `_: Fixed the static fixture closure calculation to properly consider transitive dependencies requested by overridden fixtures. + + +- `#13816 `_: Fixed :func:`pytest.approx` which now returns a clearer error message when comparing mappings with different keys. + + +- `#13849 `_: Hidden ``.pytest.ini`` files are now picked up as the config file even if empty. + This was an inconsistency with non-hidden ``pytest.ini``. + + +- `#13865 `_: Fixed `--show-capture` with `--tb=line`. + + +- `#13522 `_: Fixed :fixture:`pytester` in subprocess mode ignored all :attr`pytester.plugins ` except the first. + + Fixed :fixture:`pytester` in subprocess mode silently ignored non-str :attr:`pytester.plugins `. + Now it errors instead. + If you are affected by this, specify the plugin by name, or switch the affected tests to use :func:`pytester.runpytest_inprocess ` explicitly instead. + + + +Packaging updates and notes for downstreams +------------------------------------------- + +- `#13791 `_: Minimum requirements on ``iniconfig`` and ``packaging`` were bumped to ``1.0.1`` and ``22.0.0``, respectively. + + + +Contributor-facing changes +-------------------------- + +- `#12244 `_: Fixed self-test failures when `TERM=dumb`. + + +- `#12474 `_: Added scheduled GitHub Action Workflow to run Sphinx linkchecks in repo documentation. + + +- `#13621 `_: pytest's own testsuite now handles the ``lsof`` command hanging (e.g. due to unreachable network filesystems), with the affected selftests being skipped after 10 seconds. + + +- `#13638 `_: Fixed deprecated :command:`gh pr new` command in :file:`scripts/prepare-release-pr.py`. + The script now uses :command:`gh pr create` which is compatible with GitHub CLI v2.0+. + + +- `#13695 `_: Flush `stdout` and `stderr` in `Pytester.run` to avoid truncated outputs in `test_faulthandler.py::test_timeout` on CI -- by :user:`ogrisel`. + + +- `#13771 `_: Skip `test_do_not_collect_symlink_siblings` on Windows environments without symlink support to avoid false negatives. + + +- `#13841 `_: ``tox>=4`` is now required when contributing to pytest. + +- `#13625 `_: Added missing docstrings to ``pytest_addoption()``, ``pytest_configure()``, and ``cacheshow()`` functions in ``cacheprovider.py``. + + + +Miscellaneous internal changes +------------------------------ + +- `#13830 `_: Configuration overrides (``-o``/``--override-ini``) are now processed during startup rather than during :func:`config.getini() `. + + pytest 8.4.2 (2025-09-03) ========================= diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index c8f7c8c2fa2..afb1ece0fe8 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -262,7 +262,7 @@ You can ask which markers exist for your test suite - the list includes our just @pytest.mark.skipif(condition, ..., *, reason=...): skip the given test function if any of the conditions evaluate to True. Example: skipif(sys.platform == 'win32') skips the test if we are on the win32 platform. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-skipif - @pytest.mark.xfail(condition, ..., *, reason=..., run=True, raises=None, strict=xfail_strict): mark the test function as an expected failure if any of the conditions evaluate to True. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-xfail + @pytest.mark.xfail(condition, ..., *, reason=..., run=True, raises=None, strict=strict_xfail): mark the test function as an expected failure if any of the conditions evaluate to True. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-xfail @pytest.mark.parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see https://docs.pytest.org/en/stable/how-to/parametrize.html for more info and examples. @@ -453,7 +453,7 @@ The ``--markers`` option always gives you a list of available markers: @pytest.mark.skipif(condition, ..., *, reason=...): skip the given test function if any of the conditions evaluate to True. Example: skipif(sys.platform == 'win32') skips the test if we are on the win32 platform. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-skipif - @pytest.mark.xfail(condition, ..., *, reason=..., run=True, raises=None, strict=xfail_strict): mark the test function as an expected failure if any of the conditions evaluate to True. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-xfail + @pytest.mark.xfail(condition, ..., *, reason=..., run=True, raises=None, strict=strict_xfail): mark the test function as an expected failure if any of the conditions evaluate to True. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-xfail @pytest.mark.parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see https://docs.pytest.org/en/stable/how-to/parametrize.html for more info and examples. diff --git a/doc/en/example/nonpython.rst b/doc/en/example/nonpython.rst index aa463e2416b..a8d172937c5 100644 --- a/doc/en/example/nonpython.rst +++ b/doc/en/example/nonpython.rst @@ -40,7 +40,7 @@ now execute the test specification: spec failed: 'some': 'other' no further details known at this point. ========================= short test summary info ========================== - FAILED test_simple.yaml::hello + FAILED test_simple.yaml::hello - usecase execution failed ======================= 1 failed, 1 passed in 0.12s ======================== .. regendoc:wipe @@ -78,7 +78,7 @@ consulted when reporting in ``verbose`` mode: spec failed: 'some': 'other' no further details known at this point. ========================= short test summary info ========================== - FAILED test_simple.yaml::hello + FAILED test_simple.yaml::hello - usecase execution failed ======================= 1 failed, 1 passed in 0.12s ======================== .. regendoc:wipe diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 6374e0edb3d..b27dae18c32 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -162,7 +162,7 @@ objects, they are still using the default pytest representation: rootdir: /home/sweet/project collected 8 items - + @@ -239,7 +239,7 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia rootdir: /home/sweet/project collected 4 items - + @@ -318,7 +318,7 @@ Let's first see how it looks like at collection time: rootdir: /home/sweet/project collected 2 items - + @@ -503,12 +503,10 @@ Running it results in some skips if we don't have all the python interpreters in .. code-block:: pytest . $ pytest -rs -q multipython.py - sssssssssssssssssssssssssss [100%] + ssssssssssss......sss...... [100%] ========================= short test summary info ========================== - SKIPPED [9] multipython.py:67: 'python3.9' not found - SKIPPED [9] multipython.py:67: 'python3.10' not found - SKIPPED [9] multipython.py:67: 'python3.11' not found - 27 skipped in 0.12s + SKIPPED [15] multipython.py:67: 'python3.11' not found + 12 passed, 15 skipped in 0.12s Parametrization of optional implementations/imports --------------------------------------------------- diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 46d15557fa8..09489418773 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -139,10 +139,10 @@ The test collection would look like this: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-8.x.y, pluggy-1.x.y rootdir: /home/sweet/project - configfile: pytest.ini + configfile: pytest.toml collected 2 items - + @@ -202,10 +202,10 @@ You can always peek at the collection tree without running tests like this: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-8.x.y, pluggy-1.x.y rootdir: /home/sweet/project - configfile: pytest.ini + configfile: pytest.toml collected 3 items - + @@ -286,7 +286,7 @@ file will be left out: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-8.x.y, pluggy-1.x.y rootdir: /home/sweet/project - configfile: pytest.ini + configfile: pytest.toml collected 0 items ======================= no tests collected in 0.12s ======================== diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 928dcddae74..e150e7ca00b 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -166,6 +166,8 @@ Now we'll get feedback on a bad argument: $ pytest -q --cmdopt=type3 ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...] pytest: error: argument --cmdopt: invalid choice: 'type3' (choose from type1, type2) + inifile: None + rootdir: /home/sweet/project If you need to provide more detailed error messages, you can use the @@ -726,7 +728,7 @@ We can run this: file /home/sweet/project/b/test_error.py, line 1 def test_root(db): # no db here, will error out E fixture 'db' not found - > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capteesys, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory + > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capteesys, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, subtests, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory > use 'pytest --fixtures [testpath]' for help on them. /home/sweet/project/b/test_error.py:1 diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 24501f53a69..ec1ef60a605 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -20,7 +20,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 8.4.2 + pytest 9.0.0 .. _`simpletest`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 73a3eeb15c1..0c4ddb8b4dc 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -1423,7 +1423,7 @@ Running the above tests results in the following test IDs being used: rootdir: /home/sweet/project collected 12 items - + diff --git a/doc/en/how-to/subtests.rst b/doc/en/how-to/subtests.rst index 956405bc7cf..c8d9461c983 100644 --- a/doc/en/how-to/subtests.rst +++ b/doc/en/how-to/subtests.rst @@ -29,7 +29,37 @@ Each assertion failure or error is caught by the context manager and reported in .. code-block:: pytest $ pytest -q test_subtest.py - + uuuuuF [100%] + ================================= FAILURES ================================= + _______________________ test [custom message] (i=1) ________________________ + + subtests = <_pytest.subtests.Subtests object at 0xdeadbeef0001> + + def test(subtests): + for i in range(5): + with subtests.test(msg="custom message", i=i): + > assert i % 2 == 0 + E assert (1 % 2) == 0 + + test_subtest.py:6: AssertionError + _______________________ test [custom message] (i=3) ________________________ + + subtests = <_pytest.subtests.Subtests object at 0xdeadbeef0001> + + def test(subtests): + for i in range(5): + with subtests.test(msg="custom message", i=i): + > assert i % 2 == 0 + E assert (3 % 2) == 0 + + test_subtest.py:6: AssertionError + ___________________________________ test ___________________________________ + contains 2 failed subtests + ========================= short test summary info ========================== + SUBFAILED[custom message] (i=1) test_subtest.py::test - assert (1 % 2) == 0 + SUBFAILED[custom message] (i=3) test_subtest.py::test - assert (3 % 2) == 0 + FAILED test_subtest.py::test - contains 2 failed subtests + 3 failed, 3 subtests passed in 0.12s In the output above: diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 3cf49ebb0c6..6382edc4797 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -448,7 +448,7 @@ in our configuration file to tell pytest where to look for example files. =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-8.x.y, pluggy-1.x.y rootdir: /home/sweet/project - configfile: pytest.ini + configfile: pytest.toml collected 2 items test_example.py .. [100%] diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 108ad660af3..1c51b712ee1 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -2692,11 +2692,9 @@ All the command-line flags can be obtained by running ``pytest --help``:: --markers show markers (builtin, plugin and per-project ones). -x, --exitfirst Exit instantly on first error or failed test --maxfail=num Exit after first num failures or errors - --strict-config Any warnings encountered while parsing the `pytest` - section of the configuration file raise errors - --strict-markers Markers not registered in the `markers` section of - the configuration file raise errors - --strict (Deprecated) alias to --strict-markers + --strict-config Enables the strict_config option + --strict-markers Enables the strict_markers option + --strict Enables the strict option --fixtures, --funcargs Show available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v') @@ -2845,8 +2843,9 @@ All the command-line flags can be obtained by running ``pytest --help``:: file. This file is opened with 'w' and truncated as a result, care advised. Default: pytestdebug.log. -o, --override-ini OVERRIDE_INI - Override ini option with "option=value" style, e.g. - `-o xfail_strict=True -o cache_dir=cache`. + Override configuration option with "option=value" + style, e.g. `-o strict_xfail=True -o + cache_dir=cache`. --assert=MODE Control assertion debugging tools. 'plain' performs no assertion debugging. 'rewrite' (the default) rewrites assert statements @@ -2888,11 +2887,19 @@ All the command-line flags can be obtained by running ``pytest --help``:: Disable a logger by name. Can be passed multiple times. - [pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg|pyproject.toml file found: + [pytest] configuration options in the first pytest.toml|pytest.ini|tox.ini|setup.cfg|pyproject.toml file found: markers (linelist): Register new markers for test functions empty_parameter_set_mark (string): Default marker for empty parametersets + strict_config (bool): Any warnings encountered while parsing the `pytest` + section of the configuration file raise errors + strict_markers (bool): + Markers not registered in the `markers` section of + the configuration file raise errors + strict (bool): Enables all strictness options, currently: + strict_config, strict_markers, strict_xfail, + strict_parametrization_ids filterwarnings (linelist): Each line specifies a pattern for warnings.filterwarnings. Processed after @@ -2919,6 +2926,9 @@ All the command-line flags can be obtained by running ``pytest --help``:: disable_test_id_escaping_and_forfeit_all_rights_to_community_support (bool): Disable string escape non-ASCII characters, might cause unwanted side effects(use at your own risk) + strict_parametrization_ids (bool): + Emit an error if non-unique parameter set IDs are + detected console_output_style (string): Console output: "classic", or with additional progress information ("progress" (percentage) | @@ -2929,8 +2939,9 @@ All the command-line flags can be obtained by running ``pytest --help``:: overriding the main level. Higher levels will provide more detailed information about each test case executed. - xfail_strict (bool): Default for the strict parameter of xfail markers - when not given explicitly (default: False) + strict_xfail (bool): Default for the strict parameter of xfail markers + when not given explicitly (default: False) (alias: + xfail_strict) tmp_path_retention_count (string): How many sessions should we keep the `tmp_path` directories, according to @@ -2998,6 +3009,10 @@ All the command-line flags can be obtained by running ``pytest --help``:: faulthandler_exit_on_timeout (bool): Exit the test process if a test takes more than faulthandler_timeout seconds to finish + verbosity_subtests (string): + Specify verbosity level for subtests. Higher levels + will generate output for passed subtests. Failed + subtests are always reported. addopts (args): Extra command line options minversion (string): Minimally required pytest version pythonpath (paths): Add paths to sys.path @@ -3011,6 +3026,9 @@ All the command-line flags can be obtained by running ``pytest --help``:: PYTEST_PLUGINS Comma-separated plugins to load during startup PYTEST_DISABLE_PLUGIN_AUTOLOAD Set to disable plugin auto-loading PYTEST_DEBUG Set to enable debug tracing of pytest's internals + PYTEST_DEBUG_TEMPROOT Override the system temporary directory + PYTEST_THEME The Pygments style to use for code output + PYTEST_THEME_MODE Set the PYTEST_THEME to be either 'dark' or 'light' to see available markers type: pytest --markers diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index 5483bb46063..fcaaee695c9 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -1,6 +1,6 @@ -c broken-dep-constraints.txt pluggy>=1.5.0 -pygments-pytest>=2.3.0 +pygments-pytest>=2.5.0 sphinx-removed-in>=0.2.0 sphinx>=7 sphinxcontrib-trio