From cba5c4a98f65fdcfa484749bc06bcde1fb0865bc Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 2 Jun 2025 18:01:27 +0200 Subject: [PATCH 001/270] fix: support TerminalReporter.isatty being called (#13462) Fixes #13461. --- changelog/13461.bugfix.rst | 3 +++ src/_pytest/compat.py | 20 ++++++++++++++++++++ src/_pytest/terminal.py | 11 +++++++---- testing/test_terminal.py | 10 ++++++++++ 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 changelog/13461.bugfix.rst diff --git a/changelog/13461.bugfix.rst b/changelog/13461.bugfix.rst new file mode 100644 index 00000000000..4b45f7cc9da --- /dev/null +++ b/changelog/13461.bugfix.rst @@ -0,0 +1,3 @@ +Corrected ``_pytest.terminal.TerminalReporter.isatty`` to support +being called as a method. Before it was just a boolean which could +break correct code when using ``-o log_cli=true``). diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index f113a2197f3..7d71838be51 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -300,3 +300,23 @@ def get_user_id() -> int | None: # This also work for Enums (if you use `is` to compare) and Literals. def assert_never(value: NoReturn) -> NoReturn: assert False, f"Unhandled value: {value} ({type(value).__name__})" + + +class CallableBool: + """ + A bool-like object that can also be called, returning its true/false value. + + Used for backwards compatibility in cases where something was supposed to be a method + but was implemented as a simple attribute by mistake (see `TerminalReporter.isatty`). + + Do not use in new code. + """ + + def __init__(self, value: bool) -> None: + self._value = value + + def __bool__(self) -> bool: + return self._value + + def __call__(self) -> bool: + return self._value diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index d5ccc4e4900..5f27c46b41e 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -31,6 +31,7 @@ import pluggy +from _pytest import compat from _pytest import nodes from _pytest import timing from _pytest._code import ExceptionInfo @@ -387,7 +388,9 @@ def __init__(self, config: Config, file: TextIO | None = None) -> None: self.reportchars = getreportopt(config) self.foldskipped = config.option.fold_skipped self.hasmarkup = self._tw.hasmarkup - self.isatty = file.isatty() + # isatty should be a method but was wrongly implemented as a boolean. + # We use CallableBool here to support both. + self.isatty = compat.CallableBool(file.isatty()) self._progress_nodeids_reported: set[str] = set() self._timing_nodeids_reported: set[str] = set() self._show_progress_info = self._determine_show_progress_info() @@ -766,7 +769,7 @@ def _width_of_current_line(self) -> int: return self._tw.width_of_current_line def pytest_collection(self) -> None: - if self.isatty: + if self.isatty(): if self.config.option.verbose >= 0: self.write("collecting ... ", flush=True, bold=True) elif self.config.option.verbose >= 1: @@ -779,7 +782,7 @@ def pytest_collectreport(self, report: CollectReport) -> None: self._add_stats("skipped", [report]) items = [x for x in report.result if isinstance(x, Item)] self._numcollected += len(items) - if self.isatty: + if self.isatty(): self.report_collect() def report_collect(self, final: bool = False) -> None: @@ -811,7 +814,7 @@ def report_collect(self, final: bool = False) -> None: line += f" / {skipped} skipped" if self._numcollected > selected: line += f" / {selected} selected" - if self.isatty: + if self.isatty(): self.rewrite(line, bold=True, erase=True) if final: self.write("\n") diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 86feb33b3ec..3ea10195c6b 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -442,6 +442,16 @@ def test_long_xfail(): ] ) + @pytest.mark.parametrize("isatty", [True, False]) + def test_isatty(self, pytester: Pytester, monkeypatch, isatty: bool) -> None: + config = pytester.parseconfig() + f = StringIO() + monkeypatch.setattr(f, "isatty", lambda: isatty) + tr = TerminalReporter(config, f) + assert tr.isatty() == isatty + # It was incorrectly implemented as a boolean so we still support using it as one. + assert bool(tr.isatty) == isatty + class TestCollectonly: def test_collectonly_basic(self, pytester: Pytester) -> None: From edf0e8caae09b7e3124d7a14b5d10d4f2561804e Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 2 Jun 2025 20:38:33 +0300 Subject: [PATCH 002/270] Merge pull request #13469 from pytest-dev/release-8.4.0 Release 8.4.0 (cherry picked from commit 293b392bab5d0f5fb2e689075c3c06c3ab7b29b7) --- changelog/10224.improvement.rst | 18 -- changelog/10404.bugfix.rst | 7 - changelog/10839.deprecation.rst | 1 - changelog/11067.bugfix.rst | 3 - changelog/11118.improvement.rst | 3 - changelog/11372.breaking.rst | 1 - changelog/11381.improvement.rst | 17 -- changelog/11525.improvement.rst | 3 - changelog/11538.feature.rst | 1 - changelog/12008.bugfix.rst | 1 - changelog/12017.contrib.rst | 7 - changelog/12081.feature.rst | 1 - changelog/12346.breaking.rst | 1 - changelog/12426.improvement.rst | 1 - changelog/12504.feature.rst | 1 - changelog/12535.doc.rst | 4 - changelog/12647.contrib.rst | 1 - changelog/12707.improvement.rst | 1 - changelog/12713.feature.rst | 3 - changelog/12736.improvement.rst | 3 - changelog/12749.feature.rst | 21 -- changelog/12765.feature.rst | 3 - changelog/12863.bugfix.rst | 1 - changelog/12874.breaking.rst | 1 - changelog/12929.bugfix.rst | 1 - changelog/12938.bugfix.rst | 1 - changelog/12943.improvement.rst | 1 - changelog/12946.bugfix.rst | 1 - changelog/12958.improvement.rst | 9 - changelog/12960.breaking.rst | 3 - changelog/12981.bugfix.rst | 1 - changelog/13010.improvement.rst | 1 - changelog/13016.improvement.rst | 8 - changelog/13031.improvement.rst | 1 - changelog/13047.bugfix.rst | 17 -- changelog/13115.improvement.rst | 8 - changelog/13119.bugfix.rst | 1 - changelog/13122.improvement.rst | 15 - changelog/13125.feature.rst | 1 - changelog/13175.bugfix.rst | 1 - changelog/13192.feature.1.rst | 1 - changelog/13192.feature.2.rst | 1 - changelog/13192.feature.rst | 1 - changelog/13218.doc.rst | 1 - changelog/13221.doc.rst | 1 - changelog/13228.feature.rst | 3 - changelog/13248.bugfix.rst | 2 - changelog/13253.feature.rst | 1 - changelog/13291.bugfix.rst | 1 - changelog/13308.improvement.rst | 1 - changelog/13312.bugfix.rst | 1 - changelog/13317.packaging.rst | 4 - changelog/13345.bugfix.rst | 1 - changelog/13377.bugfix.rst | 12 - changelog/13380.improvement.rst | 1 - changelog/13384.bugfix.rst | 1 - changelog/13415.improvement.rst | 5 - changelog/13420.bugfix.rst | 1 - changelog/13420.improvement.rst | 1 - changelog/13457.improvement.rst | 1 - changelog/4112.improvement.rst | 1 - changelog/5473.improvement.rst | 1 - changelog/6649.doc.rst | 1 - changelog/6649.misc.rst | 1 - changelog/6985.improvement.rst | 21 -- changelog/7683.improvement.rst | 1 - changelog/8612.doc.rst | 5 - changelog/9037.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-8.4.0.rst | 106 +++++++ doc/en/builtin.rst | 85 ++++-- doc/en/changelog.rst | 421 ++++++++++++++++++++++++++++ doc/en/example/parametrize.rst | 6 +- doc/en/example/pythoncollection.rst | 4 +- doc/en/example/reportingdemo.rst | 30 +- doc/en/example/simple.rst | 10 +- doc/en/getting-started.rst | 2 +- doc/en/how-to/cache.rst | 2 - doc/en/how-to/capture-warnings.rst | 1 + doc/en/how-to/fixtures.rst | 7 +- doc/en/how-to/output.rst | 2 +- doc/en/how-to/parametrize.rst | 2 +- doc/en/how-to/unittest.rst | 2 + doc/en/reference/reference.rst | 65 +++-- 84 files changed, 667 insertions(+), 326 deletions(-) delete mode 100644 changelog/10224.improvement.rst delete mode 100644 changelog/10404.bugfix.rst delete mode 100644 changelog/10839.deprecation.rst delete mode 100644 changelog/11067.bugfix.rst delete mode 100644 changelog/11118.improvement.rst delete mode 100644 changelog/11372.breaking.rst delete mode 100644 changelog/11381.improvement.rst delete mode 100644 changelog/11525.improvement.rst delete mode 100644 changelog/11538.feature.rst delete mode 100644 changelog/12008.bugfix.rst delete mode 100644 changelog/12017.contrib.rst delete mode 100644 changelog/12081.feature.rst delete mode 100644 changelog/12346.breaking.rst delete mode 100644 changelog/12426.improvement.rst delete mode 100644 changelog/12504.feature.rst delete mode 100644 changelog/12535.doc.rst delete mode 100644 changelog/12647.contrib.rst delete mode 100644 changelog/12707.improvement.rst delete mode 100644 changelog/12713.feature.rst delete mode 100644 changelog/12736.improvement.rst delete mode 100644 changelog/12749.feature.rst delete mode 100644 changelog/12765.feature.rst delete mode 100644 changelog/12863.bugfix.rst delete mode 100644 changelog/12874.breaking.rst delete mode 100644 changelog/12929.bugfix.rst delete mode 100644 changelog/12938.bugfix.rst delete mode 100644 changelog/12943.improvement.rst delete mode 100644 changelog/12946.bugfix.rst delete mode 100644 changelog/12958.improvement.rst delete mode 100644 changelog/12960.breaking.rst delete mode 100644 changelog/12981.bugfix.rst delete mode 100644 changelog/13010.improvement.rst delete mode 100644 changelog/13016.improvement.rst delete mode 100644 changelog/13031.improvement.rst delete mode 100644 changelog/13047.bugfix.rst delete mode 100644 changelog/13115.improvement.rst delete mode 100644 changelog/13119.bugfix.rst delete mode 100644 changelog/13122.improvement.rst delete mode 100644 changelog/13125.feature.rst delete mode 100644 changelog/13175.bugfix.rst delete mode 100644 changelog/13192.feature.1.rst delete mode 100644 changelog/13192.feature.2.rst delete mode 100644 changelog/13192.feature.rst delete mode 100644 changelog/13218.doc.rst delete mode 100644 changelog/13221.doc.rst delete mode 100644 changelog/13228.feature.rst delete mode 100644 changelog/13248.bugfix.rst delete mode 100644 changelog/13253.feature.rst delete mode 100644 changelog/13291.bugfix.rst delete mode 100644 changelog/13308.improvement.rst delete mode 100644 changelog/13312.bugfix.rst delete mode 100644 changelog/13317.packaging.rst delete mode 100644 changelog/13345.bugfix.rst delete mode 100644 changelog/13377.bugfix.rst delete mode 100644 changelog/13380.improvement.rst delete mode 100644 changelog/13384.bugfix.rst delete mode 100644 changelog/13415.improvement.rst delete mode 100644 changelog/13420.bugfix.rst delete mode 100644 changelog/13420.improvement.rst delete mode 100644 changelog/13457.improvement.rst delete mode 100644 changelog/4112.improvement.rst delete mode 100644 changelog/5473.improvement.rst delete mode 100644 changelog/6649.doc.rst delete mode 100644 changelog/6649.misc.rst delete mode 100644 changelog/6985.improvement.rst delete mode 100644 changelog/7683.improvement.rst delete mode 100644 changelog/8612.doc.rst delete mode 100644 changelog/9037.bugfix.rst create mode 100644 doc/en/announce/release-8.4.0.rst diff --git a/changelog/10224.improvement.rst b/changelog/10224.improvement.rst deleted file mode 100644 index 93afe9e2c1e..00000000000 --- a/changelog/10224.improvement.rst +++ /dev/null @@ -1,18 +0,0 @@ -pytest's ``short`` and ``long`` traceback styles (:ref:`how-to-modifying-python-tb-printing`) -now have partial :pep:`657` support and will show specific code segments in the -traceback. - -.. code-block:: pytest - - ================================= FAILURES ================================= - _______________________ test_gets_correct_tracebacks _______________________ - - test_tracebacks.py:12: in test_gets_correct_tracebacks - assert manhattan_distance(p1, p2) == 1 - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - test_tracebacks.py:6: in manhattan_distance - return abs(point_1.x - point_2.x) + abs(point_1.y - point_2.y) - ^^^^^^^^^ - E AttributeError: 'NoneType' object has no attribute 'x' - --- by :user:`ammaraskar` diff --git a/changelog/10404.bugfix.rst b/changelog/10404.bugfix.rst deleted file mode 100644 index 4c98ea03d64..00000000000 --- a/changelog/10404.bugfix.rst +++ /dev/null @@ -1,7 +0,0 @@ -Apply filterwarnings from config/cli as soon as possible, and revert them as late as possible -so that warnings as errors are collected throughout the pytest run and before the -unraisable and threadexcept hooks are removed. - -This allows very late warnings and unraisable/threadexcept exceptions to fail the test suite. - -This also changes the warning that the lsof plugin issues from PytestWarning to the new warning PytestFDWarning so it can be more easily filtered. diff --git a/changelog/10839.deprecation.rst b/changelog/10839.deprecation.rst deleted file mode 100644 index a3e2cbf51d0..00000000000 --- a/changelog/10839.deprecation.rst +++ /dev/null @@ -1 +0,0 @@ -Requesting an asynchronous fixture without a `pytest_fixture_setup` hook that resolves it will now give a DeprecationWarning. This most commonly happens if a sync test requests an async fixture. This should have no effect on a majority of users with async tests or fixtures using async pytest plugins, but may affect non-standard hook setups or ``autouse=True``. For guidance on how to work around this warning see :ref:`sync-test-async-fixture`. diff --git a/changelog/11067.bugfix.rst b/changelog/11067.bugfix.rst deleted file mode 100644 index 4e3cb8e7dd7..00000000000 --- a/changelog/11067.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -The test report is now consistent regardless if the test xfailed via :ref:`pytest.mark.xfail ` or :func:`pytest.fail`. - -Previously, *xfailed* tests via the marker would have the string ``"reason: "`` prefixed to the message, while those *xfailed* via the function did not. The prefix has been removed. diff --git a/changelog/11118.improvement.rst b/changelog/11118.improvement.rst deleted file mode 100644 index 4760dbe9d64..00000000000 --- a/changelog/11118.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -Now :confval:`pythonpath` configures `$PYTHONPATH` earlier than before during the initialization process, which now also affects plugins loaded via the `-p` command-line option. - --- by :user:`millerdev` diff --git a/changelog/11372.breaking.rst b/changelog/11372.breaking.rst deleted file mode 100644 index f4b5c3c6f6b..00000000000 --- a/changelog/11372.breaking.rst +++ /dev/null @@ -1 +0,0 @@ -Async tests will now fail, instead of warning+skipping, if you don't have any suitable plugin installed. diff --git a/changelog/11381.improvement.rst b/changelog/11381.improvement.rst deleted file mode 100644 index 74c080cc188..00000000000 --- a/changelog/11381.improvement.rst +++ /dev/null @@ -1,17 +0,0 @@ -The ``type`` parameter of the ``parser.addini`` method now accepts `"int"` and ``"float"`` parameters, facilitating the parsing of configuration values in the configuration file. - -Example: - -.. code-block:: python - - def pytest_addoption(parser): - parser.addini("int_value", type="int", default=2, help="my int value") - parser.addini("float_value", type="float", default=4.2, help="my float value") - -The `pytest.ini` file: - -.. code-block:: ini - - [pytest] - int_value = 3 - float_value = 5.4 diff --git a/changelog/11525.improvement.rst b/changelog/11525.improvement.rst deleted file mode 100644 index 1935ce59343..00000000000 --- a/changelog/11525.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fixtures are now clearly represented in the output as a "fixture object", not as a normal function as before, making it easy for beginners to catch mistakes such as referencing a fixture declared in the same module but not requested in the test function. - --- by :user:`the-compiler` and :user:`glyphack` diff --git a/changelog/11538.feature.rst b/changelog/11538.feature.rst deleted file mode 100644 index d6473b8fe73..00000000000 --- a/changelog/11538.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added :class:`pytest.RaisesGroup` as an equivalent to :func:`pytest.raises` for expecting :exc:`ExceptionGroup`. Also adds :class:`pytest.RaisesExc` which is now the logic behind :func:`pytest.raises` and used as parameter to :class:`pytest.RaisesGroup`. ``RaisesGroup`` includes the ability to specify multiple different expected exceptions, the structure of nested exception groups, and flags for emulating :ref:`except* `. See :ref:`assert-matching-exception-groups` and docstrings for more information. diff --git a/changelog/12008.bugfix.rst b/changelog/12008.bugfix.rst deleted file mode 100644 index b9680b89236..00000000000 --- a/changelog/12008.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -In :pr:`11220`, an unintended change in reordering was introduced by changing the way indices were assigned to direct params. More specifically, before that change, the indices of direct params to metafunc's callspecs were assigned after all parametrizations took place. Now, that change is reverted. diff --git a/changelog/12017.contrib.rst b/changelog/12017.contrib.rst deleted file mode 100644 index ec1861893b3..00000000000 --- a/changelog/12017.contrib.rst +++ /dev/null @@ -1,7 +0,0 @@ -Mixed internal improvements: - -* Migrate formatting to f-strings in some tests. -* Use type-safe constructs in JUnitXML tests. -* Moved`` MockTiming`` into ``_pytest.timing``. - --- by :user:`RonnyPfannschmidt` diff --git a/changelog/12081.feature.rst b/changelog/12081.feature.rst deleted file mode 100644 index 6538fbf30f8..00000000000 --- a/changelog/12081.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added :fixture:`capteesys` to capture AND pass output to next handler set by ``--capture=``. diff --git a/changelog/12346.breaking.rst b/changelog/12346.breaking.rst deleted file mode 100644 index 7013cf734c8..00000000000 --- a/changelog/12346.breaking.rst +++ /dev/null @@ -1 +0,0 @@ -Tests will now fail, instead of raising a warning, if they return any value other than None. diff --git a/changelog/12426.improvement.rst b/changelog/12426.improvement.rst deleted file mode 100644 index 0da1f838aea..00000000000 --- a/changelog/12426.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -A warning is now issued when :ref:`pytest.mark.usefixtures ref` is used without specifying any fixtures. Previously, empty usefixtures markers were silently ignored. diff --git a/changelog/12504.feature.rst b/changelog/12504.feature.rst deleted file mode 100644 index d72b97958c2..00000000000 --- a/changelog/12504.feature.rst +++ /dev/null @@ -1 +0,0 @@ -:func:`pytest.mark.xfail` now accepts :class:`pytest.RaisesGroup` for the ``raises`` parameter when you expect an exception group. You can also pass a :class:`pytest.RaisesExc` if you e.g. want to make use of the ``check`` parameter. diff --git a/changelog/12535.doc.rst b/changelog/12535.doc.rst deleted file mode 100644 index d43c1c822ea..00000000000 --- a/changelog/12535.doc.rst +++ /dev/null @@ -1,4 +0,0 @@ -`This -example` -showed ``print`` statements that do not exactly reflect what the -different branches actually do. The fix makes the example more precise. diff --git a/changelog/12647.contrib.rst b/changelog/12647.contrib.rst deleted file mode 100644 index 1d7a3181778..00000000000 --- a/changelog/12647.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed running the test suite with the ``hypothesis`` pytest plugin. diff --git a/changelog/12707.improvement.rst b/changelog/12707.improvement.rst deleted file mode 100644 index 4684b6561c8..00000000000 --- a/changelog/12707.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Exception chains can be navigated when dropped into Pdb in Python 3.13+. diff --git a/changelog/12713.feature.rst b/changelog/12713.feature.rst deleted file mode 100644 index 90867b87eae..00000000000 --- a/changelog/12713.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -New `--force-short-summary` option to force condensed summary output regardless of verbosity level. - -This lets users still see condensed summary output of failures for quick reference in log files from job outputs, being especially useful if non-condensed output is very verbose. diff --git a/changelog/12736.improvement.rst b/changelog/12736.improvement.rst deleted file mode 100644 index 5fdb14e2ef5..00000000000 --- a/changelog/12736.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -Added a new attribute `name` with the fixed value `"pytest tests"` to the root tag `testsuites` of the junit-xml generated by pytest. - -This attribute is part of many junit-xml specifications and is even part of the `junit-10.xsd` specification that pytest's implementation is based on. diff --git a/changelog/12749.feature.rst b/changelog/12749.feature.rst deleted file mode 100644 index c3b7ca5d321..00000000000 --- a/changelog/12749.feature.rst +++ /dev/null @@ -1,21 +0,0 @@ -pytest traditionally collects classes/functions in the test module namespace even if they are imported from another file. - -For example: - -.. code-block:: python - - # contents of src/domain.py - class Testament: ... - - - # contents of tests/test_testament.py - from domain import Testament - - - def test_testament(): ... - -In this scenario with the default options, pytest will collect the class `Testament` from `tests/test_testament.py` because it starts with `Test`, even though in this case it is a production class being imported in the test module namespace. - -This behavior can now be prevented by setting the new :confval:`collect_imported_tests` configuration option to ``false``, which will make pytest collect classes/functions from test files **only** if they are defined in that file. - --- by :user:`FreerGit` diff --git a/changelog/12765.feature.rst b/changelog/12765.feature.rst deleted file mode 100644 index 193c75621f7..00000000000 --- a/changelog/12765.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -Thresholds to trigger snippet truncation can now be set with :confval:`truncation_limit_lines` and :confval:`truncation_limit_chars`. - -See :ref:`truncation-params` for more information. diff --git a/changelog/12863.bugfix.rst b/changelog/12863.bugfix.rst deleted file mode 100644 index 0b1c397a08e..00000000000 --- a/changelog/12863.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix applying markers, including :ref:`pytest.mark.parametrize ` when placed above `@staticmethod` or `@classmethod`. diff --git a/changelog/12874.breaking.rst b/changelog/12874.breaking.rst deleted file mode 100644 index a442586eeb5..00000000000 --- a/changelog/12874.breaking.rst +++ /dev/null @@ -1 +0,0 @@ -We dropped support for Python 3.8 following its end of life (2024-10-07). diff --git a/changelog/12929.bugfix.rst b/changelog/12929.bugfix.rst deleted file mode 100644 index fcf490d83e2..00000000000 --- a/changelog/12929.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Handle StopIteration from test cases, setup and teardown correctly. diff --git a/changelog/12938.bugfix.rst b/changelog/12938.bugfix.rst deleted file mode 100644 index d54d73bdbf5..00000000000 --- a/changelog/12938.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed ``--durations-min`` argument not respected if ``-vv`` is used. diff --git a/changelog/12943.improvement.rst b/changelog/12943.improvement.rst deleted file mode 100644 index eb8ac63650a..00000000000 --- a/changelog/12943.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -If a test fails with an exceptiongroup with a single exception, the contained exception will now be displayed in the short test summary info. diff --git a/changelog/12946.bugfix.rst b/changelog/12946.bugfix.rst deleted file mode 100644 index b11da09e7ae..00000000000 --- a/changelog/12946.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed missing help for :mod:`pdb` commands wrapped by pytest -- by :user:`adamchainz`. diff --git a/changelog/12958.improvement.rst b/changelog/12958.improvement.rst deleted file mode 100644 index ee8dc8c0710..00000000000 --- a/changelog/12958.improvement.rst +++ /dev/null @@ -1,9 +0,0 @@ -A number of :ref:`unraisable ` enhancements: - -* Set the unraisable hook as early as possible and unset it as late as possible, to collect the most possible number of unraisable exceptions. -* Call the garbage collector just before unsetting the unraisable hook, to collect any straggling exceptions. -* Collect multiple unraisable exceptions per test phase. -* Report the :mod:`tracemalloc` allocation traceback (if available). -* Avoid using a generator based hook to allow handling :class:`StopIteration` in test failures. -* Report the unraisable exception as the cause of the :class:`pytest.PytestUnraisableExceptionWarning` exception if raised. -* Compute the ``repr`` of the unraisable object in the unraisable hook so you get the latest information if available, and should help with resurrection of the object. diff --git a/changelog/12960.breaking.rst b/changelog/12960.breaking.rst deleted file mode 100644 index 3ab87e6fe23..00000000000 --- a/changelog/12960.breaking.rst +++ /dev/null @@ -1,3 +0,0 @@ -Test functions containing a yield now cause an explicit error. They have not been run since pytest 4.0, and were previously marked as an expected failure and deprecation warning. - -See :ref:`the docs ` for more information. diff --git a/changelog/12981.bugfix.rst b/changelog/12981.bugfix.rst deleted file mode 100644 index 5fc8e29656f..00000000000 --- a/changelog/12981.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Prevent exceptions in :func:`pytest.Config.add_cleanup` callbacks preventing further cleanups. diff --git a/changelog/13010.improvement.rst b/changelog/13010.improvement.rst deleted file mode 100644 index d6b814f090e..00000000000 --- a/changelog/13010.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -:func:`pytest.approx` now can compare collections that contain numbers and non-numbers mixed. diff --git a/changelog/13016.improvement.rst b/changelog/13016.improvement.rst deleted file mode 100644 index 634672ab69b..00000000000 --- a/changelog/13016.improvement.rst +++ /dev/null @@ -1,8 +0,0 @@ -A number of :ref:`threadexception ` enhancements: - -* Set the excepthook as early as possible and unset it as late as possible, to collect the most possible number of unhandled exceptions from threads. -* Collect multiple thread exceptions per test phase. -* Report the :mod:`tracemalloc` allocation traceback (if available). -* Avoid using a generator based hook to allow handling :class:`StopIteration` in test failures. -* Report the thread exception as the cause of the :class:`pytest.PytestUnhandledThreadExceptionWarning` exception if raised. -* Extract the ``name`` of the thread object in the excepthook which should help with resurrection of the thread. diff --git a/changelog/13031.improvement.rst b/changelog/13031.improvement.rst deleted file mode 100644 index c6c64c4673a..00000000000 --- a/changelog/13031.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -An empty parameter set as in ``pytest.mark.parametrize([], ids=idfunc)`` will no longer trigger a call to ``idfunc`` with internal objects. diff --git a/changelog/13047.bugfix.rst b/changelog/13047.bugfix.rst deleted file mode 100644 index 399e860505c..00000000000 --- a/changelog/13047.bugfix.rst +++ /dev/null @@ -1,17 +0,0 @@ -Restore :func:`pytest.approx` handling of equality checks between `bool` and `numpy.bool_` types. - -Comparing `bool` and `numpy.bool_` using :func:`pytest.approx` accidentally changed in version `8.3.4` and `8.3.5` to no longer match: - -.. code-block:: pycon - - >>> import numpy as np - >>> from pytest import approx - >>> [np.True_, np.True_] == pytest.approx([True, True]) - False - -This has now been fixed: - -.. code-block:: pycon - - >>> [np.True_, np.True_] == pytest.approx([True, True]) - True diff --git a/changelog/13115.improvement.rst b/changelog/13115.improvement.rst deleted file mode 100644 index 9ac45820917..00000000000 --- a/changelog/13115.improvement.rst +++ /dev/null @@ -1,8 +0,0 @@ -Allows supplying ``ExceptionGroup[Exception]`` and ``BaseExceptionGroup[BaseException]`` to ``pytest.raises`` to keep full typing on :class:`ExceptionInfo `: - -.. code-block:: python - - with pytest.raises(ExceptionGroup[Exception]) as exc_info: - some_function() - -Parametrizing with other exception types remains an error - we do not check the types of child exceptions and thus do not permit code that might look like we do. diff --git a/changelog/13119.bugfix.rst b/changelog/13119.bugfix.rst deleted file mode 100644 index b7e56af9bb8..00000000000 --- a/changelog/13119.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Improved handling of invalid regex patterns for filter warnings by providing a clear error message. diff --git a/changelog/13122.improvement.rst b/changelog/13122.improvement.rst deleted file mode 100644 index c302713b320..00000000000 --- a/changelog/13122.improvement.rst +++ /dev/null @@ -1,15 +0,0 @@ -The ``--stepwise`` mode received a number of improvements: - -* It no longer forgets the last failed test in case pytest is executed later without the flag. - - This enables the following workflow: - - 1. Execute pytest with ``--stepwise``, pytest then stops at the first failing test; - 2. Iteratively update the code and run the test in isolation, without the ``--stepwise`` flag (for example in an IDE), until it is fixed. - 3. Execute pytest with ``--stepwise`` again and pytest will continue from the previously failed test, and if it passes, continue on to the next tests. - - Previously, at step 3, pytest would start from the beginning, forgetting the previously failed test. - - This change however might cause issues if the ``--stepwise`` mode is used far apart in time, as the state might get stale, so the internal state will be reset automatically in case the test suite changes (for now only the number of tests are considered for this, we might change/improve this on the future). - -* New ``--stepwise-reset``/``--sw-reset`` flag, allowing the user to explicitly reset the stepwise state and restart the workflow from the beginning. diff --git a/changelog/13125.feature.rst b/changelog/13125.feature.rst deleted file mode 100644 index 0c7d66c1169..00000000000 --- a/changelog/13125.feature.rst +++ /dev/null @@ -1 +0,0 @@ -:confval:`console_output_style` now supports ``times`` to show execution time of each test. diff --git a/changelog/13175.bugfix.rst b/changelog/13175.bugfix.rst deleted file mode 100644 index bdbb72b41e1..00000000000 --- a/changelog/13175.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -The diff is now also highlighted correctly when comparing two strings. diff --git a/changelog/13192.feature.1.rst b/changelog/13192.feature.1.rst deleted file mode 100644 index 71fb06f7d70..00000000000 --- a/changelog/13192.feature.1.rst +++ /dev/null @@ -1 +0,0 @@ -:func:`pytest.raises` will now print a helpful string diff if matching fails and the match parameter has ``^`` and ``$`` and is otherwise escaped. diff --git a/changelog/13192.feature.2.rst b/changelog/13192.feature.2.rst deleted file mode 100644 index 0ffa0e1496a..00000000000 --- a/changelog/13192.feature.2.rst +++ /dev/null @@ -1 +0,0 @@ -You can now pass :func:`with pytest.raises(check=fn): `, where ``fn`` is a function which takes a raised exception and returns a boolean. The ``raises`` fails if no exception was raised (as usual), passes if an exception is raised and ``fn`` returns ``True`` (as well as ``match`` and the type matching, if specified, which are checked before), and propagates the exception if ``fn`` returns ``False`` (which likely also fails the test). diff --git a/changelog/13192.feature.rst b/changelog/13192.feature.rst deleted file mode 100644 index 97f31ce233c..00000000000 --- a/changelog/13192.feature.rst +++ /dev/null @@ -1 +0,0 @@ -:func:`pytest.raises` will now raise a warning when passing an empty string to ``match``, as this will match against any value. Use ``match="^$"`` if you want to check that an exception has no message. diff --git a/changelog/13218.doc.rst b/changelog/13218.doc.rst deleted file mode 100644 index 907a817e895..00000000000 --- a/changelog/13218.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Pointed out in the :func:`pytest.approx` documentation that it considers booleans unequal to numeric zero or one. diff --git a/changelog/13221.doc.rst b/changelog/13221.doc.rst deleted file mode 100644 index cfd35f821b4..00000000000 --- a/changelog/13221.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Improved grouping of CLI options in the ``--help`` output. diff --git a/changelog/13228.feature.rst b/changelog/13228.feature.rst deleted file mode 100644 index c5d84182313..00000000000 --- a/changelog/13228.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -:ref:`hidden-param` can now be used in ``id`` of :func:`pytest.param` or in -``ids`` of :py:func:`Metafunc.parametrize `. -It hides the parameter set from the test name. diff --git a/changelog/13248.bugfix.rst b/changelog/13248.bugfix.rst deleted file mode 100644 index 2ebb102fd07..00000000000 --- a/changelog/13248.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed an issue where passing a ``scope`` in :py:func:`Metafunc.parametrize ` with ``indirect=True`` -could result in other fixtures being unable to depend on the parametrized fixture. diff --git a/changelog/13253.feature.rst b/changelog/13253.feature.rst deleted file mode 100644 index e497c207223..00000000000 --- a/changelog/13253.feature.rst +++ /dev/null @@ -1 +0,0 @@ -New flag: :ref:`--disable-plugin-autoload ` which works as an alternative to :envvar:`PYTEST_DISABLE_PLUGIN_AUTOLOAD` when setting environment variables is inconvenient; and allows setting it in config files with :confval:`addopts`. diff --git a/changelog/13291.bugfix.rst b/changelog/13291.bugfix.rst deleted file mode 100644 index 03ce06b697a..00000000000 --- a/changelog/13291.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed ``repr`` of ``attrs`` objects in assertion failure messages when using ``attrs>=25.2``. diff --git a/changelog/13308.improvement.rst b/changelog/13308.improvement.rst deleted file mode 100644 index 70018c66d59..00000000000 --- a/changelog/13308.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Added official support for Python 3.14. diff --git a/changelog/13312.bugfix.rst b/changelog/13312.bugfix.rst deleted file mode 100644 index 62ad36879f5..00000000000 --- a/changelog/13312.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a possible ``KeyError`` crash on PyPy during collection of tests involving higher-scoped parameters. diff --git a/changelog/13317.packaging.rst b/changelog/13317.packaging.rst deleted file mode 100644 index 94171cb1ef3..00000000000 --- a/changelog/13317.packaging.rst +++ /dev/null @@ -1,4 +0,0 @@ -Specified minimum allowed versions of ``colorama``, ``iniconfig``, -and ``packaging``; and bumped the minimum allowed version -of ``exceptiongroup`` for ``python_version<'3.11'`` from a release -candidate to a full release. diff --git a/changelog/13345.bugfix.rst b/changelog/13345.bugfix.rst deleted file mode 100644 index 5010888aa08..00000000000 --- a/changelog/13345.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix type hints for :attr:`pytest.TestReport.when` and :attr:`pytest.TestReport.location`. diff --git a/changelog/13377.bugfix.rst b/changelog/13377.bugfix.rst deleted file mode 100644 index 15755481f7f..00000000000 --- a/changelog/13377.bugfix.rst +++ /dev/null @@ -1,12 +0,0 @@ -Fixed handling of test methods with positional-only parameter syntax. - -Now, methods are supported that formally define ``self`` as positional-only -and/or fixture parameters as keyword-only, e.g.: - -.. code-block:: python - - class TestClass: - - def test_method(self, /, *, fixture): ... - -Before, this caused an internal error in pytest. diff --git a/changelog/13380.improvement.rst b/changelog/13380.improvement.rst deleted file mode 100644 index 51f374fbf01..00000000000 --- a/changelog/13380.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Fix :class:`ExceptionGroup` traceback filtering to exclude pytest internals. diff --git a/changelog/13384.bugfix.rst b/changelog/13384.bugfix.rst deleted file mode 100644 index e93d01dcab0..00000000000 --- a/changelog/13384.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue where pytest could report negative durations. diff --git a/changelog/13415.improvement.rst b/changelog/13415.improvement.rst deleted file mode 100644 index 61667f15c7b..00000000000 --- a/changelog/13415.improvement.rst +++ /dev/null @@ -1,5 +0,0 @@ -The author metadata of the BibTex example is now correctly formatted with last names following first names. -An example of BibLaTex has been added. -BibTex and BibLaTex examples now clearly indicate that what is cited is software. - --- by :user:`willynilly` diff --git a/changelog/13420.bugfix.rst b/changelog/13420.bugfix.rst deleted file mode 100644 index 02f7372a759..00000000000 --- a/changelog/13420.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Added ``lru_cache`` to ``nodes._check_initialpaths_for_relpath``. diff --git a/changelog/13420.improvement.rst b/changelog/13420.improvement.rst deleted file mode 100644 index 54fe50a72b0..00000000000 --- a/changelog/13420.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Improved test collection performance by optimizing path resolution used in ``FSCollector``. diff --git a/changelog/13457.improvement.rst b/changelog/13457.improvement.rst deleted file mode 100644 index 3937384b322..00000000000 --- a/changelog/13457.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -The error message about duplicate parametrization no longer displays an internal stack trace. diff --git a/changelog/4112.improvement.rst b/changelog/4112.improvement.rst deleted file mode 100644 index 426b87ffa19..00000000000 --- a/changelog/4112.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Using :ref:`pytest.mark.usefixtures ` on :func:`pytest.param` now produces an error instead of silently doing nothing. diff --git a/changelog/5473.improvement.rst b/changelog/5473.improvement.rst deleted file mode 100644 index 1b9ab006d49..00000000000 --- a/changelog/5473.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Replace `:` with `;` in the assertion rewrite warning message so it can be filtered using standard Python warning filters before calling :func:`pytest.main`. diff --git a/changelog/6649.doc.rst b/changelog/6649.doc.rst deleted file mode 100644 index cf5bb781b87..00000000000 --- a/changelog/6649.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Added :class:`~pytest.TerminalReporter` to the :ref:`api-reference` documentation page. diff --git a/changelog/6649.misc.rst b/changelog/6649.misc.rst deleted file mode 100644 index cec8c3f4506..00000000000 --- a/changelog/6649.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Added :class:`~pytest.TerminalReporter` to the public pytest API, as it is part of the signature of the :hook:`pytest_terminal_summary` hook. diff --git a/changelog/6985.improvement.rst b/changelog/6985.improvement.rst deleted file mode 100644 index 34ee8edc77d..00000000000 --- a/changelog/6985.improvement.rst +++ /dev/null @@ -1,21 +0,0 @@ -Improved :func:`pytest.approx` to enhance the readability of value ranges and tolerances between 0.001 and 1000. - * The `repr` method now provides clearer output for values within those ranges, making it easier to interpret the results. - * Previously, the output for those ranges of values and tolerances was displayed in scientific notation (e.g., `42 ± 1.0e+00`). The updated method now presents the tolerance as a decimal for better readability (e.g., `42 ± 1`). - - Example: - - **Previous Output:** - - .. code-block:: console - - >>> pytest.approx(42, abs=1) - 42 ± 1.0e+00 - - **Current Output:** - - .. code-block:: console - - >>> pytest.approx(42, abs=1) - 42 ± 1 - - -- by :user:`fazeelghafoor` diff --git a/changelog/7683.improvement.rst b/changelog/7683.improvement.rst deleted file mode 100644 index 311abe4df93..00000000000 --- a/changelog/7683.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -The formerly optional ``pygments`` dependency is now required, causing output always to be source-highlighted (unless disabled via the ``--code-highlight=no`` CLI option). diff --git a/changelog/8612.doc.rst b/changelog/8612.doc.rst deleted file mode 100644 index 6ab4102ace4..00000000000 --- a/changelog/8612.doc.rst +++ /dev/null @@ -1,5 +0,0 @@ -Add a recipe for handling abstract test classes in the documentation. - -A new example has been added to the documentation to demonstrate how to use a mixin class to handle abstract -test classes without manually setting the ``__test__`` attribute for subclasses. -This ensures that subclasses of abstract test classes are automatically collected by pytest. diff --git a/changelog/9037.bugfix.rst b/changelog/9037.bugfix.rst deleted file mode 100644 index 5367452337e..00000000000 --- a/changelog/9037.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Honor :confval:`disable_test_id_escaping_and_forfeit_all_rights_to_community_support` when escaping ids in parametrized tests. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 51edc964a0c..702fd26dd0d 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-8.4.0 release-8.3.5 release-8.3.4 release-8.3.3 diff --git a/doc/en/announce/release-8.4.0.rst b/doc/en/announce/release-8.4.0.rst new file mode 100644 index 00000000000..65e80a55919 --- /dev/null +++ b/doc/en/announce/release-8.4.0.rst @@ -0,0 +1,106 @@ +pytest-8.4.0 +======================================= + +The pytest team is proud to announce the 8.4.0 release! + +This release contains new features, improvements, and bug fixes, +the full list of changes is available in the changelog: + + 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: + +* Adam Johnson +* Ammar Askar +* Andrew Pikul +* Andy Freeland +* Anthony Sottile +* Anton Zhilin +* Arpit Gupta +* Ashley Whetter +* Avasam +* Bahram Farahmand +* Brigitta Sipőcz +* Bruno Oliveira +* Callum Scott +* Christian Clauss +* Christopher Head +* Daara +* Daniel Miller +* Deysha Rivera +* Emil Hjelm +* Eugene Mwangi +* Florian Bruhin +* Frank Hoffmann +* GTowers1 +* Guillaume Gauvrit +* Gupta Arpit +* Harmin Parra Rueda +* Jakob van Santen +* Jason N. White +* Jiajun Xu +* John Litborn +* Julian Valentin +* JulianJvn +* Kenny Y +* Leonardus Chen +* Marcelo Duarte Trevisani +* Marcin Augustynów +* Natalia Mokeeva +* Nathan Rousseau +* Nauman Ahmed +* Nick Murphy +* Oleksandr Zavertniev +* Pavel Zhukov +* Peter Gessler +* Pierre Sassoulas +* Pradeep Kumar +* Ran Benita +* Reagan Lee +* Rob Arrow +* Ronny Pfannschmidt +* Sadra Barikbin +* Sam Bull +* Samuel Bronson +* Sashko +* Serge Smertin +* Shaygan Hooshyari +* Stefaan Lippens +* Stefan Zimmermann +* Stephen McDowell +* Sviatoslav Sydorenko +* Sviatoslav Sydorenko (Святослав Сидоренко) +* Thomas Grainger +* TobiMcNamobi +* Tobias Alex-Petersen +* Tony Narlock +* Vincent (Wen Yu) Ge +* Virendra Patil +* Will Riley +* Yann Dirson +* Zac Hatfield-Dodds +* delta87 +* dongfangtianyu +* eitanwass +* fazeelghafoor +* ikappaki +* jakkdl +* maugu +* moajo +* mwychung +* polkapolka +* suspe +* sven +* 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 8aa6fef681c..b129d0a763f 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:556 + cache -- .../_pytest/cacheprovider.py:555 Return a cache object that can persist state between testing sessions. cache.get(key, default) @@ -33,7 +33,48 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a Values can be any object handled by the json stdlib module. - capsysbinary -- .../_pytest/capture.py:1024 + capsys -- .../_pytest/capture.py:1000 + Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. + + The captured output is made available via ``capsys.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``text`` objects. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_output(capsys): + print("hello") + captured = capsys.readouterr() + assert captured.out == "hello\n" + + capteesys -- .../_pytest/capture.py:1028 + Enable simultaneous text capturing and pass-through of writes + to ``sys.stdout`` and ``sys.stderr`` as defined by ``--capture=``. + + + The captured output is made available via ``capteesys.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``text`` objects. + + The output is also passed-through, allowing it to be "live-printed", + reported, or both as defined by ``--capture=``. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_output(capsys): + print("hello") + captured = capteesys.readouterr() + assert captured.out == "hello\n" + + capsysbinary -- .../_pytest/capture.py:1063 Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` @@ -51,7 +92,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capsysbinary.readouterr() assert captured.out == b"hello\n" - capfd -- .../_pytest/capture.py:1052 + capfd -- .../_pytest/capture.py:1091 Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -69,7 +110,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfd.readouterr() assert captured.out == "hello\n" - capfdbinary -- .../_pytest/capture.py:1080 + capfdbinary -- .../_pytest/capture.py:1119 Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -87,25 +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" - capsys -- .../_pytest/capture.py:996 - Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. - - The captured output is made available via ``capsys.readouterr()`` method - calls, which return a ``(out, err)`` namedtuple. - ``out`` and ``err`` will be ``text`` objects. - - Returns an instance of :class:`CaptureFixture[str] `. - - Example: - - .. code-block:: python - - def test_output(capsys): - print("hello") - captured = capsys.readouterr() - assert captured.out == "hello\n" - - doctest_namespace [session scope] -- .../_pytest/doctest.py:741 + doctest_namespace [session scope] -- .../_pytest/doctest.py:740 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. @@ -119,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:1345 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1424 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -129,7 +152,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a if pytestconfig.get_verbosity() > 0: ... - record_property -- .../_pytest/junitxml.py:280 + record_property -- .../_pytest/junitxml.py:277 Add extra properties to the calling test. User properties become part of the test report and are available to the @@ -143,13 +166,13 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a def test_function(record_property): record_property("example_key", 1) - record_xml_attribute -- .../_pytest/junitxml.py:303 + record_xml_attribute -- .../_pytest/junitxml.py:300 Add extra xml attributes to the tag for the calling test. The fixture is callable with ``name, value``. The value is automatically XML-encoded. - record_testsuite_property [session scope] -- .../_pytest/junitxml.py:341 + record_testsuite_property [session scope] -- .../_pytest/junitxml.py:338 Record a new ```` tag as child of the root ````. This is suitable to writing global information regarding the entire test @@ -191,7 +214,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a .. _legacy_path: https://py.readthedocs.io/en/latest/path.html - caplog -- .../_pytest/logging.py:598 + caplog -- .../_pytest/logging.py:596 Access and control log capturing. Captured logs are available through the following properties/methods:: @@ -226,15 +249,15 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a To undo modifications done by the fixture in a contained scope, use :meth:`context() `. - recwarn -- .../_pytest/recwarn.py:35 + recwarn -- .../_pytest/recwarn.py:34 Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. See :ref:`warnings` for information on warning categories. - tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:241 + tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:240 Return a :class:`pytest.TempPathFactory` instance for the test session. - tmp_path -- .../_pytest/tmpdir.py:256 + tmp_path -- .../_pytest/tmpdir.py:255 Return a temporary directory (as :class:`pathlib.Path` object) which is unique to each test function invocation. The temporary directory is created as a subdirectory diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index c92cd7d4263..73073ffca1c 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -31,6 +31,427 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 8.4.0 (2025-06-02) +========================= + +Removals and backward incompatible breaking changes +--------------------------------------------------- + +- `#11372 `_: Async tests will now fail, instead of warning+skipping, if you don't have any suitable plugin installed. + + +- `#12346 `_: Tests will now fail, instead of raising a warning, if they return any value other than None. + + +- `#12874 `_: We dropped support for Python 3.8 following its end of life (2024-10-07). + + +- `#12960 `_: Test functions containing a yield now cause an explicit error. They have not been run since pytest 4.0, and were previously marked as an expected failure and deprecation warning. + + See :ref:`the docs ` for more information. + + + +Deprecations (removal in next major release) +-------------------------------------------- + +- `#10839 `_: Requesting an asynchronous fixture without a `pytest_fixture_setup` hook that resolves it will now give a DeprecationWarning. This most commonly happens if a sync test requests an async fixture. This should have no effect on a majority of users with async tests or fixtures using async pytest plugins, but may affect non-standard hook setups or ``autouse=True``. For guidance on how to work around this warning see :ref:`sync-test-async-fixture`. + + + +New features +------------ + +- `#11538 `_: Added :class:`pytest.RaisesGroup` as an equivalent to :func:`pytest.raises` for expecting :exc:`ExceptionGroup`. Also adds :class:`pytest.RaisesExc` which is now the logic behind :func:`pytest.raises` and used as parameter to :class:`pytest.RaisesGroup`. ``RaisesGroup`` includes the ability to specify multiple different expected exceptions, the structure of nested exception groups, and flags for emulating :ref:`except* `. See :ref:`assert-matching-exception-groups` and docstrings for more information. + + +- `#12081 `_: Added :fixture:`capteesys` to capture AND pass output to next handler set by ``--capture=``. + + +- `#12504 `_: :func:`pytest.mark.xfail` now accepts :class:`pytest.RaisesGroup` for the ``raises`` parameter when you expect an exception group. You can also pass a :class:`pytest.RaisesExc` if you e.g. want to make use of the ``check`` parameter. + + +- `#12713 `_: New `--force-short-summary` option to force condensed summary output regardless of verbosity level. + + This lets users still see condensed summary output of failures for quick reference in log files from job outputs, being especially useful if non-condensed output is very verbose. + + +- `#12749 `_: pytest traditionally collects classes/functions in the test module namespace even if they are imported from another file. + + For example: + + .. code-block:: python + + # contents of src/domain.py + class Testament: ... + + + # contents of tests/test_testament.py + from domain import Testament + + + def test_testament(): ... + + In this scenario with the default options, pytest will collect the class `Testament` from `tests/test_testament.py` because it starts with `Test`, even though in this case it is a production class being imported in the test module namespace. + + This behavior can now be prevented by setting the new :confval:`collect_imported_tests` configuration option to ``false``, which will make pytest collect classes/functions from test files **only** if they are defined in that file. + + -- by :user:`FreerGit` + + +- `#12765 `_: Thresholds to trigger snippet truncation can now be set with :confval:`truncation_limit_lines` and :confval:`truncation_limit_chars`. + + See :ref:`truncation-params` for more information. + + +- `#13125 `_: :confval:`console_output_style` now supports ``times`` to show execution time of each test. + + +- `#13192 `_: :func:`pytest.raises` will now raise a warning when passing an empty string to ``match``, as this will match against any value. Use ``match="^$"`` if you want to check that an exception has no message. + + +- `#13192 `_: :func:`pytest.raises` will now print a helpful string diff if matching fails and the match parameter has ``^`` and ``$`` and is otherwise escaped. + + +- `#13192 `_: You can now pass :func:`with pytest.raises(check=fn): `, where ``fn`` is a function which takes a raised exception and returns a boolean. The ``raises`` fails if no exception was raised (as usual), passes if an exception is raised and ``fn`` returns ``True`` (as well as ``match`` and the type matching, if specified, which are checked before), and propagates the exception if ``fn`` returns ``False`` (which likely also fails the test). + + +- `#13228 `_: :ref:`hidden-param` can now be used in ``id`` of :func:`pytest.param` or in + ``ids`` of :py:func:`Metafunc.parametrize `. + It hides the parameter set from the test name. + + +- `#13253 `_: New flag: :ref:`--disable-plugin-autoload ` which works as an alternative to :envvar:`PYTEST_DISABLE_PLUGIN_AUTOLOAD` when setting environment variables is inconvenient; and allows setting it in config files with :confval:`addopts`. + + + +Improvements in existing functionality +-------------------------------------- + +- `#10224 `_: pytest's ``short`` and ``long`` traceback styles (:ref:`how-to-modifying-python-tb-printing`) + now have partial :pep:`657` support and will show specific code segments in the + traceback. + + .. code-block:: pytest + + ================================= FAILURES ================================= + _______________________ test_gets_correct_tracebacks _______________________ + + test_tracebacks.py:12: in test_gets_correct_tracebacks + assert manhattan_distance(p1, p2) == 1 + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + test_tracebacks.py:6: in manhattan_distance + return abs(point_1.x - point_2.x) + abs(point_1.y - point_2.y) + ^^^^^^^^^ + E AttributeError: 'NoneType' object has no attribute 'x' + + -- by :user:`ammaraskar` + + +- `#11118 `_: Now :confval:`pythonpath` configures `$PYTHONPATH` earlier than before during the initialization process, which now also affects plugins loaded via the `-p` command-line option. + + -- by :user:`millerdev` + + +- `#11381 `_: The ``type`` parameter of the ``parser.addini`` method now accepts `"int"` and ``"float"`` parameters, facilitating the parsing of configuration values in the configuration file. + + Example: + + .. code-block:: python + + def pytest_addoption(parser): + parser.addini("int_value", type="int", default=2, help="my int value") + parser.addini("float_value", type="float", default=4.2, help="my float value") + + The `pytest.ini` file: + + .. code-block:: ini + + [pytest] + int_value = 3 + float_value = 5.4 + + +- `#11525 `_: Fixtures are now clearly represented in the output as a "fixture object", not as a normal function as before, making it easy for beginners to catch mistakes such as referencing a fixture declared in the same module but not requested in the test function. + + -- by :user:`the-compiler` and :user:`glyphack` + + +- `#12426 `_: A warning is now issued when :ref:`pytest.mark.usefixtures ref` is used without specifying any fixtures. Previously, empty usefixtures markers were silently ignored. + + +- `#12707 `_: Exception chains can be navigated when dropped into Pdb in Python 3.13+. + + +- `#12736 `_: Added a new attribute `name` with the fixed value `"pytest tests"` to the root tag `testsuites` of the junit-xml generated by pytest. + + This attribute is part of many junit-xml specifications and is even part of the `junit-10.xsd` specification that pytest's implementation is based on. + + +- `#12943 `_: If a test fails with an exceptiongroup with a single exception, the contained exception will now be displayed in the short test summary info. + + +- `#12958 `_: A number of :ref:`unraisable ` enhancements: + + * Set the unraisable hook as early as possible and unset it as late as possible, to collect the most possible number of unraisable exceptions. + * Call the garbage collector just before unsetting the unraisable hook, to collect any straggling exceptions. + * Collect multiple unraisable exceptions per test phase. + * Report the :mod:`tracemalloc` allocation traceback (if available). + * Avoid using a generator based hook to allow handling :class:`StopIteration` in test failures. + * Report the unraisable exception as the cause of the :class:`pytest.PytestUnraisableExceptionWarning` exception if raised. + * Compute the ``repr`` of the unraisable object in the unraisable hook so you get the latest information if available, and should help with resurrection of the object. + + +- `#13010 `_: :func:`pytest.approx` now can compare collections that contain numbers and non-numbers mixed. + + +- `#13016 `_: A number of :ref:`threadexception ` enhancements: + + * Set the excepthook as early as possible and unset it as late as possible, to collect the most possible number of unhandled exceptions from threads. + * Collect multiple thread exceptions per test phase. + * Report the :mod:`tracemalloc` allocation traceback (if available). + * Avoid using a generator based hook to allow handling :class:`StopIteration` in test failures. + * Report the thread exception as the cause of the :class:`pytest.PytestUnhandledThreadExceptionWarning` exception if raised. + * Extract the ``name`` of the thread object in the excepthook which should help with resurrection of the thread. + + +- `#13031 `_: An empty parameter set as in ``pytest.mark.parametrize([], ids=idfunc)`` will no longer trigger a call to ``idfunc`` with internal objects. + + +- `#13115 `_: Allows supplying ``ExceptionGroup[Exception]`` and ``BaseExceptionGroup[BaseException]`` to ``pytest.raises`` to keep full typing on :class:`ExceptionInfo `: + + .. code-block:: python + + with pytest.raises(ExceptionGroup[Exception]) as exc_info: + some_function() + + Parametrizing with other exception types remains an error - we do not check the types of child exceptions and thus do not permit code that might look like we do. + + +- `#13122 `_: The ``--stepwise`` mode received a number of improvements: + + * It no longer forgets the last failed test in case pytest is executed later without the flag. + + This enables the following workflow: + + 1. Execute pytest with ``--stepwise``, pytest then stops at the first failing test; + 2. Iteratively update the code and run the test in isolation, without the ``--stepwise`` flag (for example in an IDE), until it is fixed. + 3. Execute pytest with ``--stepwise`` again and pytest will continue from the previously failed test, and if it passes, continue on to the next tests. + + Previously, at step 3, pytest would start from the beginning, forgetting the previously failed test. + + This change however might cause issues if the ``--stepwise`` mode is used far apart in time, as the state might get stale, so the internal state will be reset automatically in case the test suite changes (for now only the number of tests are considered for this, we might change/improve this on the future). + + * New ``--stepwise-reset``/``--sw-reset`` flag, allowing the user to explicitly reset the stepwise state and restart the workflow from the beginning. + + +- `#13308 `_: Added official support for Python 3.14. + + +- `#13380 `_: Fix :class:`ExceptionGroup` traceback filtering to exclude pytest internals. + + +- `#13415 `_: The author metadata of the BibTex example is now correctly formatted with last names following first names. + An example of BibLaTex has been added. + BibTex and BibLaTex examples now clearly indicate that what is cited is software. + + -- by :user:`willynilly` + + +- `#13420 `_: Improved test collection performance by optimizing path resolution used in ``FSCollector``. + + +- `#13457 `_: The error message about duplicate parametrization no longer displays an internal stack trace. + + +- `#4112 `_: Using :ref:`pytest.mark.usefixtures ` on :func:`pytest.param` now produces an error instead of silently doing nothing. + + +- `#5473 `_: Replace `:` with `;` in the assertion rewrite warning message so it can be filtered using standard Python warning filters before calling :func:`pytest.main`. + + +- `#6985 `_: Improved :func:`pytest.approx` to enhance the readability of value ranges and tolerances between 0.001 and 1000. + * The `repr` method now provides clearer output for values within those ranges, making it easier to interpret the results. + * Previously, the output for those ranges of values and tolerances was displayed in scientific notation (e.g., `42 ± 1.0e+00`). The updated method now presents the tolerance as a decimal for better readability (e.g., `42 ± 1`). + + Example: + + **Previous Output:** + + .. code-block:: console + + >>> pytest.approx(42, abs=1) + 42 ± 1.0e+00 + + **Current Output:** + + .. code-block:: console + + >>> pytest.approx(42, abs=1) + 42 ± 1 + + -- by :user:`fazeelghafoor` + + +- `#7683 `_: The formerly optional ``pygments`` dependency is now required, causing output always to be source-highlighted (unless disabled via the ``--code-highlight=no`` CLI option). + + + +Bug fixes +--------- + +- `#10404 `_: Apply filterwarnings from config/cli as soon as possible, and revert them as late as possible + so that warnings as errors are collected throughout the pytest run and before the + unraisable and threadexcept hooks are removed. + + This allows very late warnings and unraisable/threadexcept exceptions to fail the test suite. + + This also changes the warning that the lsof plugin issues from PytestWarning to the new warning PytestFDWarning so it can be more easily filtered. + + +- `#11067 `_: The test report is now consistent regardless if the test xfailed via :ref:`pytest.mark.xfail ` or :func:`pytest.fail`. + + Previously, *xfailed* tests via the marker would have the string ``"reason: "`` prefixed to the message, while those *xfailed* via the function did not. The prefix has been removed. + + +- `#12008 `_: In :pr:`11220`, an unintended change in reordering was introduced by changing the way indices were assigned to direct params. More specifically, before that change, the indices of direct params to metafunc's callspecs were assigned after all parametrizations took place. Now, that change is reverted. + + +- `#12863 `_: Fix applying markers, including :ref:`pytest.mark.parametrize ` when placed above `@staticmethod` or `@classmethod`. + + +- `#12929 `_: Handle StopIteration from test cases, setup and teardown correctly. + + +- `#12938 `_: Fixed ``--durations-min`` argument not respected if ``-vv`` is used. + + +- `#12946 `_: Fixed missing help for :mod:`pdb` commands wrapped by pytest -- by :user:`adamchainz`. + + +- `#12981 `_: Prevent exceptions in :func:`pytest.Config.add_cleanup` callbacks preventing further cleanups. + + +- `#13047 `_: Restore :func:`pytest.approx` handling of equality checks between `bool` and `numpy.bool_` types. + + Comparing `bool` and `numpy.bool_` using :func:`pytest.approx` accidentally changed in version `8.3.4` and `8.3.5` to no longer match: + + .. code-block:: pycon + + >>> import numpy as np + >>> from pytest import approx + >>> [np.True_, np.True_] == pytest.approx([True, True]) + False + + This has now been fixed: + + .. code-block:: pycon + + >>> [np.True_, np.True_] == pytest.approx([True, True]) + True + + +- `#13119 `_: Improved handling of invalid regex patterns for filter warnings by providing a clear error message. + + +- `#13175 `_: The diff is now also highlighted correctly when comparing two strings. + + +- `#13248 `_: Fixed an issue where passing a ``scope`` in :py:func:`Metafunc.parametrize ` with ``indirect=True`` + could result in other fixtures being unable to depend on the parametrized fixture. + + +- `#13291 `_: Fixed ``repr`` of ``attrs`` objects in assertion failure messages when using ``attrs>=25.2``. + + +- `#13312 `_: Fixed a possible ``KeyError`` crash on PyPy during collection of tests involving higher-scoped parameters. + + +- `#13345 `_: Fix type hints for :attr:`pytest.TestReport.when` and :attr:`pytest.TestReport.location`. + + +- `#13377 `_: Fixed handling of test methods with positional-only parameter syntax. + + Now, methods are supported that formally define ``self`` as positional-only + and/or fixture parameters as keyword-only, e.g.: + + .. code-block:: python + + class TestClass: + + def test_method(self, /, *, fixture): ... + + Before, this caused an internal error in pytest. + + +- `#13384 `_: Fixed an issue where pytest could report negative durations. + + +- `#13420 `_: Added ``lru_cache`` to ``nodes._check_initialpaths_for_relpath``. + + +- `#9037 `_: Honor :confval:`disable_test_id_escaping_and_forfeit_all_rights_to_community_support` when escaping ids in parametrized tests. + + + +Improved documentation +---------------------- + +- `#12535 `_: `This + example` + showed ``print`` statements that do not exactly reflect what the + different branches actually do. The fix makes the example more precise. + + +- `#13218 `_: Pointed out in the :func:`pytest.approx` documentation that it considers booleans unequal to numeric zero or one. + + +- `#13221 `_: Improved grouping of CLI options in the ``--help`` output. + + +- `#6649 `_: Added :class:`~pytest.TerminalReporter` to the :ref:`api-reference` documentation page. + + +- `#8612 `_: Add a recipe for handling abstract test classes in the documentation. + + A new example has been added to the documentation to demonstrate how to use a mixin class to handle abstract + test classes without manually setting the ``__test__`` attribute for subclasses. + This ensures that subclasses of abstract test classes are automatically collected by pytest. + + + +Packaging updates and notes for downstreams +------------------------------------------- + +- `#13317 `_: Specified minimum allowed versions of ``colorama``, ``iniconfig``, + and ``packaging``; and bumped the minimum allowed version + of ``exceptiongroup`` for ``python_version<'3.11'`` from a release + candidate to a full release. + + + +Contributor-facing changes +-------------------------- + +- `#12017 `_: Mixed internal improvements: + + * Migrate formatting to f-strings in some tests. + * Use type-safe constructs in JUnitXML tests. + * Moved`` MockTiming`` into ``_pytest.timing``. + + -- by :user:`RonnyPfannschmidt` + + +- `#12647 `_: Fixed running the test suite with the ``hypothesis`` pytest plugin. + + + +Miscellaneous internal changes +------------------------------ + +- `#6649 `_: Added :class:`~pytest.TerminalReporter` to the public pytest API, as it is part of the signature of the :hook:`pytest_terminal_summary` hook. + + pytest 8.3.5 (2025-03-02) ========================= diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 69e715c9db1..c3848db5112 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 - + diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 6a3b143d580..760140390cb 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -152,7 +152,7 @@ The test collection would look like this: configfile: pytest.ini collected 2 items - + @@ -215,7 +215,7 @@ You can always peek at the collection tree without running tests like this: configfile: pytest.ini collected 3 items - + diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index 5e48815bbc9..8040ee9b957 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -384,6 +384,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: i = Foo() > assert i.b == 2 + ^^^ failure_demo.py:148: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ @@ -446,6 +447,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: def test_tupleerror(self): > a, b = [1] # noqa: F841 + ^^^^ E ValueError: not enough values to unpack (expected 2, got 1) failure_demo.py:177: ValueError @@ -457,6 +459,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: items = [1, 2, 3] print(f"items is {items!r}") > a, b = items.pop() + ^^^^ E TypeError: cannot unpack non-iterable int object failure_demo.py:182: TypeError @@ -468,6 +471,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: def test_some_error(self): > if namenotexi: # noqa: F821 + ^^^^^^^^^^ E NameError: name 'namenotexi' is not defined failure_demo.py:185: NameError @@ -526,6 +530,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: def test_z1_unpack_error(self): items = [] > a, b = items + ^^^^ E ValueError: not enough values to unpack (expected 2, got 0) failure_demo.py:219: ValueError @@ -536,6 +541,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: def test_z2_type_error(self): items = 3 > a, b = items + ^^^^ E TypeError: cannot unpack non-iterable int object failure_demo.py:223: TypeError @@ -568,12 +574,12 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + where False = ('456') E + where = '123'.startswith E + where '123' = .f at 0xdeadbeef0029>() - E + and '456' = .g at 0xdeadbeef0003>() + E + and '456' = .g at 0xdeadbeef002a>() failure_demo.py:237: AssertionError _____________________ TestMoreErrors.test_global_func ______________________ - self = + self = def test_global_func(self): > assert isinstance(globf(42), float) @@ -584,18 +590,18 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:240: AssertionError _______________________ TestMoreErrors.test_instance _______________________ - self = + self = def test_instance(self): self.x = 6 * 7 > assert self.x != 42 E assert 42 != 42 - E + where 42 = .x + E + where 42 = .x failure_demo.py:244: AssertionError _______________________ TestMoreErrors.test_compare ________________________ - self = + self = def test_compare(self): > assert globf(10) < 5 @@ -605,7 +611,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:247: AssertionError _____________________ TestMoreErrors.test_try_finally ______________________ - self = + self = def test_try_finally(self): x = 1 @@ -616,7 +622,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:252: AssertionError ___________________ TestCustomAssertMsg.test_single_line ___________________ - self = + self = def test_single_line(self): class A: @@ -631,16 +637,16 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:263: AssertionError ____________________ TestCustomAssertMsg.test_multiline ____________________ - self = + self = def test_multiline(self): class A: a = 1 b = 2 - > assert ( - A.a == b - ), "A.a appears not to be b\nor does not appear to be b\none of those" + > assert A.a == b, ( + "A.a appears not to be b\nor does not appear to be b\none of those" + ) E AssertionError: A.a appears not to be b E or does not appear to be b E one of those @@ -650,7 +656,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:270: AssertionError ___________________ TestCustomAssertMsg.test_custom_repr ___________________ - self = + self = def test_custom_repr(self): class JSON: diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 69d973e51d0..c1a444bea18 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -104,6 +104,7 @@ Let's run this without supplying our new option: elif cmdopt == "type2": print("second") > assert 0 # to see what was printed + ^^^^^^^^ E assert 0 test_sample.py:6: AssertionError @@ -130,6 +131,7 @@ And now with supplying a command line option: elif cmdopt == "type2": print("second") > assert 0 # to see what was printed + ^^^^^^^^ E assert 0 test_sample.py:6: AssertionError @@ -646,7 +648,7 @@ If we run this: test_step.py:11: AssertionError ========================= short test summary info ========================== - XFAIL test_step.py::TestUserHandling::test_deletion - reason: previous test failed (test_modification) + XFAIL test_step.py::TestUserHandling::test_deletion - previous test failed (test_modification) ================== 1 failed, 2 passed, 1 xfailed in 0.12s ================== We'll see that ``test_deletion`` was not executed because ``test_modification`` @@ -725,7 +727,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, 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, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory > use 'pytest --fixtures [testpath]' for help on them. /home/sweet/project/b/test_error.py:1 @@ -736,6 +738,7 @@ We can run this: def test_a1(db): > assert 0, db # to show value + ^^^^^^^^^^^^ E AssertionError: E assert 0 @@ -746,6 +749,7 @@ We can run this: def test_a2(db): > assert 0, db # to show value + ^^^^^^^^^^^^ E AssertionError: E assert 0 @@ -946,7 +950,7 @@ and run it: rootdir: /home/sweet/project collected 3 items - test_module.py Esetting up a test failed or skipped test_module.py::test_setup_fails + test_module.py Esetting up a test failed test_module.py::test_setup_fails Fexecuting test failed or skipped test_module.py::test_call_fails F diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 41469de3864..c92e97f556e 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 8.3.5 + pytest 8.4.0 .. _`simpletest`: diff --git a/doc/en/how-to/cache.rst b/doc/en/how-to/cache.rst index a3b2a862534..e3209b79359 100644 --- a/doc/en/how-to/cache.rst +++ b/doc/en/how-to/cache.rst @@ -289,8 +289,6 @@ You can always peek at the content of the cache using the {'test_caching.py::test_function': True} cache/nodeids contains: ['test_caching.py::test_function'] - cache/stepwise contains: - [] example/value contains: 42 diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 4b1de6f3704..a9bd894b6fd 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -66,6 +66,7 @@ as an error: def test_one(): > assert api_v1() == 1 + ^^^^^^^^ test_show_warnings.py:10: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 8f84e4867a6..a86fd1065fd 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -449,6 +449,7 @@ marked ``smtp_connection`` fixture function. Running the test looks like this: assert response == 250 assert b"smtp.gmail.com" in msg > assert 0 # for demo purposes + ^^^^^^^^ E assert 0 test_module.py:7: AssertionError @@ -460,6 +461,7 @@ marked ``smtp_connection`` fixture function. Running the test looks like this: response, msg = smtp_connection.noop() assert response == 250 > assert 0 # for demo purposes + ^^^^^^^^ E assert 0 test_module.py:13: AssertionError @@ -1308,6 +1310,7 @@ So let's just do another run: assert response == 250 assert b"smtp.gmail.com" in msg > assert 0 # for demo purposes + ^^^^^^^^ E assert 0 test_module.py:7: AssertionError @@ -1319,6 +1322,7 @@ So let's just do another run: response, msg = smtp_connection.noop() assert response == 250 > assert 0 # for demo purposes + ^^^^^^^^ E assert 0 test_module.py:13: AssertionError @@ -1343,6 +1347,7 @@ So let's just do another run: response, msg = smtp_connection.noop() assert response == 250 > assert 0 # for demo purposes + ^^^^^^^^ E assert 0 test_module.py:13: AssertionError @@ -1418,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/output.rst b/doc/en/how-to/output.rst index cb9276c7ea0..bc98b816484 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -447,7 +447,7 @@ Example: ================================= XPASSES ================================== ========================= short test summary info ========================== SKIPPED [1] test_example.py:22: skipping this test - XFAIL test_example.py::test_xfail - reason: xfailing this test + XFAIL test_example.py::test_xfail - xfailing this test XPASS test_example.py::test_xpass - always xfail ERROR test_example.py::test_error - assert 0 FAILED test_example.py::test_fail - assert 0 diff --git a/doc/en/how-to/parametrize.rst b/doc/en/how-to/parametrize.rst index 5a16684eb96..d7c12c1a1f4 100644 --- a/doc/en/how-to/parametrize.rst +++ b/doc/en/how-to/parametrize.rst @@ -281,7 +281,7 @@ list: $ pytest -q -rs test_strings.py s [100%] ========================= short test summary info ========================== - SKIPPED [1] test_strings.py: got empty parameter set ['stringinput'], function test_valid_string at /home/sweet/project/test_strings.py:2 + SKIPPED [1] test_strings.py: got empty parameter set for (stringinput) 1 skipped in 0.12s Note that when calling ``metafunc.parametrize`` multiple times with different parameter sets, all parameter names across diff --git a/doc/en/how-to/unittest.rst b/doc/en/how-to/unittest.rst index 62e32b6d28f..ba98b366d04 100644 --- a/doc/en/how-to/unittest.rst +++ b/doc/en/how-to/unittest.rst @@ -154,6 +154,7 @@ the ``self.db`` values in the traceback: def test_method1(self): assert hasattr(self, "db") > assert 0, self.db # fail for demo purposes + ^^^^^^^^^^^^^^^^^ E AssertionError: .DummyDB object at 0xdeadbeef0001> E assert 0 @@ -164,6 +165,7 @@ the ``self.db`` values in the traceback: def test_method2(self): > assert 0, self.db # fail for demo purposes + ^^^^^^^^^^^^^^^^^ E AssertionError: .DummyDB object at 0xdeadbeef0001> E assert 0 diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index d3dd14a8681..b0535ef6589 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -2093,6 +2093,12 @@ All the command-line flags can be obtained by running ``pytest --help``:: example: -m 'mark1 and not mark2'. --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 --fixtures, --funcargs Show available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v') @@ -2131,15 +2137,21 @@ All the command-line flags can be obtained by running ``pytest --help``:: --sw-skip, --stepwise-skip Ignore the first failing test but stop on the next failing test. Implicitly enables --stepwise. + --sw-reset, --stepwise-reset + Resets stepwise state, restarting the stepwise + workflow. Implicitly enables --stepwise. Reporting: --durations=N Show N slowest setup/test durations (N=0 for all) --durations-min=N Minimal duration in seconds for inclusion in slowest - list. Default: 0.005. + list. Default: 0.005 (or 0.0 if -vv is given). -v, --verbose Increase verbosity --no-header Disable header --no-summary Disable summary --no-fold-skipped Do not fold skipped tests in short summary. + --force-short-summary + Force condensed summary output regardless of + verbosity level. -q, --quiet Decrease verbosity --verbosity=VERBOSE Set verbosity. Default: 0. -r chars Show extra test summary info as specified by chars: @@ -2174,22 +2186,6 @@ All the command-line flags can be obtained by running ``pytest --help``:: -W, --pythonwarnings PYTHONWARNINGS Set which warnings to report, see -W option of Python itself - --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 - -c, --config-file FILE - Load configuration from `FILE` instead of trying to - locate one of the implicit configuration files. - --continue-on-collection-errors - Force test execution even if collection errors occur - --rootdir=ROOTDIR Define root directory for tests. Can be relative - path: 'root_dir', './root_dir', - 'root_dir/another_dir/'; absolute path: - '/home/user/root_dir'; path with variables: - '$HOME/root_dir'. collection: --collect-only, --co Only collect tests, don't execute them @@ -2205,6 +2201,8 @@ All the command-line flags can be obtained by running ``pytest --help``:: --keep-duplicates Keep duplicate tests --collect-in-virtualenv Don't ignore tests in a local virtualenv directory + --continue-on-collection-errors + Force test execution even if collection errors occur --import-mode={prepend,append,importlib} Prepend/append to sys.path when importing test modules and conftest files. Default: prepend. @@ -2220,6 +2218,14 @@ All the command-line flags can be obtained by running ``pytest --help``:: failure test session debugging and configuration: + -c, --config-file FILE + Load configuration from `FILE` instead of trying to + locate one of the implicit configuration files. + --rootdir=ROOTDIR Define root directory for tests. Can be relative + path: 'root_dir', './root_dir', + 'root_dir/another_dir/'; absolute path: + '/home/user/root_dir'; path with variables: + '$HOME/root_dir'. --basetemp=dir Base temporary directory for this test run. (Warning: this directory is removed if it exists.) -V, --version Display pytest version and information about @@ -2228,7 +2234,13 @@ All the command-line flags can be obtained by running ``pytest --help``:: -h, --help Show help message and configuration info -p name Early-load given plugin module name or entry point (multi-allowed). To avoid loading of plugins, use - the `no:` prefix, e.g. `no:doctest`. + the `no:` prefix, e.g. `no:doctest`. See also + --disable-plugin-autoload. + --disable-plugin-autoload + Disable plugin auto-loading through entry point + packaging metadata. Only plugins explicitly + specified in -p or env var PYTEST_PLUGINS will be + loaded. --trace-config Trace considerations of conftest.py files --debug=[DEBUG_FILE_NAME] Store internal tracing debug information in this log @@ -2283,13 +2295,16 @@ All the command-line flags can be obtained by running ``pytest --help``:: markers (linelist): Register new markers for test functions empty_parameter_set_mark (string): Default marker for empty parametersets - norecursedirs (args): Directory patterns to avoid for recursion - testpaths (args): Directories to search for tests when no files or - directories are given on the command line filterwarnings (linelist): Each line specifies a pattern for warnings.filterwarnings. Processed after -W/--pythonwarnings. + norecursedirs (args): Directory patterns to avoid for recursion + testpaths (args): Directories to search for tests when no files or + directories are given on the command line + collect_imported_tests (bool): + Whether to collect tests in imported modules outside + `testpaths` consider_namespace_packages (bool): Consider namespace packages when resolving module names during import @@ -2329,6 +2344,12 @@ All the command-line flags can be obtained by running ``pytest --help``:: enable_assertion_pass_hook (bool): Enables the pytest_assertion_pass hook. Make sure to delete any previously generated pyc cache files. + truncation_limit_lines (string): + Set threshold of LINES after which truncation will + take effect + truncation_limit_chars (string): + Set threshold of CHARS after which truncation will + take effect verbosity_assertions (string): Specify a verbosity level for assertions, overriding the main level. Higher levels will provide more @@ -2373,12 +2394,12 @@ All the command-line flags can be obtained by running ``pytest --help``:: Default value for --log-file-date-format log_auto_indent (string): Default value for --log-auto-indent - pythonpath (paths): Add paths to sys.path faulthandler_timeout (string): Dump the traceback of all threads if a test takes more than TIMEOUT seconds to finish addopts (args): Extra command line options minversion (string): Minimally required pytest version + pythonpath (paths): Add paths to sys.path required_plugins (args): Plugins that must be present for pytest to run From 80dfa2db8e6157bf706c2f2656ba0fd7bc13195a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 2 Jun 2025 22:02:23 +0300 Subject: [PATCH 003/270] RELEASING: remove pytest mailing list (#13472) It is no longer. --- RELEASING.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/RELEASING.rst b/RELEASING.rst index 0ca63ee4fbf..76c41d83a58 100644 --- a/RELEASING.rst +++ b/RELEASING.rst @@ -168,7 +168,6 @@ Both automatic and manual processes described above follow the same steps from t To the following mailing lists: - * pytest-dev@python.org (all releases) * python-announce-list@python.org (all releases) * testing-in-python@lists.idyll.org (only major/minor releases) From 592c27ca4bf1db4abe62bf86be422a143aad0984 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 2 Jun 2025 22:42:43 +0300 Subject: [PATCH 004/270] RELEASING: remove testing-in-python mailing list Seems no longer active (possibly dead). --- RELEASING.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RELEASING.rst b/RELEASING.rst index 76c41d83a58..57e1e176a80 100644 --- a/RELEASING.rst +++ b/RELEASING.rst @@ -168,8 +168,7 @@ Both automatic and manual processes described above follow the same steps from t To the following mailing lists: - * python-announce-list@python.org (all releases) - * testing-in-python@lists.idyll.org (only major/minor releases) + * python-announce-list@python.org And announce it with the ``#pytest`` hashtag on: From 32d85d0dde3d2569ca2c20f5b71edae60e539c4f Mon Sep 17 00:00:00 2001 From: Hossein Date: Tue, 3 Jun 2025 16:13:08 +0330 Subject: [PATCH 005/270] Fixed typo in docs regarding capteesys --- doc/en/builtin.rst | 2 +- src/_pytest/capture.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index b129d0a763f..31c2fa9df06 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -69,7 +69,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a .. code-block:: python - def test_output(capsys): + def test_output(capteesys): print("hello") captured = capteesys.readouterr() assert captured.out == "hello\n" diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 3812d88176a..6d98676be5f 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -1043,7 +1043,7 @@ def capteesys(request: SubRequest) -> Generator[CaptureFixture[str]]: .. code-block:: python - def test_output(capsys): + def test_output(capteesys): print("hello") captured = capteesys.readouterr() assert captured.out == "hello\n" From 01de0c1e4c2b6bd89e6b7e437f9e553ca4f880d2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 21:59:34 +0300 Subject: [PATCH 006/270] [pre-commit.ci] pre-commit autoupdate (#13475) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.11 → v0.11.12](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.11...v0.11.12) - [github.com/woodruffw/zizmor-pre-commit: v1.8.0 → v1.9.0](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.8.0...v1.9.0) - [github.com/pre-commit/mirrors-mypy: v1.15.0 → v1.16.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.15.0...v1.16.0) * Fix new mypy errors --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ran Benita --- .pre-commit-config.yaml | 6 +++--- src/_pytest/assertion/rewrite.py | 1 - src/_pytest/config/__init__.py | 10 +++++----- src/_pytest/fixtures.py | 11 ++++++----- src/_pytest/python_api.py | 3 +-- src/_pytest/recwarn.py | 6 ++++-- testing/test_collection.py | 2 +- testing/test_junitxml.py | 18 +++++++++++------- 8 files changed, 31 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 149f7e6af59..bd43937f8a0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.11" + rev: "v0.11.12" hooks: - id: ruff args: ["--fix"] @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.8.0 + rev: v1.9.0 hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs @@ -32,7 +32,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.15.0 + rev: v1.16.0 hooks: - id: mypy files: ^(src/|testing/|scripts/) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index c4782c7c5a8..b07f8b24b57 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -702,7 +702,6 @@ def run(self, mod: ast.Module) -> None: if doc is not None and self.is_rewrite_disabled(doc): return pos = 0 - item = None for item in mod.body: if ( expect_docstring diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 468018fadc0..0248f046407 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -284,7 +284,7 @@ def get_config( args: list[str] | None = None, plugins: Sequence[str | _PluggyPlugin] | None = None, ) -> Config: - # subsequent calls to main will create a fresh instance + # Subsequent calls to main will create a fresh instance. pluginmanager = PytestPluginManager() config = Config( pluginmanager, @@ -330,8 +330,8 @@ def _prepareconfig( ) raise TypeError(msg.format(args, type(args))) - config = get_config(args, plugins) - pluginmanager = config.pluginmanager + initial_config = get_config(args, plugins) + pluginmanager = initial_config.pluginmanager try: if plugins: for plugin in plugins: @@ -339,12 +339,12 @@ def _prepareconfig( pluginmanager.consider_pluginarg(plugin) else: pluginmanager.register(plugin) - config = pluginmanager.hook.pytest_cmdline_parse( + config: Config = pluginmanager.hook.pytest_cmdline_parse( pluginmanager=pluginmanager, args=args ) return config except BaseException: - config._ensure_unconfigure() + initial_config._ensure_unconfigure() raise diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 92a301e79db..9966e3414c8 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1106,8 +1106,7 @@ def execute(self, request: SubRequest) -> FixtureValue: exc, exc_tb = self.cached_result[2] raise exc.with_traceback(exc_tb) else: - result = self.cached_result[0] - return result + return self.cached_result[0] # We have a previous but differently parametrized fixture instance # so we need to tear it down before creating a new one. self.finish(request) @@ -1123,10 +1122,12 @@ def execute(self, request: SubRequest) -> FixtureValue: ihook = request.node.ihook try: # Setup the fixture, run the code in it, and cache the value - # in self.cached_result - result = ihook.pytest_fixture_setup(fixturedef=self, request=request) + # in self.cached_result. + result: FixtureValue = ihook.pytest_fixture_setup( + fixturedef=self, request=request + ) finally: - # schedule our finalizer, even if the setup failed + # Schedule our finalizer, even if the setup failed. request.node.addfinalizer(finalizer) return result diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 77b0edc0ac5..07794abea95 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -474,8 +474,7 @@ def is_bool(val: Any) -> bool: result: bool = abs(self.expected - actual) <= self.tolerance return result - # Ignore type because of https://github.com/python/mypy/issues/4266. - __hash__ = None # type: ignore + __hash__ = None @property def tolerance(self): diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 440e3efac8a..e3db717bfe4 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -167,7 +167,7 @@ def warns( return func(*args[1:], **kwargs) -class WarningsRecorder(warnings.catch_warnings): # type:ignore[type-arg] +class WarningsRecorder(warnings.catch_warnings): """A context manager to record raised warnings. Each recorded warning is an instance of :class:`warnings.WarningMessage`. @@ -226,7 +226,9 @@ def clear(self) -> None: """Clear the list of recorded warnings.""" self._list[:] = [] - def __enter__(self) -> Self: + # Type ignored because we basically want the `catch_warnings` generic type + # parameter to be ourselves but that is not possible(?). + def __enter__(self) -> Self: # type: ignore[override] if self._entered: __tracebackhide__ = True raise RuntimeError(f"Cannot enter {self!r} twice") diff --git a/testing/test_collection.py b/testing/test_collection.py index ccd57eeef43..dfe10a65220 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1615,7 +1615,7 @@ def __init__(self, name, parent, x): self.x = x @classmethod - def from_parent(cls, parent, *, name, x): + def from_parent(cls, parent, *, name, x): # type: ignore[override] return super().from_parent(parent=parent, name=name, x=x) collector = MyCollector.from_parent(parent=request.session, name="foo", x=10) diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 504e4969039..4b634a98d85 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -76,11 +76,11 @@ def nodeval(node: minidom.Element, name: str) -> str | None: class DomDocument: - def __init__(self, dom: minidom.Document): - self._node = dom - _node: minidom.Document | minidom.Element + def __init__(self, dom: minidom.Document) -> None: + self._node = dom + def find_first_by_tag(self, tag: str) -> DomNode | None: return self.find_nth_by_tag(tag, 0) @@ -105,7 +105,9 @@ def find_by_tag(self, tag: str) -> list[DomNode]: @property def children(self) -> list[DomNode]: - return [DomNode(x) for x in self._node.childNodes] + return [ + DomNode(x) for x in self._node.childNodes if isinstance(x, minidom.Element) + ] @property def get_unique_child(self) -> DomNode: @@ -120,7 +122,7 @@ def toxml(self) -> str: class DomNode(DomDocument): _node: minidom.Element - def __init__(self, dom: minidom.Element): + def __init__(self, dom: minidom.Element) -> None: self._node = dom def __repr__(self) -> str: @@ -129,7 +131,7 @@ def __repr__(self) -> str: def __getitem__(self, key: str) -> str: node = self._node.getAttributeNode(key) if node is not None: - return cast(str, node.value) + return node.value else: raise KeyError(key) @@ -139,7 +141,9 @@ def assert_attr(self, **kwargs: object) -> None: @property def text(self) -> str: - return cast(str, self._node.childNodes[0].wholeText) + text = self._node.childNodes[0] + assert isinstance(text, minidom.Text) + return text.wholeText @property def tag(self) -> str: From 3e30eae05fcf37880db1db842d022d873cb2166d Mon Sep 17 00:00:00 2001 From: James Addison <55152140+jayaddison@users.noreply.github.com> Date: Wed, 4 Jun 2025 15:37:54 +0000 Subject: [PATCH 007/270] pyproject.toml: remove unused ignore-list entry (#13490) The term `socio-economic` does not appear to be autocorrected by recent versions of `codespell`. The term appears in the project's Code of Conduct, and in the configured list of ignored-corrections; I believe we can remove it from the ignored word list. Tested with version 2.4.1 of `codespell` (and via `pre-commit`). --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1e9665add02..272be0a1582 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -339,7 +339,7 @@ disable = [ ] [tool.codespell] -ignore-words-list = "afile,asend,asser,assertio,feld,hove,ned,noes,notin,paramete,parth,socio-economic,tesults,varius,wil" +ignore-words-list = "afile,asend,asser,assertio,feld,hove,ned,noes,notin,paramete,parth,tesults,varius,wil" skip = "AUTHORS,*/plugin_list.rst" write-changes = true From 216c7ec882b2aa30fb8a35e100c990c34fca12c1 Mon Sep 17 00:00:00 2001 From: Iwithyou2025 Date: Fri, 6 Jun 2025 20:57:40 +0800 Subject: [PATCH 008/270] Remove outdated warning about faulthandler_timeout on Windows (#13492) --------- Co-authored-by: Bruno Oliveira --- changelog/13492.doc.rst | 1 + doc/en/how-to/failures.rst | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/13492.doc.rst diff --git a/changelog/13492.doc.rst b/changelog/13492.doc.rst new file mode 100644 index 00000000000..6e3f72a860e --- /dev/null +++ b/changelog/13492.doc.rst @@ -0,0 +1 @@ +Fixed outdated warning about ``faulthandler`` not working on Windows. diff --git a/doc/en/how-to/failures.rst b/doc/en/how-to/failures.rst index b3d0c155b48..0c45cd7b118 100644 --- a/doc/en/how-to/failures.rst +++ b/doc/en/how-to/failures.rst @@ -112,7 +112,7 @@ on the command-line. Also the :confval:`faulthandler_timeout=X` configuration option can be used to dump the traceback of all threads if a test takes longer than ``X`` -seconds to finish (not available on Windows). +seconds to finish. .. note:: From 9e9633de9da7a9fab03b4bba3a326bf85b412050 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 09:00:54 -0300 Subject: [PATCH 009/270] [automated] Update plugin list (#13499) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 152 +++++++++++++++++++------------ 1 file changed, 92 insertions(+), 60 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index d0bf2083fe3..94c276272eb 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =7.1.1,<8.0.0) + :pypi:`pytest-api-framework` pytest framework Jun 07, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -99,6 +100,7 @@ This list contains 1641 plugins. :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Feb 05, 2024 5 - Production/Stable pytest :pypi:`pytest-archon` Rule your architecture like a real developer Dec 18, 2023 5 - Production/Stable pytest >=7.2 :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) + :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Jun 03, 2025 4 - Beta pytest>=3.0; extra == "dev" :pypi:`pytest-argus-server` A plugin that provides a running Argus API server for tests Mar 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Nov 27, 2023 4 - Beta pytest >=4.6 :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) @@ -163,7 +165,7 @@ This list contains 1641 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests May 30, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 05, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -283,7 +285,7 @@ This list contains 1641 plugins. :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks May 27, 2025 5 - Production/Stable pytest>=3.8 + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Jun 06, 2025 5 - Production/Stable pytest>=3.8 :pypi:`pytest-collect-appoint-info` set your encoding Aug 03, 2023 N/A pytest :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A @@ -341,11 +343,11 @@ This list contains 1641 plugins. :pypi:`pytest-cython-collect` Jun 17, 2022 N/A pytest :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Feb 25, 2024 N/A pytest <7,>=6.0.1 :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A - :pypi:`pytest-dashboard` May 20, 2025 N/A pytest<8.0.0,>=7.4.3 + :pypi:`pytest-dashboard` Jun 02, 2025 N/A pytest<8.0.0,>=7.4.3 :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A :pypi:`pytest-databases` Reusable database fixtures for any and all databases. May 25, 2025 4 - Beta pytest :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest - :pypi:`pytest-datadir` pytest plugin for test data directories and files May 30, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-datadir` pytest plugin for test data directories and files Jun 06, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Apr 06, 2023 5 - Production/Stable pytest (>=7.1) :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest :pypi:`pytest-datadir-nng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Nov 09, 2022 5 - Production/Stable pytest (>=7.0.0,<8.0.0) @@ -384,7 +386,7 @@ This list contains 1641 plugins. :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest :pypi:`pytest-deselect-if` A plugin to deselect pytests tests rather than using skipif Dec 26, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-devpi-server` DevPI server fixture for py.test Oct 17, 2024 5 - Production/Stable pytest - :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design May 10, 2025 N/A pytest + :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Jun 05, 2025 N/A pytest :pypi:`pytest-dhos` Common fixtures for pytest in DHOS services and libraries Sep 07, 2022 N/A N/A :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest @@ -403,7 +405,7 @@ This list contains 1641 plugins. :pypi:`pytest-ditto-pyarrow` pytest-ditto plugin for pyarrow tables. Jun 09, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-django` A Django plugin for pytest. Apr 03, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. May 19, 2023 4 - Beta pytest + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Jun 06, 2025 5 - Production/Stable pytest :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A :pypi:`pytest-django-class` A pytest plugin for running django in class-scoped fixtures Aug 08, 2023 4 - Beta N/A @@ -466,7 +468,8 @@ This list contains 1641 plugins. :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 - :pypi:`pytest-dsl` A DSL testing framework based on pytest May 29, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl` A DSL testing framework based on pytest Jun 07, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jun 06, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A @@ -484,7 +487,6 @@ This list contains 1641 plugins. :pypi:`pytest-ekstazi` Pytest plugin to select test using Ekstazi algorithm Sep 10, 2022 N/A pytest :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Dec 03, 2024 5 - Production/Stable pytest>=7.0 :pypi:`pytest-elasticsearch-test` Elasticsearch fixtures and fixture factories for Pytest. Apr 20, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-elbase` Elbase pytest plugin Apr 15, 2025 N/A N/A :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 @@ -529,7 +531,7 @@ This list contains 1641 plugins. :pypi:`pytest_evm` The testing package containing tools to test Web3-based projects Sep 23, 2024 4 - Beta pytest<9.0.0,>=8.1.1 :pypi:`pytest_exact_fixtures` Parse queries in Lucene and Elasticsearch syntaxes Feb 04, 2019 N/A N/A :pypi:`pytest-examples` Pytest plugin for testing examples in docstrings and markdown files. May 06, 2025 N/A pytest>=7 - :pypi:`pytest-exasol-backend` Feb 11, 2025 N/A pytest<9,>=7 + :pypi:`pytest-exasol-backend` Jun 06, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-extension` Feb 11, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-itde` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-saas` Nov 22, 2024 N/A pytest<9,>=7 @@ -590,7 +592,7 @@ This list contains 1641 plugins. :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Mar 16, 2024 4 - Beta pytest >=4.3.0 :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` Feb 28, 2025 N/A N/A - :pypi:`pytest-fixturecheck` A pytest plugin to check fixture validity before test execution May 17, 2025 3 - Alpha pytest>=6.0.0 + :pypi:`pytest-fixturecheck` A pytest plugin to check fixture validity before test execution Jun 02, 2025 3 - Alpha pytest>=6.0.0 :pypi:`pytest-fixture-classes` Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers Sep 02, 2023 5 - Production/Stable pytest :pypi:`pytest-fixturecollection` A pytest plugin to collect tests based on fixtures being used by tests Feb 22, 2024 4 - Beta pytest >=3.5.0 :pypi:`pytest-fixture-config` Fixture configuration utils for py.test Oct 17, 2024 5 - Production/Stable pytest @@ -618,7 +620,7 @@ This list contains 1641 plugins. :pypi:`pytest-flexreport` Apr 15, 2023 4 - Beta pytest :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Aug 14, 2024 4 - Beta pytest>=7.0.0 :pypi:`pytest-fluentbit` A pytest plugin in order to provide logs via fluentbit Jun 16, 2023 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-fly` pytest runner and observer May 19, 2025 3 - Alpha pytest + :pypi:`pytest-fly` pytest runner and observer Jun 07, 2025 3 - Alpha pytest :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-forbid` Mar 07, 2023 N/A pytest (>=7.2.2,<8.0.0) @@ -627,7 +629,7 @@ This list contains 1641 plugins. :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A :pypi:`pytest-frappe` Pytest Frappe Plugin - A set of pytest fixtures to test Frappe applications Jul 30, 2024 4 - Beta pytest>=7.0.0 :pypi:`pytest-freethreaded` pytest plugin for running parallel tests Oct 03, 2024 5 - Production/Stable pytest - :pypi:`pytest-freezeblaster` Wrap tests with fixtures in freeze_time Feb 11, 2025 N/A pytest>=6.2.5 + :pypi:`pytest-freezeblaster` Wrap tests with fixtures in freeze_time Jun 02, 2025 N/A pytest>=6.2.5 :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-freezer` Pytest plugin providing a fixture interface for spulec/freezegun Dec 12, 2024 N/A pytest>=3.6 :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A @@ -635,7 +637,7 @@ This list contains 1641 plugins. :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) :pypi:`pytest-funcnodes` Testing plugin for funcnodes Mar 19, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 - :pypi:`pytest-fv` pytest extensions to support running functional-verification jobs Feb 27, 2025 N/A pytest + :pypi:`pytest-fv` pytest extensions to support running functional-verification jobs Jun 06, 2025 N/A pytest :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A :pypi:`pytest-fxa-mte` pytest plugin for Firefox Accounts Oct 02, 2024 5 - Production/Stable N/A :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A @@ -697,7 +699,7 @@ This list contains 1641 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 30, 2025 3 - Alpha pytest==8.3.5 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 05, 2025 3 - Alpha pytest==8.3.5 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -710,6 +712,7 @@ This list contains 1641 plugins. :pypi:`pytest-html-cn` pytest plugin for generating HTML reports Aug 19, 2024 5 - Production/Stable pytest!=6.0.0,>=5.0 :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A + :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Jun 05, 2025 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 17, 2024 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A @@ -728,7 +731,7 @@ This list contains 1641 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Apr 24, 2025 4 - Beta pytest>=7.0.0 + :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jun 06, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Feb 06, 2025 4 - Beta pytest>=7.1 :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Dec 05, 2023 4 - Beta pytest :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A @@ -738,7 +741,7 @@ This list contains 1641 plugins. :pypi:`pytest-ignore-test-results` A pytest plugin to ignore test results. Feb 03, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-image-diff` Dec 31, 2024 3 - Alpha pytest :pypi:`pytest-image-snapshot` A pytest plugin for image snapshot management and comparison. Jul 01, 2024 4 - Beta pytest>=3.5.0 - :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. May 31, 2025 4 - Beta pytest>=8.0.0 + :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. Jun 07, 2025 4 - Beta pytest>=8.0.0 :pypi:`pytest-import-check` pytest plugin to check whether Python modules can be imported Jul 19, 2024 3 - Alpha pytest>=8.1 :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-infinity` Jun 09, 2024 N/A pytest<9.0.0,>=8.0.0 @@ -913,7 +916,7 @@ This list contains 1641 plugins. :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Feb 12, 2024 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest - :pypi:`pytest-mh` Pytest multihost plugin May 15, 2025 N/A pytest + :pypi:`pytest-mh` Pytest multihost plugin Jun 05, 2025 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-mimic` Easily record function calls while testing Apr 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) @@ -943,7 +946,7 @@ This list contains 1641 plugins. :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Feb 28, 2025 5 - Production/Stable pytest>=6.2 :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures May 16, 2023 5 - Production/Stable N/A :pypi:`pytest-mongodb-nono` pytest plugin for MongoDB Jan 07, 2025 N/A N/A - :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jan 21, 2025 N/A N/A + :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jun 05, 2025 N/A N/A :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Jun 25, 2023 5 - Production/Stable pytest :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A @@ -1002,7 +1005,7 @@ This list contains 1641 plugins. :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Feb 26, 2024 5 - Production/Stable N/A :pypi:`pytest-oar` PyTest plugin for the OAR testing framework May 12, 2025 N/A pytest>=6.0.1 - :pypi:`pytest-oarepo` Feb 14, 2025 N/A pytest>=7.1.2; extra == "base" + :pypi:`pytest-oarepo` Jun 06, 2025 N/A pytest>=7.1.2; extra == "base" :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odc` A pytest plugin for simplifying ODC database tests Aug 04, 2023 4 - Beta pytest (>=3.5.0) @@ -1117,7 +1120,7 @@ This list contains 1641 plugins. :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-powerpack` A plugin containing extra batteries for pytest Jan 04, 2025 N/A pytest<9.0.0,>=8.1.1 :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Apr 05, 2023 5 - Production/Stable pytest>=7 + :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Jun 04, 2025 5 - Production/Stable pytest>=7 :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Feb 25, 2025 5 - Production/Stable pytest>=8.3.2 @@ -1224,7 +1227,7 @@ This list contains 1641 plugins. :pypi:`pytest-reporter` Generate Pytest reports with templates Feb 28, 2024 4 - Beta pytest :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest May 06, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A - :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest May 31, 2025 N/A N/A + :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jun 06, 2025 N/A N/A :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Apr 04, 2025 N/A pytest>=8.0.0 :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) @@ -1306,7 +1309,7 @@ This list contains 1641 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 27, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 03, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1318,7 +1321,7 @@ This list contains 1641 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 27, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 03, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1390,7 +1393,7 @@ This list contains 1641 plugins. :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. May 21, 2025 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A - :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. Aug 04, 2024 N/A pytest; extra == "test" + :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. Jun 03, 2025 N/A pytest; extra == "test" :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Apr 10, 2024 N/A pytest>7.0 :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jan 22, 2023 3 - Alpha pytest>=7 :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Apr 13, 2024 4 - Beta pytest>=8.1.1 @@ -1411,7 +1414,7 @@ This list contains 1641 plugins. :pypi:`pytest-sqlalchemy-session` A pytest plugin for preserving test isolation that use SQLAlchemy. May 19, 2023 4 - Beta pytest (>=7.0) :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest :pypi:`pytest-sqlfluff` A pytest plugin to use sqlfluff to enable format checking of sql files. Dec 21, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-sqlguard` Pytest fixture to record and check SQL Queries made by SQLAlchemy Mar 11, 2025 4 - Beta pytest>=7 + :pypi:`pytest-sqlguard` Pytest fixture to record and check SQL Queries made by SQLAlchemy Jun 06, 2025 4 - Beta pytest>=7 :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A pytest>=6.2.0 :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest @@ -1578,7 +1581,7 @@ This list contains 1641 plugins. :pypi:`pytest-unittest-id-runner` A pytest plugin to run tests using unittest-style test IDs Feb 09, 2025 N/A pytest>=6.0.0 :pypi:`pytest-unmagic` Pytest fixtures with conventional import semantics Oct 22, 2024 5 - Production/Stable pytest :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A - :pypi:`pytest-unordered` Test equality of unordered collections in pytest Jul 05, 2024 4 - Beta pytest>=7.0.0 + :pypi:`pytest-unordered` Test equality of unordered collections in pytest Jun 03, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Sep 27, 2022 4 - Beta N/A :pypi:`pytest-unused-fixtures` A pytest plugin to list unused fixtures after a test run. Mar 15, 2025 4 - Beta pytest>7.3.2 :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A @@ -1648,6 +1651,7 @@ This list contains 1641 plugins. :pypi:`pytest-xray-reporter` Pytest plugin for generating Xray JSON reports May 21, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) :pypi:`pytest-xstress` Jun 01, 2024 N/A pytest<9.0.0,>=8.0.0 + :pypi:`pytest-xtime` pytest plugin for recording execution time Jun 05, 2025 4 - Beta pytest :pypi:`pytest-xvfb` A pytest plugin to run Xvfb (or Xephyr/Xvnc) for tests. Mar 12, 2025 4 - Beta pytest>=2.8.1 :pypi:`pytest-xvirt` A pytest plugin to virtualize test. For example to transparently running them on a remote box. Dec 15, 2024 4 - Beta pytest>=7.2.2 :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest @@ -2072,6 +2076,13 @@ This list contains 1641 plugins. An ASGI middleware to populate OpenAPI Specification examples from pytest functions + :pypi:`pytest-api-framework` + *last release*: Jun 07, 2025, + *status*: N/A, + *requires*: pytest==7.2.2 + + pytest framework + :pypi:`pytest-api-soup` *last release*: Aug 27, 2022, *status*: N/A, @@ -2135,6 +2146,13 @@ This list contains 1641 plugins. pyest results colection plugin + :pypi:`pytest-argus-reporter` + *last release*: Jun 03, 2025, + *status*: 4 - Beta, + *requires*: pytest>=3.0; extra == "dev" + + A simple plugin to report results of test into argus + :pypi:`pytest-argus-server` *last release*: Mar 24, 2025, *status*: 4 - Beta, @@ -2584,7 +2602,7 @@ This list contains 1641 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: May 30, 2025, + *last release*: Jun 05, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -3424,7 +3442,7 @@ This list contains 1641 plugins. pytest plugin to run pycodestyle :pypi:`pytest-codspeed` - *last release*: May 27, 2025, + *last release*: Jun 06, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=3.8 @@ -3830,7 +3848,7 @@ This list contains 1641 plugins. pytest fixtures to run dash applications. :pypi:`pytest-dashboard` - *last release*: May 20, 2025, + *last release*: Jun 02, 2025, *status*: N/A, *requires*: pytest<8.0.0,>=7.4.3 @@ -3858,7 +3876,7 @@ This list contains 1641 plugins. Pytest plugin for remote Databricks notebooks testing :pypi:`pytest-datadir` - *last release*: May 30, 2025, + *last release*: Jun 06, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 @@ -4131,7 +4149,7 @@ This list contains 1641 plugins. DevPI server fixture for py.test :pypi:`pytest-dfm` - *last release*: May 10, 2025, + *last release*: Jun 05, 2025, *status*: N/A, *requires*: pytest @@ -4264,8 +4282,8 @@ This list contains 1641 plugins. A Django plugin for pytest. :pypi:`pytest-djangoapp` - *last release*: May 19, 2023, - *status*: 4 - Beta, + *last release*: Jun 06, 2025, + *status*: 5 - Production/Stable, *requires*: pytest Nice pytest plugin to help you with Django pluggable application testing. @@ -4705,12 +4723,19 @@ This list contains 1641 plugins. A Pytest plugin to ignore tests during collection without reporting them in the test summary. :pypi:`pytest-dsl` - *last release*: May 29, 2025, + *last release*: Jun 07, 2025, *status*: N/A, *requires*: pytest>=7.0.0 A DSL testing framework based on pytest + :pypi:`pytest-dsl-ui` + *last release*: Jun 06, 2025, + *status*: N/A, + *requires*: pytest>=7.0.0; extra == "dev" + + Playwright-based UI automation keywords for pytest-dsl framework + :pypi:`pytest-dummynet` *last release*: Dec 15, 2021, *status*: 5 - Production/Stable, @@ -4830,13 +4855,6 @@ This list contains 1641 plugins. Elasticsearch fixtures and fixture factories for Pytest. - :pypi:`pytest-elbase` - *last release*: Apr 15, 2025, - *status*: N/A, - *requires*: N/A - - Elbase pytest plugin - :pypi:`pytest-elements` *last release*: Jan 13, 2021, *status*: N/A, @@ -5146,7 +5164,7 @@ This list contains 1641 plugins. Pytest plugin for testing examples in docstrings and markdown files. :pypi:`pytest-exasol-backend` - *last release*: Feb 11, 2025, + *last release*: Jun 06, 2025, *status*: N/A, *requires*: pytest<9,>=7 @@ -5573,7 +5591,7 @@ This list contains 1641 plugins. :pypi:`pytest-fixturecheck` - *last release*: May 17, 2025, + *last release*: Jun 02, 2025, *status*: 3 - Alpha, *requires*: pytest>=6.0.0 @@ -5769,7 +5787,7 @@ This list contains 1641 plugins. A pytest plugin in order to provide logs via fluentbit :pypi:`pytest-fly` - *last release*: May 19, 2025, + *last release*: Jun 07, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -5832,7 +5850,7 @@ This list contains 1641 plugins. pytest plugin for running parallel tests :pypi:`pytest-freezeblaster` - *last release*: Feb 11, 2025, + *last release*: Jun 02, 2025, *status*: N/A, *requires*: pytest>=6.2.5 @@ -5888,7 +5906,7 @@ This list contains 1641 plugins. An alternative way to parametrize test cases. :pypi:`pytest-fv` - *last release*: Feb 27, 2025, + *last release*: Jun 06, 2025, *status*: N/A, *requires*: pytest @@ -6322,7 +6340,7 @@ This list contains 1641 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 30, 2025, + *last release*: Jun 05, 2025, *status*: 3 - Alpha, *requires*: pytest==8.3.5 @@ -6412,6 +6430,13 @@ This list contains 1641 plugins. Pytest HTML reports merging utility + :pypi:`pytest-html-nova-act` + *last release*: Jun 05, 2025, + *status*: N/A, + *requires*: N/A + + A Pytest Plugin for Amazon Nova Act Python SDK. + :pypi:`pytest-html-object-storage` *last release*: Jan 17, 2024, *status*: 5 - Production/Stable, @@ -6539,7 +6564,7 @@ This list contains 1641 plugins. help hypo module for pytest :pypi:`pytest-iam` - *last release*: Apr 24, 2025, + *last release*: Jun 06, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -6609,7 +6634,7 @@ This list contains 1641 plugins. A pytest plugin for image snapshot management and comparison. :pypi:`pytest-impacted` - *last release*: May 31, 2025, + *last release*: Jun 07, 2025, *status*: 4 - Beta, *requires*: pytest>=8.0.0 @@ -7834,7 +7859,7 @@ This list contains 1641 plugins. Custom metrics report for pytest :pypi:`pytest-mh` - *last release*: May 15, 2025, + *last release*: Jun 05, 2025, *status*: N/A, *requires*: pytest @@ -8044,7 +8069,7 @@ This list contains 1641 plugins. pytest plugin for MongoDB :pypi:`pytest-mongodb-ry` - *last release*: Jan 21, 2025, + *last release*: Jun 05, 2025, *status*: N/A, *requires*: N/A @@ -8457,7 +8482,7 @@ This list contains 1641 plugins. PyTest plugin for the OAR testing framework :pypi:`pytest-oarepo` - *last release*: Feb 14, 2025, + *last release*: Jun 06, 2025, *status*: N/A, *requires*: pytest>=7.1.2; extra == "base" @@ -9262,7 +9287,7 @@ This list contains 1641 plugins. A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. :pypi:`pytest-pretty` - *last release*: Apr 05, 2023, + *last release*: Jun 04, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7 @@ -10011,7 +10036,7 @@ This list contains 1641 plugins. A basic HTML report for pytest using Jinja2 template engine. :pypi:`pytest-reporter-plus` - *last release*: May 31, 2025, + *last release*: Jun 06, 2025, *status*: N/A, *requires*: N/A @@ -10585,7 +10610,7 @@ This list contains 1641 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: May 27, 2025, + *last release*: Jun 03, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10669,7 +10694,7 @@ This list contains 1641 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: May 27, 2025, + *last release*: Jun 03, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11173,7 +11198,7 @@ This list contains 1641 plugins. py.test plugin to spawn process and communicate with them. :pypi:`pytest-spec` - *last release*: Aug 04, 2024, + *last release*: Jun 03, 2025, *status*: N/A, *requires*: pytest; extra == "test" @@ -11320,7 +11345,7 @@ This list contains 1641 plugins. A pytest plugin to use sqlfluff to enable format checking of sql files. :pypi:`pytest-sqlguard` - *last release*: Mar 11, 2025, + *last release*: Jun 06, 2025, *status*: 4 - Beta, *requires*: pytest>=7 @@ -12489,7 +12514,7 @@ This list contains 1641 plugins. Run only unmarked tests :pypi:`pytest-unordered` - *last release*: Jul 05, 2024, + *last release*: Jun 03, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -12978,6 +13003,13 @@ This list contains 1641 plugins. + :pypi:`pytest-xtime` + *last release*: Jun 05, 2025, + *status*: 4 - Beta, + *requires*: pytest + + pytest plugin for recording execution time + :pypi:`pytest-xvfb` *last release*: Mar 12, 2025, *status*: 4 - Beta, From 64c1173df4f897a8880a25a29eff67d45dbc41b2 Mon Sep 17 00:00:00 2001 From: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com> Date: Sat, 14 Jun 2025 17:50:17 -0700 Subject: [PATCH 010/270] Fix typo in parametrize.rst (#13514) --- doc/en/example/parametrize.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index c3848db5112..a7ec55dff0a 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -352,7 +352,7 @@ The first invocation with ``db == "DB1"`` passed while the second with ``db == " Indirect parametrization --------------------------------------------------- -Using the ``indirect=True`` parameter when parametrizing a test allows to +Using the ``indirect=True`` parameter when parametrizing a test allows one to parametrize a test with a fixture receiving the values before passing them to a test: From 336cb917f7175ccc5a699f81b58f3587c5a7dcca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 14 Jun 2025 21:51:12 -0300 Subject: [PATCH 011/270] [automated] Update plugin list (#13515) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 190 +++++++++++++++++-------------- 1 file changed, 103 insertions(+), 87 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 94c276272eb..66a3912e5a2 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =7.1.1,<8.0.0) - :pypi:`pytest-api-framework` pytest framework Jun 07, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework` pytest framework Jun 14, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Jun 11, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -100,7 +101,7 @@ This list contains 1645 plugins. :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Feb 05, 2024 5 - Production/Stable pytest :pypi:`pytest-archon` Rule your architecture like a real developer Dec 18, 2023 5 - Production/Stable pytest >=7.2 :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) - :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Jun 03, 2025 4 - Beta pytest>=3.0; extra == "dev" + :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Jun 12, 2025 4 - Beta pytest>=3.0; extra == "dev" :pypi:`pytest-argus-server` A plugin that provides a running Argus API server for tests Mar 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Nov 27, 2023 4 - Beta pytest >=4.6 :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) @@ -165,7 +166,7 @@ This list contains 1645 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 05, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 13, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -220,10 +221,9 @@ This list contains 1645 plugins. :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capsqlalchemy` Pytest plugin to allow capturing SQLAlchemy queries. Mar 19, 2025 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A - :pypi:`pytest-capture-sysout` An academic experiment package May 21, 2025 2 - Pre-Alpha N/A :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest :pypi:`pytest-case` A clean, modern, wrapper for pytest.mark.parametrize Nov 25, 2024 N/A pytest<9.0.0,>=8.3.3 - :pypi:`pytest-cases` Separate test code from test cases in pytest. Sep 26, 2024 5 - Production/Stable N/A + :pypi:`pytest-cases` Separate test code from test cases in pytest. Jun 09, 2025 5 - Production/Stable pytest :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A @@ -285,7 +285,7 @@ This list contains 1645 plugins. :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Jun 06, 2025 5 - Production/Stable pytest>=3.8 + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Jun 10, 2025 5 - Production/Stable pytest>=3.8 :pypi:`pytest-collect-appoint-info` set your encoding Aug 03, 2023 N/A pytest :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A @@ -310,7 +310,7 @@ This list contains 1645 plugins. :pypi:`pytest-copier` A pytest plugin to help testing Copier templates Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A - :pypi:`pytest-cov` Pytest plugin for measuring coverage. Apr 05, 2025 5 - Production/Stable pytest>=4.6 + :pypi:`pytest-cov` Pytest plugin for measuring coverage. Jun 12, 2025 5 - Production/Stable pytest>=6.2.5 :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jun 28, 2023 4 - Beta N/A @@ -345,7 +345,7 @@ This list contains 1645 plugins. :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-dashboard` Jun 02, 2025 N/A pytest<8.0.0,>=7.4.3 :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A - :pypi:`pytest-databases` Reusable database fixtures for any and all databases. May 25, 2025 4 - Beta pytest + :pypi:`pytest-databases` Reusable database fixtures for any and all databases. Jun 14, 2025 4 - Beta pytest :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest :pypi:`pytest-datadir` pytest plugin for test data directories and files Jun 06, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Apr 06, 2023 5 - Production/Stable pytest (>=7.1) @@ -395,7 +395,7 @@ This list contains 1645 plugins. :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) :pypi:`pytest-dir-equal` pytest-dir-equals is a pytest plugin providing helpers to assert directories equality allowing golden testing Dec 11, 2023 4 - Beta pytest>=7.3.2 - :pypi:`pytest-dirty` Static import analysis for thrifty testing. Jul 11, 2024 3 - Alpha pytest>=8.2; extra == "dev" + :pypi:`pytest-dirty` Static import analysis for thrifty testing. Jun 08, 2025 3 - Alpha pytest>=8.2; extra == "dev" :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. May 11, 2024 4 - Beta pytest!=6.0.0,<9,>=3.3.2 @@ -468,8 +468,8 @@ This list contains 1645 plugins. :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 - :pypi:`pytest-dsl` A DSL testing framework based on pytest Jun 07, 2025 N/A pytest>=7.0.0 - :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jun 06, 2025 N/A pytest>=7.0.0; extra == "dev" + :pypi:`pytest-dsl` A DSL testing framework based on pytest Jun 11, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jun 10, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A @@ -532,7 +532,7 @@ This list contains 1645 plugins. :pypi:`pytest_exact_fixtures` Parse queries in Lucene and Elasticsearch syntaxes Feb 04, 2019 N/A N/A :pypi:`pytest-examples` Pytest plugin for testing examples in docstrings and markdown files. May 06, 2025 N/A pytest>=7 :pypi:`pytest-exasol-backend` Jun 06, 2025 N/A pytest<9,>=7 - :pypi:`pytest-exasol-extension` Feb 11, 2025 N/A pytest<9,>=7 + :pypi:`pytest-exasol-extension` Jun 13, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-itde` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-saas` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-slc` Feb 11, 2025 N/A pytest<9,>=7 @@ -653,7 +653,7 @@ This list contains 1645 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 29, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jun 13, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -677,6 +677,7 @@ This list contains 1645 plugins. :pypi:`pytest-gradescope` A pytest plugin for Gradescope integration Apr 29, 2025 N/A N/A :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A + :pypi:`pytest-greener` pytest plugin for Greener Jun 10, 2025 N/A N/A :pypi:`pytest-group-by-class` A Pytest plugin for running a subset of your tests by splitting them in to groups of classes. Jun 27, 2023 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) @@ -699,7 +700,7 @@ This list contains 1645 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 05, 2025 3 - Alpha pytest==8.3.5 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 14, 2025 3 - Alpha pytest==8.3.5 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -779,7 +780,7 @@ This list contains 1645 plugins. :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest :pypi:`pytest-ipywidgets` May 30, 2025 N/A pytest :pypi:`pytest-iso` Plugin for pytest to produce test documentation for code audits. May 15, 2025 4 - Beta pytest<9.0.0,>=7.4.0 - :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses May 22, 2025 4 - Beta pytest + :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Jun 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 :pypi:`pytest-isort` py.test plugin to check import ordering using isort Mar 05, 2024 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 29, 2024 4 - Beta N/A @@ -910,7 +911,7 @@ This list contains 1645 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Jul 25, 2024 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify May 13, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Jun 12, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -921,7 +922,7 @@ This list contains 1645 plugins. :pypi:`pytest-mimic` Easily record function calls while testing Apr 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) :pypi:`pytest-mini` A plugin to test mp Feb 06, 2023 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-minio-mock` A pytest plugin for mocking Minio S3 interactions May 06, 2025 N/A pytest>=5.0.0 + :pypi:`pytest-minio-mock` A pytest plugin for mocking Minio S3 interactions Jun 12, 2025 N/A pytest>=5.0.0 :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-missing-modules` Pytest plugin to easily fake missing modules Sep 03, 2024 N/A pytest>=8.3.2 :pypi:`pytest-mitmproxy` pytest plugin for mitmproxy tests Nov 13, 2024 N/A pytest>=7.0 @@ -946,7 +947,7 @@ This list contains 1645 plugins. :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Feb 28, 2025 5 - Production/Stable pytest>=6.2 :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures May 16, 2023 5 - Production/Stable N/A :pypi:`pytest-mongodb-nono` pytest plugin for MongoDB Jan 07, 2025 N/A N/A - :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jun 05, 2025 N/A N/A + :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jun 09, 2025 N/A N/A :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Jun 25, 2023 5 - Production/Stable pytest :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A @@ -1005,7 +1006,7 @@ This list contains 1645 plugins. :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Feb 26, 2024 5 - Production/Stable N/A :pypi:`pytest-oar` PyTest plugin for the OAR testing framework May 12, 2025 N/A pytest>=6.0.1 - :pypi:`pytest-oarepo` Jun 06, 2025 N/A pytest>=7.1.2; extra == "base" + :pypi:`pytest-oarepo` Jun 13, 2025 N/A pytest>=7.1.2; extra == "base" :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odc` A pytest plugin for simplifying ODC database tests Aug 04, 2023 4 - Beta pytest (>=3.5.0) @@ -1097,7 +1098,7 @@ This list contains 1645 plugins. :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Apr 15, 2025 N/A N/A - :pypi:`pytest-plone` Pytest plugin to test Plone addons Mar 27, 2025 3 - Alpha pytest<8.0.0 + :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 @@ -1152,7 +1153,7 @@ This list contains 1645 plugins. :pypi:`pytest-pylint` pytest plugin to check source code with pylint Oct 06, 2023 5 - Production/Stable pytest >=7.0 :pypi:`pytest-pylyzer` A pytest plugin for pylyzer Feb 15, 2025 4 - Beta N/A :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A - :pypi:`pytest-pyodide` Pytest plugin for testing applications that use Pyodide Nov 23, 2024 N/A pytest + :pypi:`pytest-pyodide` Pytest plugin for testing applications that use Pyodide Jun 12, 2025 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1164,6 +1165,7 @@ This list contains 1645 plugins. :pypi:`pytest-pyspec` A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". Aug 17, 2024 N/A pytest<9.0.0,>=8.3.2 :pypi:`pytest-pystack` Plugin to run pystack after a timeout for a test suite. Nov 16, 2024 N/A pytest>=3.5.0 :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) + :pypi:`pytest-pytestrail-internal` Pytest plugin for interaction with TestRail, Pytest plugin for TestRail (internal fork from: https://github.com/tolstislon/pytest-pytestrail with PR #25 fix) Jun 12, 2025 4 - Beta pytest>=3.8.0 :pypi:`pytest-pythonhashseed` Pytest plugin to set PYTHONHASHSEED env var. Feb 25, 2024 4 - Beta pytest>=3.0.0 :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-python-test-engineer-sort` Sort plugin for Pytest May 13, 2024 N/A pytest>=6.2.0 @@ -1227,14 +1229,14 @@ This list contains 1645 plugins. :pypi:`pytest-reporter` Generate Pytest reports with templates Feb 28, 2024 4 - Beta pytest :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest May 06, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A - :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jun 06, 2025 N/A N/A - :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Apr 04, 2025 N/A pytest>=8.0.0 + :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jun 12, 2025 N/A N/A + :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Jun 12, 2025 N/A pytest>=8.0.0 :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility May 22, 2023 3 - Alpha pytest :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 28, 2025 N/A pytest>=4.6.10 + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 12, 2025 N/A pytest>=4.6.10 :pypi:`pytest-report-stream` A pytest plugin which allows to stream test reports at runtime Oct 22, 2023 4 - Beta N/A :pypi:`pytest-repo-structure` Pytest Repo Structure Mar 18, 2024 1 - Planning N/A :pypi:`pytest-req` pytest requests plugin Aug 31, 2024 5 - Production/Stable pytest<9.0.0,>=8.3.2 @@ -1251,7 +1253,7 @@ This list contains 1645 plugins. :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures May 08, 2025 5 - Production/Stable pytest!=8.2.2,>=7.4 :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Dec 22, 2024 4 - Beta pytest - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Feb 28, 2025 N/A pytest~=7.0 + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Jun 11, 2025 N/A pytest~=7.0 :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 15, 2025 5 - Production/Stable pytest>=3.5.0 :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 @@ -1292,7 +1294,7 @@ This list contains 1645 plugins. :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Jul 21, 2024 4 - Beta pytest>=5 :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently May 27, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Jun 10, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 @@ -1309,7 +1311,7 @@ This list contains 1645 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 03, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 12, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1321,7 +1323,7 @@ This list contains 1645 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 03, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 12, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1340,7 +1342,7 @@ This list contains 1645 plugins. :pypi:`pytest-setupinfo` Displaying setup info during pytest command run Jan 23, 2023 N/A N/A :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest - :pypi:`pytest-shard-fork` Shard tests to support parallelism across multiple machines May 17, 2025 4 - Beta pytest + :pypi:`pytest-shard-fork` Shard tests to support parallelism across multiple machines Jun 13, 2025 4 - Beta pytest :pypi:`pytest-shared-session-scope` Pytest session-scoped fixture that works with xdist Sep 22, 2024 N/A pytest>=7.0.0 :pypi:`pytest-share-hdf` Plugin to save test data in HDF files and retrieve them for comparison Sep 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-sharkreport` this is pytest report plugin. Jul 11, 2022 N/A pytest (>=3.5) @@ -1406,7 +1408,7 @@ This list contains 1645 plugins. :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 14, 2025 N/A pytest<8,>5.4.0 - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 19, 2025 N/A N/A + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Jun 11, 2025 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Apr 19, 2025 3 - Alpha pytest>=8.0 @@ -1440,7 +1442,7 @@ This list contains 1645 plugins. :pypi:`pytest-subinterpreter` Run pytest in a subinterpreter Nov 25, 2023 N/A pytest>=7.0.0 :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 04, 2025 5 - Production/Stable pytest>=4.0.0 :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Dec 10, 2024 4 - Beta pytest>=7.4 + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jun 13, 2025 4 - Beta pytest>=7.4 :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Sep 17, 2023 N/A pytest (>=2.3) :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Feb 01, 2024 4 - Beta pytest >=6.2.0 :pypi:`pytest-suitemanager` A simple plugin to use with pytest Apr 28, 2023 4 - Beta N/A @@ -1469,6 +1471,7 @@ This list contains 1645 plugins. :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures May 21, 2024 N/A pytest>=6.0 :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A + :pypi:`pytest-test-analyzer` A powerful tool for analyzing pytest test files and generating detailed reports Jun 14, 2025 4 - Beta N/A :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testdata` Get and load testdata in pytest projects Aug 30, 2024 N/A pytest @@ -1563,7 +1566,7 @@ This list contains 1645 plugins. :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Sep 10, 2024 5 - Production/Stable pytest>=2.3 :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-typed-schema-shot` Pytest plugin for automatic JSON Schema generation and validation from examples May 24, 2025 N/A pytest + :pypi:`pytest-typed-schema-shot` Pytest plugin for automatic JSON Schema generation and validation from examples Jun 14, 2025 N/A pytest :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A :pypi:`pytest-typhoon-polarion` Typhoontest plugin for Siemens Polarion Feb 01, 2024 4 - Beta N/A :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Aug 15, 2023 4 - Beta N/A @@ -1576,7 +1579,7 @@ This list contains 1645 plugins. :pypi:`pytest-uncollect-if` A plugin to uncollect pytests tests rather than using skipif Dec 26, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-unflakable` Unflakable plugin for PyTest Apr 30, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-unique` Pytest fixture to generate unique values. Mar 23, 2025 N/A pytest<8.0.0,>=7.4.2 + :pypi:`pytest-unique` Pytest fixture to generate unique values. Jun 10, 2025 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unittest-id-runner` A pytest plugin to run tests using unittest-style test IDs Feb 09, 2025 N/A pytest>=6.0.0 :pypi:`pytest-unmagic` Pytest fixtures with conventional import semantics Oct 22, 2024 5 - Production/Stable pytest @@ -1618,7 +1621,6 @@ This list contains 1645 plugins. :pypi:`pytest-web3-data` A pytest plugin to fetch test data from IPFS HTTP gateways during pytest execution. Oct 04, 2023 4 - Beta pytest :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-webstage` Test web apps with pytest Sep 20, 2024 N/A pytest<9.0,>=7.0 - :pypi:`pytest-webtest-extras` Pytest plugin to enhance pytest-html and allure reports of webtest projects by adding screenshots, comments and webpage sources. Dec 28, 2024 N/A pytest>=7.0.0 :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A :pypi:`pytest-when` Utility which makes mocking more readable and controllable Nov 29, 2024 N/A pytest>=7.3.1 :pypi:`pytest-whirlwind` Testing Tornado. Jun 12, 2020 N/A N/A @@ -1636,7 +1638,7 @@ This list contains 1645 plugins. :pypi:`pytest-xdist-lock` Extension for pytest-xdist adding test and resource group locks for local and distributed runs Apr 26, 2025 N/A pytest>=6.0 :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) :pypi:`pytest-xdist-worker-stats` A pytest plugin to list worker statistics after a xdist run. Mar 15, 2025 4 - Beta pytest>=7.0.0 - :pypi:`pytest-xdocker` Pytest fixture to run docker across test runs. Mar 23, 2025 N/A pytest<8.0.0,>=7.4.2 + :pypi:`pytest-xdocker` Pytest fixture to run docker across test runs. Jun 10, 2025 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xflaky` A simple plugin to use with pytest Oct 14, 2024 4 - Beta pytest>=8.2.1 @@ -2077,12 +2079,19 @@ This list contains 1645 plugins. An ASGI middleware to populate OpenAPI Specification examples from pytest functions :pypi:`pytest-api-framework` - *last release*: Jun 07, 2025, + *last release*: Jun 14, 2025, *status*: N/A, *requires*: pytest==7.2.2 pytest framework + :pypi:`pytest-api-framework-alpha` + *last release*: Jun 11, 2025, + *status*: N/A, + *requires*: pytest==7.2.2 + + + :pypi:`pytest-api-soup` *last release*: Aug 27, 2022, *status*: N/A, @@ -2147,7 +2156,7 @@ This list contains 1645 plugins. pyest results colection plugin :pypi:`pytest-argus-reporter` - *last release*: Jun 03, 2025, + *last release*: Jun 12, 2025, *status*: 4 - Beta, *requires*: pytest>=3.0; extra == "dev" @@ -2602,7 +2611,7 @@ This list contains 1645 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Jun 05, 2025, + *last release*: Jun 13, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -2986,13 +2995,6 @@ This list contains 1645 plugins. pytest plugin to capture all deprecatedwarnings and put them in one file - :pypi:`pytest-capture-sysout` - *last release*: May 21, 2025, - *status*: 2 - Pre-Alpha, - *requires*: N/A - - An academic experiment package - :pypi:`pytest-capture-warnings` *last release*: May 03, 2022, *status*: N/A, @@ -3008,9 +3010,9 @@ This list contains 1645 plugins. A clean, modern, wrapper for pytest.mark.parametrize :pypi:`pytest-cases` - *last release*: Sep 26, 2024, + *last release*: Jun 09, 2025, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest Separate test code from test cases in pytest. @@ -3442,7 +3444,7 @@ This list contains 1645 plugins. pytest plugin to run pycodestyle :pypi:`pytest-codspeed` - *last release*: Jun 06, 2025, + *last release*: Jun 10, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=3.8 @@ -3617,9 +3619,9 @@ This list contains 1645 plugins. count erros and send email :pypi:`pytest-cov` - *last release*: Apr 05, 2025, + *last release*: Jun 12, 2025, *status*: 5 - Production/Stable, - *requires*: pytest>=4.6 + *requires*: pytest>=6.2.5 Pytest plugin for measuring coverage. @@ -3862,7 +3864,7 @@ This list contains 1645 plugins. Useful functions for managing data for pytest fixtures :pypi:`pytest-databases` - *last release*: May 25, 2025, + *last release*: Jun 14, 2025, *status*: 4 - Beta, *requires*: pytest @@ -4212,7 +4214,7 @@ This list contains 1645 plugins. pytest-dir-equals is a pytest plugin providing helpers to assert directories equality allowing golden testing :pypi:`pytest-dirty` - *last release*: Jul 11, 2024, + *last release*: Jun 08, 2025, *status*: 3 - Alpha, *requires*: pytest>=8.2; extra == "dev" @@ -4723,14 +4725,14 @@ This list contains 1645 plugins. A Pytest plugin to ignore tests during collection without reporting them in the test summary. :pypi:`pytest-dsl` - *last release*: Jun 07, 2025, + *last release*: Jun 11, 2025, *status*: N/A, *requires*: pytest>=7.0.0 A DSL testing framework based on pytest :pypi:`pytest-dsl-ui` - *last release*: Jun 06, 2025, + *last release*: Jun 10, 2025, *status*: N/A, *requires*: pytest>=7.0.0; extra == "dev" @@ -5171,7 +5173,7 @@ This list contains 1645 plugins. :pypi:`pytest-exasol-extension` - *last release*: Feb 11, 2025, + *last release*: Jun 13, 2025, *status*: N/A, *requires*: pytest<9,>=7 @@ -6018,7 +6020,7 @@ This list contains 1645 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: May 29, 2025, + *last release*: Jun 13, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6185,6 +6187,13 @@ This list contains 1645 plugins. Green progress dots + :pypi:`pytest-greener` + *last release*: Jun 10, 2025, + *status*: N/A, + *requires*: N/A + + pytest plugin for Greener + :pypi:`pytest-group-by-class` *last release*: Jun 27, 2023, *status*: 5 - Production/Stable, @@ -6340,7 +6349,7 @@ This list contains 1645 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 05, 2025, + *last release*: Jun 14, 2025, *status*: 3 - Alpha, *requires*: pytest==8.3.5 @@ -6900,7 +6909,7 @@ This list contains 1645 plugins. Plugin for pytest to produce test documentation for code audits. :pypi:`pytest-isolate` - *last release*: May 22, 2025, + *last release*: Jun 08, 2025, *status*: 4 - Beta, *requires*: pytest @@ -7817,7 +7826,7 @@ This list contains 1645 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: May 13, 2025, + *last release*: Jun 12, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -7894,7 +7903,7 @@ This list contains 1645 plugins. A plugin to test mp :pypi:`pytest-minio-mock` - *last release*: May 06, 2025, + *last release*: Jun 12, 2025, *status*: N/A, *requires*: pytest>=5.0.0 @@ -8069,7 +8078,7 @@ This list contains 1645 plugins. pytest plugin for MongoDB :pypi:`pytest-mongodb-ry` - *last release*: Jun 05, 2025, + *last release*: Jun 09, 2025, *status*: N/A, *requires*: N/A @@ -8482,7 +8491,7 @@ This list contains 1645 plugins. PyTest plugin for the OAR testing framework :pypi:`pytest-oarepo` - *last release*: Jun 06, 2025, + *last release*: Jun 13, 2025, *status*: N/A, *requires*: pytest>=7.1.2; extra == "base" @@ -9126,7 +9135,7 @@ This list contains 1645 plugins. Easy pytest visual regression testing using playwright :pypi:`pytest-plone` - *last release*: Mar 27, 2025, + *last release*: Jun 11, 2025, *status*: 3 - Alpha, *requires*: pytest<8.0.0 @@ -9511,7 +9520,7 @@ This list contains 1645 plugins. Record PyMySQL queries and mock with the stored data. :pypi:`pytest-pyodide` - *last release*: Nov 23, 2024, + *last release*: Jun 12, 2025, *status*: N/A, *requires*: pytest @@ -9594,6 +9603,13 @@ This list contains 1645 plugins. Pytest plugin for interaction with TestRail + :pypi:`pytest-pytestrail-internal` + *last release*: Jun 12, 2025, + *status*: 4 - Beta, + *requires*: pytest>=3.8.0 + + Pytest plugin for interaction with TestRail, Pytest plugin for TestRail (internal fork from: https://github.com/tolstislon/pytest-pytestrail with PR #25 fix) + :pypi:`pytest-pythonhashseed` *last release*: Feb 25, 2024, *status*: 4 - Beta, @@ -10036,14 +10052,14 @@ This list contains 1645 plugins. A basic HTML report for pytest using Jinja2 template engine. :pypi:`pytest-reporter-plus` - *last release*: Jun 06, 2025, + *last release*: Jun 12, 2025, *status*: N/A, *requires*: N/A Lightweight enhanced HTML reporter for Pytest :pypi:`pytest-report-extras` - *last release*: Apr 04, 2025, + *last release*: Jun 12, 2025, *status*: N/A, *requires*: pytest>=8.0.0 @@ -10085,7 +10101,7 @@ This list contains 1645 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Feb 28, 2025, + *last release*: Jun 12, 2025, *status*: N/A, *requires*: pytest>=4.6.10 @@ -10204,7 +10220,7 @@ This list contains 1645 plugins. Pytest fixture for recording and replaying serial port traffic. :pypi:`pytest-resilient-circuits` - *last release*: Feb 28, 2025, + *last release*: Jun 11, 2025, *status*: N/A, *requires*: pytest~=7.0 @@ -10491,7 +10507,7 @@ This list contains 1645 plugins. implement a --failed option for pytest :pypi:`pytest-run-parallel` - *last release*: May 27, 2025, + *last release*: Jun 10, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 @@ -10610,7 +10626,7 @@ This list contains 1645 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Jun 03, 2025, + *last release*: Jun 12, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10694,7 +10710,7 @@ This list contains 1645 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Jun 03, 2025, + *last release*: Jun 12, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10827,7 +10843,7 @@ This list contains 1645 plugins. :pypi:`pytest-shard-fork` - *last release*: May 17, 2025, + *last release*: Jun 13, 2025, *status*: 4 - Beta, *requires*: pytest @@ -11289,7 +11305,7 @@ This list contains 1645 plugins. A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Mar 19, 2025, + *last release*: Jun 11, 2025, *status*: N/A, *requires*: N/A @@ -11527,7 +11543,7 @@ This list contains 1645 plugins. A hack to explicitly set up and tear down fixtures. :pypi:`pytest-subtests` - *last release*: Dec 10, 2024, + *last release*: Jun 13, 2025, *status*: 4 - Beta, *requires*: pytest>=7.4 @@ -11729,6 +11745,13 @@ This list contains 1645 plugins. generate terraform resources to use with pytest + :pypi:`pytest-test-analyzer` + *last release*: Jun 14, 2025, + *status*: 4 - Beta, + *requires*: N/A + + A powerful tool for analyzing pytest test files and generating detailed reports + :pypi:`pytest-testbook` *last release*: Dec 11, 2016, *status*: 3 - Alpha, @@ -12388,7 +12411,7 @@ This list contains 1645 plugins. Run type checkers on specified test files :pypi:`pytest-typed-schema-shot` - *last release*: May 24, 2025, + *last release*: Jun 14, 2025, *status*: N/A, *requires*: pytest @@ -12479,9 +12502,9 @@ This list contains 1645 plugins. Plugin for py.test set a different exit code on uncaught exceptions :pypi:`pytest-unique` - *last release*: Mar 23, 2025, + *last release*: Jun 10, 2025, *status*: N/A, - *requires*: pytest<8.0.0,>=7.4.2 + *requires*: pytest<9.0.0,>=8.0.0 Pytest fixture to generate unique values. @@ -12772,13 +12795,6 @@ This list contains 1645 plugins. Test web apps with pytest - :pypi:`pytest-webtest-extras` - *last release*: Dec 28, 2024, - *status*: N/A, - *requires*: pytest>=7.0.0 - - Pytest plugin to enhance pytest-html and allure reports of webtest projects by adding screenshots, comments and webpage sources. - :pypi:`pytest-wetest` *last release*: Nov 10, 2018, *status*: 4 - Beta, @@ -12899,9 +12915,9 @@ This list contains 1645 plugins. A pytest plugin to list worker statistics after a xdist run. :pypi:`pytest-xdocker` - *last release*: Mar 23, 2025, + *last release*: Jun 10, 2025, *status*: N/A, - *requires*: pytest<8.0.0,>=7.4.2 + *requires*: pytest<9.0.0,>=8.0.0 Pytest fixture to run docker across test runs. From 391324e13a6589f5d824d053240d4b9a4139a115 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 17 Jun 2025 00:31:21 +0300 Subject: [PATCH 012/270] pytester: avoid unraisableexception gc collects in inline runs to speed up test suite (#13525) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because `pytester.runpytest()` executes the full session cycle (including `pytest_unconfigure`), it was calling `gc.collect()` in a loop multiple times—even for small, fast tests. This significantly increased the total test suite runtime. To optimize performance, disable the gc runs in inline pytester runs entirely, matching the behavior before #12958. Locally the test suite runtime improved dramatically, dropping from 425s to 160s. Fixes #13482. Co-authored-by: Bruno Oliveira --- src/_pytest/pytester.py | 10 ++++-- src/_pytest/unraisableexception.py | 15 ++++++--- testing/test_config.py | 3 +- testing/test_unraisableexception.py | 51 +++++++++++++---------------- 4 files changed, 43 insertions(+), 36 deletions(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 38f4643bd8b..59d2b0befe9 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1092,6 +1092,8 @@ def inline_run( Typically we reraise keyboard interrupts from the child run. If True, the KeyboardInterrupt exception is captured. """ + from _pytest.unraisableexception import gc_collect_iterations_key + # (maybe a cpython bug?) the importlib cache sometimes isn't updated # properly between file creation and inline_run (especially if imports # are interspersed with file creation) @@ -1115,12 +1117,16 @@ def inline_run( rec = [] - class Collect: + class PytesterHelperPlugin: @staticmethod def pytest_configure(config: Config) -> None: rec.append(self.make_hook_recorder(config.pluginmanager)) - plugins.append(Collect()) + # The unraisable plugin GC collect slows down inline + # pytester runs too much. + config.stash[gc_collect_iterations_key] = 0 + + plugins.append(PytesterHelperPlugin()) ret = main([str(x) for x in args], plugins=plugins) if len(rec) == 1: reprec = rec.pop() diff --git a/src/_pytest/unraisableexception.py b/src/_pytest/unraisableexception.py index 7826aeccd12..0faca36aa00 100644 --- a/src/_pytest/unraisableexception.py +++ b/src/_pytest/unraisableexception.py @@ -24,10 +24,12 @@ from exceptiongroup import ExceptionGroup -def gc_collect_harder() -> None: - # A single collection doesn't necessarily collect everything. - # Constant determined experimentally by the Trio project. - for _ in range(5): +# This is a stash item and not a simple constant to allow pytester to override it. +gc_collect_iterations_key = StashKey[int]() + + +def gc_collect_harder(iterations: int) -> None: + for _ in range(iterations): gc.collect() @@ -84,9 +86,12 @@ def collect_unraisable(config: Config) -> None: def cleanup( *, config: Config, prev_hook: Callable[[sys.UnraisableHookArgs], object] ) -> None: + # A single collection doesn't necessarily collect everything. + # Constant determined experimentally by the Trio project. + gc_collect_iterations = config.stash.get(gc_collect_iterations_key, 5) try: try: - gc_collect_harder() + gc_collect_harder(gc_collect_iterations) collect_unraisable(config) finally: sys.unraisablehook = prev_hook diff --git a/testing/test_config.py b/testing/test_config.py index bb08c40fef4..3e8635fd1fc 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -2175,7 +2175,8 @@ class DummyPlugin: plugins = config.invocation_params.plugins assert len(plugins) == 2 assert plugins[0] is plugin - assert type(plugins[1]).__name__ == "Collect" # installed by pytester.inline_run() + # Installed by pytester.inline_run(). + assert type(plugins[1]).__name__ == "PytesterHelperPlugin" # args cannot be None with pytest.raises(TypeError): diff --git a/testing/test_unraisableexception.py b/testing/test_unraisableexception.py index 6c0dc542e93..a6a4d6f35e8 100644 --- a/testing/test_unraisableexception.py +++ b/testing/test_unraisableexception.py @@ -1,7 +1,5 @@ from __future__ import annotations -from collections.abc import Generator -import contextlib import gc import sys from unittest import mock @@ -229,19 +227,13 @@ def _set_gc_state(enabled: bool) -> bool: return was_enabled -@contextlib.contextmanager -def _disable_gc() -> Generator[None]: - was_enabled = _set_gc_state(enabled=False) - try: - yield - finally: - _set_gc_state(enabled=was_enabled) - - def test_refcycle_unraisable(pytester: Pytester) -> None: # see: https://github.com/pytest-dev/pytest/issues/10404 pytester.makepyfile( test_it=""" + # Should catch the unraisable exception even if gc is disabled. + import gc; gc.disable() + import pytest class BrokenDel: @@ -256,23 +248,22 @@ def test_it(): """ ) - with _disable_gc(): - result = pytester.runpytest() + result = pytester.runpytest_subprocess( + "-Wdefault::pytest.PytestUnraisableExceptionWarning" + ) - # TODO: should be a test failure or error - assert result.ret == pytest.ExitCode.INTERNAL_ERROR + assert result.ret == 0 result.assert_outcomes(passed=1) result.stderr.fnmatch_lines("ValueError: del is broken") -@pytest.mark.filterwarnings("default::pytest.PytestUnraisableExceptionWarning") def test_refcycle_unraisable_warning_filter(pytester: Pytester) -> None: - # note that the host pytest warning filter is disabled and the pytester - # warning filter applies during config teardown of unraisablehook. - # see: https://github.com/pytest-dev/pytest/issues/10404 pytester.makepyfile( test_it=""" + # Should catch the unraisable exception even if gc is disabled. + import gc; gc.disable() + import pytest class BrokenDel: @@ -287,17 +278,18 @@ def test_it(): """ ) - with _disable_gc(): - result = pytester.runpytest("-Werror") + result = pytester.runpytest_subprocess( + "-Werror::pytest.PytestUnraisableExceptionWarning" + ) - # TODO: should be a test failure or error - assert result.ret == pytest.ExitCode.INTERNAL_ERROR + # TODO: Should be a test failure or error. Currently the exception + # propagates all the way to the top resulting in exit code 1. + assert result.ret == 1 result.assert_outcomes(passed=1) result.stderr.fnmatch_lines("ValueError: del is broken") -@pytest.mark.filterwarnings("default::pytest.PytestUnraisableExceptionWarning") def test_create_task_raises_unraisable_warning_filter(pytester: Pytester) -> None: # note that the host pytest warning filter is disabled and the pytester # warning filter applies during config teardown of unraisablehook. @@ -306,6 +298,9 @@ def test_create_task_raises_unraisable_warning_filter(pytester: Pytester) -> Non # the issue pytester.makepyfile( test_it=""" + # Should catch the unraisable exception even if gc is disabled. + import gc; gc.disable() + import asyncio import pytest @@ -318,11 +313,11 @@ def test_scheduler_must_be_created_within_running_loop() -> None: """ ) - with _disable_gc(): - result = pytester.runpytest("-Werror") + result = pytester.runpytest_subprocess("-Werror") - # TODO: should be a test failure or error - assert result.ret == pytest.ExitCode.INTERNAL_ERROR + # TODO: Should be a test failure or error. Currently the exception + # propagates all the way to the top resulting in exit code 1. + assert result.ret == 1 result.assert_outcomes(passed=1) result.stderr.fnmatch_lines("RuntimeWarning: coroutine 'my_task' was never awaited") From 53f05c44d9530c4ac5ce5804ef75fe61713d46d8 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 16 Jun 2025 18:32:15 -0300 Subject: [PATCH 013/270] Reintroduce PytestReturnNotNoneWarning (#13495) Since this warning is meant to be permanent, added proper documentation to the `assert` section in the docs. Fixes #13477 --- changelog/13477.bugfix.rst | 5 ++++ doc/en/deprecations.rst | 40 ------------------------------- doc/en/how-to/assert.rst | 44 ++++++++++++++++++++++++++++++++++ doc/en/reference/reference.rst | 3 +++ src/_pytest/python.py | 13 +++++----- src/_pytest/warning_types.py | 11 +++++++++ src/pytest/__init__.py | 2 ++ testing/acceptance_test.py | 4 ++-- 8 files changed, 74 insertions(+), 48 deletions(-) create mode 100644 changelog/13477.bugfix.rst diff --git a/changelog/13477.bugfix.rst b/changelog/13477.bugfix.rst new file mode 100644 index 00000000000..7b7f875df09 --- /dev/null +++ b/changelog/13477.bugfix.rst @@ -0,0 +1,5 @@ +Reintroduced :class:`pytest.PytestReturnNotNoneWarning` which was removed by accident in pytest `8.4`. + +This warning is raised when a test functions returns a value other than ``None``, which is often a mistake made by beginners. + +See :ref:`return-not-none` for more information. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 18df64c9204..6897fb28fc1 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -316,46 +316,6 @@ Users expected in this case that the ``usefixtures`` mark would have its intende Now pytest will issue a warning when it encounters this problem, and will raise an error in the future versions. -Returning non-None value in test functions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 7.2 - -A ``pytest.PytestReturnNotNoneWarning`` is now emitted if a test function returns something other than `None`. - -This prevents a common mistake among beginners that expect that returning a `bool` would cause a test to pass or fail, for example: - -.. code-block:: python - - @pytest.mark.parametrize( - ["a", "b", "result"], - [ - [1, 2, 5], - [2, 3, 8], - [5, 3, 18], - ], - ) - def test_foo(a, b, result): - return foo(a, b) == result - -Given that pytest ignores the return value, this might be surprising that it will never fail. - -The proper fix is to change the `return` to an `assert`: - -.. code-block:: python - - @pytest.mark.parametrize( - ["a", "b", "result"], - [ - [1, 2, 5], - [2, 3, 8], - [5, 3, 18], - ], - ) - def test_foo(a, b, result): - assert foo(a, b) == result - - The ``yield_fixture`` function/decorator ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/en/how-to/assert.rst b/doc/en/how-to/assert.rst index 6bc8f6fed33..c83fb93c4b1 100644 --- a/doc/en/how-to/assert.rst +++ b/doc/en/how-to/assert.rst @@ -476,6 +476,50 @@ the conftest file: FAILED test_foocompare.py::test_compare - assert Comparing Foo instances: 1 failed in 0.12s +.. _`return-not-none`: + +Returning non-None value in test functions +------------------------------------------ + +A :class:`pytest.PytestReturnNotNoneWarning` is emitted when a test function returns a value other than ``None``. + +This helps prevent a common mistake made by beginners who assume that returning a ``bool`` (e.g., ``True`` or ``False``) will determine whether a test passes or fails. + +Example: + +.. code-block:: python + + @pytest.mark.parametrize( + ["a", "b", "result"], + [ + [1, 2, 5], + [2, 3, 8], + [5, 3, 18], + ], + ) + def test_foo(a, b, result): + return foo(a, b) == result # Incorrect usage, do not do this. + +Since pytest ignores return values, it might be surprising that the test will never fail based on the returned value. + +The correct fix is to replace the ``return`` statement with an ``assert``: + +.. code-block:: python + + @pytest.mark.parametrize( + ["a", "b", "result"], + [ + [1, 2, 5], + [2, 3, 8], + [5, 3, 18], + ], + ) + def test_foo(a, b, result): + assert foo(a, b) == result + + + + .. _assert-details: .. _`assert introspection`: diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index b0535ef6589..cfdc3eb3421 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1274,6 +1274,9 @@ Custom warnings generated in some situations such as improper usage or deprecate .. autoclass:: pytest.PytestExperimentalApiWarning :show-inheritance: +.. autoclass:: pytest.PytestReturnNotNoneWarning + :show-inheritance: + .. autoclass:: pytest.PytestRemovedIn9Warning :show-inheritance: diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 82aab85a300..8e4fb041532 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -73,6 +73,7 @@ from _pytest.scope import Scope from _pytest.stash import StashKey from _pytest.warning_types import PytestCollectionWarning +from _pytest.warning_types import PytestReturnNotNoneWarning if TYPE_CHECKING: @@ -157,12 +158,12 @@ def pytest_pyfunc_call(pyfuncitem: Function) -> object | None: if hasattr(result, "__await__") or hasattr(result, "__aiter__"): async_fail(pyfuncitem.nodeid) elif result is not None: - fail( - ( - f"Expected None, but test returned {result!r}. " - "Did you mean to use `assert` instead of `return`?" - ), - pytrace=False, + warnings.warn( + PytestReturnNotNoneWarning( + f"Test functions should return None, but {pyfuncitem.nodeid} returned {type(result)!r}.\n" + "Did you mean to use `assert` instead of `return`?\n" + "See https://docs.pytest.org/en/stable/how-to/assert.html#return-not-none for more information." + ) ) return True diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 8c9ff2d9a36..5e78debb682 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -71,6 +71,17 @@ def simple(cls, apiname: str) -> PytestExperimentalApiWarning: return cls(f"{apiname} is an experimental api that may change over time") +@final +class PytestReturnNotNoneWarning(PytestWarning): + """ + Warning emitted when a test function returns a value other than ``None``. + + See :ref:`return-not-none` for details. + """ + + __module__ = "pytest" + + @final class PytestUnknownMarkWarning(PytestWarning): """Warning emitted on use of unknown markers. diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index e36d3e704c1..297b524bcc2 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -82,6 +82,7 @@ from _pytest.warning_types import PytestExperimentalApiWarning from _pytest.warning_types import PytestFDWarning from _pytest.warning_types import PytestRemovedIn9Warning +from _pytest.warning_types import PytestReturnNotNoneWarning from _pytest.warning_types import PytestUnhandledThreadExceptionWarning from _pytest.warning_types import PytestUnknownMarkWarning from _pytest.warning_types import PytestUnraisableExceptionWarning @@ -132,6 +133,7 @@ "PytestFDWarning", "PytestPluginManager", "PytestRemovedIn9Warning", + "PytestReturnNotNoneWarning", "PytestUnhandledThreadExceptionWarning", "PytestUnknownMarkWarning", "PytestUnraisableExceptionWarning", diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 4948e3ff8ae..2101fe9ad76 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1489,7 +1489,8 @@ def test_no_brokenpipeerror_message(pytester: Pytester) -> None: popen.stderr.close() -def test_function_return_non_none_error(pytester: Pytester) -> None: +@pytest.mark.filterwarnings("default") +def test_function_return_non_none_warning(pytester: Pytester) -> None: pytester.makepyfile( """ def test_stuff(): @@ -1497,7 +1498,6 @@ def test_stuff(): """ ) res = pytester.runpytest() - res.assert_outcomes(failed=1) res.stdout.fnmatch_lines(["*Did you mean to use `assert` instead of `return`?*"]) From a620d24376eb2c4bc964f2b6efcc694a4adbbe21 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 17 Jun 2025 08:25:30 -0300 Subject: [PATCH 014/270] Remove unused code related to `nose` (#13528) Support for `nose` has been dropped in 8.0. --- src/_pytest/unittest.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index 04d50b53090..27807274168 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -372,18 +372,6 @@ def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> None: except AttributeError: pass - # Convert unittest.SkipTest to pytest.skip. - # This is actually only needed for nose, which reuses unittest.SkipTest for - # its own nose.SkipTest. For unittest TestCases, SkipTest is already - # handled internally, and doesn't reach here. - unittest = sys.modules.get("unittest") - if unittest and call.excinfo and isinstance(call.excinfo.value, unittest.SkipTest): - excinfo = call.excinfo - call2 = CallInfo[None].from_call( - lambda: pytest.skip(str(excinfo.value)), call.when - ) - call.excinfo = call2.excinfo - # Twisted trial support. classImplements_has_run = False From 01dce85a89eb0b3e881303784267f14b94d9691f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 17 Jun 2025 17:46:13 -0300 Subject: [PATCH 015/270] Fix compatibility with Twisted 25 (#13502) As discussed in https://github.com/pytest-dev/pytest/pull/13502, the fix for compatibility with Twisted 25+ is simpler. Therefore, it makes sense to implement both fixes (for Twisted 24 and Twisted 25) in parallel. This way, we can eventually drop support for Twisted <25 and keep only the simpler workaround. In addition, the `unittestextras` tox environment has been replaced with dedicated test environments for `asynctest`, `Twisted 24`, and `Twisted 25`. Fixes #13497 --- .github/workflows/test.yml | 43 +++++++++- changelog/13497.bugfix.rst | 1 + src/_pytest/unittest.py | 155 ++++++++++++++++++++++++++++--------- tox.ini | 19 +++-- 4 files changed, 174 insertions(+), 44 deletions(-) create mode 100644 changelog/13497.bugfix.rst diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ecc133878f..7873b66a49a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,9 @@ jobs: fail-fast: false matrix: name: [ - "windows-py39-unittestextras", + "windows-py39-unittest-asynctest", + "windows-py39-unittest-twisted24", + "windows-py39-unittest-twisted25", "windows-py39-pluggy", "windows-py39-xdist", "windows-py310", @@ -63,6 +65,9 @@ jobs: "windows-py313", "windows-py314", + "ubuntu-py39-unittest-asynctest", + "ubuntu-py39-unittest-twisted24", + "ubuntu-py39-unittest-twisted25", "ubuntu-py39-lsof-numpy-pexpect", "ubuntu-py39-pluggy", "ubuntu-py39-freeze", @@ -85,10 +90,23 @@ jobs: ] include: - - name: "windows-py39-unittestextras" + # Use separate jobs for different unittest flavors (twisted, asynctest) to ensure proper coverage. + - name: "windows-py39-unittest-asynctest" python: "3.9" os: windows-latest - tox_env: "py39-unittestextras" + tox_env: "py39-asynctest" + use_coverage: true + + - name: "windows-py39-unittest-twisted24" + python: "3.9" + os: windows-latest + tox_env: "py39-twisted24" + use_coverage: true + + - name: "windows-py39-unittest-twisted25" + python: "3.9" + os: windows-latest + tox_env: "py39-twisted25" use_coverage: true - name: "windows-py39-pluggy" @@ -126,6 +144,25 @@ jobs: os: windows-latest tox_env: "py314" + # Use separate jobs for different unittest flavors (twisted, asynctest) to ensure proper coverage. + - name: "ubuntu-py39-unittest-asynctest" + python: "3.9" + os: ubuntu-latest + tox_env: "py39-asynctest" + use_coverage: true + + - name: "ubuntu-py39-unittest-twisted24" + python: "3.9" + os: ubuntu-latest + tox_env: "py39-twisted24" + use_coverage: true + + - name: "ubuntu-py39-unittest-twisted25" + python: "3.9" + os: ubuntu-latest + tox_env: "py39-twisted25" + use_coverage: true + - name: "ubuntu-py39-lsof-numpy-pexpect" python: "3.9" os: ubuntu-latest diff --git a/changelog/13497.bugfix.rst b/changelog/13497.bugfix.rst new file mode 100644 index 00000000000..75b4996e5af --- /dev/null +++ b/changelog/13497.bugfix.rst @@ -0,0 +1 @@ +Fixed compatibility with ``Twisted 25+``. diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index 27807274168..b18ac56b811 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -6,11 +6,13 @@ from collections.abc import Callable from collections.abc import Generator from collections.abc import Iterable +from collections.abc import Iterator +from enum import auto +from enum import Enum import inspect import sys import traceback import types -from typing import Any from typing import TYPE_CHECKING from typing import Union @@ -18,6 +20,7 @@ from _pytest.compat import is_async_function from _pytest.config import hookimpl from _pytest.fixtures import FixtureRequest +from _pytest.monkeypatch import MonkeyPatch from _pytest.nodes import Collector from _pytest.nodes import Item from _pytest.outcomes import exit @@ -228,8 +231,7 @@ def startTest(self, testcase: unittest.TestCase) -> None: pass def _addexcinfo(self, rawexcinfo: _SysExcInfoType) -> None: - # Unwrap potential exception info (see twisted trial support below). - rawexcinfo = getattr(rawexcinfo, "_rawexcinfo", rawexcinfo) + rawexcinfo = _handle_twisted_exc_info(rawexcinfo) try: excinfo = _pytest._code.ExceptionInfo[BaseException].from_exc_info( rawexcinfo # type: ignore[arg-type] @@ -373,49 +375,130 @@ def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> None: pass -# Twisted trial support. -classImplements_has_run = False +def _is_skipped(obj) -> bool: + """Return True if the given object has been marked with @unittest.skip.""" + return bool(getattr(obj, "__unittest_skip__", False)) + + +def pytest_configure() -> None: + """Register the TestCaseFunction class as an IReporter if twisted.trial is available.""" + if _get_twisted_version() is not TwistedVersion.NotInstalled: + from twisted.trial.itrial import IReporter + from zope.interface import classImplements + + classImplements(TestCaseFunction, IReporter) + + +class TwistedVersion(Enum): + """ + The Twisted version installed in the environment. + + We have different workarounds in place for different versions of Twisted. + """ + + # Twisted version 24 or prior. + Version24 = auto() + # Twisted version 25 or later. + Version25 = auto() + # Twisted version is not available. + NotInstalled = auto() + + +def _get_twisted_version() -> TwistedVersion: + # We need to check if "twisted.trial.unittest" is specifically present in sys.modules. + # This is because we intend to integrate with Trial only when it's actively running + # the test suite, but not needed when only other Twisted components are in use. + if "twisted.trial.unittest" not in sys.modules: + return TwistedVersion.NotInstalled + + import importlib.metadata + + import packaging.version + + version_str = importlib.metadata.version("twisted") + version = packaging.version.parse(version_str) + if version.major <= 24: + return TwistedVersion.Version24 + else: + return TwistedVersion.Version25 + + +# Name of the attribute in `twisted.python.Failure` instances that stores +# the `sys.exc_info()` tuple. +# See twisted.trial support in `pytest_runtest_protocol`. +TWISTED_RAW_EXCINFO_ATTR = "_twisted_raw_excinfo" @hookimpl(wrapper=True) -def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: - if isinstance(item, TestCaseFunction) and "twisted.trial.unittest" in sys.modules: - ut: Any = sys.modules["twisted.python.failure"] - global classImplements_has_run - Failure__init__ = ut.Failure.__init__ - if not classImplements_has_run: - from twisted.trial.itrial import IReporter - from zope.interface import classImplements - - classImplements(TestCaseFunction, IReporter) - classImplements_has_run = True - - def excstore( +def pytest_runtest_protocol(item: Item) -> Iterator[None]: + if _get_twisted_version() is TwistedVersion.Version24: + import twisted.python.failure as ut + + # Monkeypatch `Failure.__init__` to store the raw exception info. + original__init__ = ut.Failure.__init__ + + def store_raw_exception_info( self, exc_value=None, exc_type=None, exc_tb=None, captureVars=None - ): + ): # pragma: no cover if exc_value is None: - self._rawexcinfo = sys.exc_info() + raw_exc_info = sys.exc_info() else: if exc_type is None: exc_type = type(exc_value) - self._rawexcinfo = (exc_type, exc_value, exc_tb) + if exc_tb is None: + exc_tb = sys.exc_info()[2] + raw_exc_info = (exc_type, exc_value, exc_tb) + setattr(self, TWISTED_RAW_EXCINFO_ATTR, tuple(raw_exc_info)) try: - Failure__init__( + original__init__( self, exc_value, exc_type, exc_tb, captureVars=captureVars ) - except TypeError: - Failure__init__(self, exc_value, exc_type, exc_tb) + except TypeError: # pragma: no cover + original__init__(self, exc_value, exc_type, exc_tb) - ut.Failure.__init__ = excstore - try: - res = yield - finally: - ut.Failure.__init__ = Failure__init__ + with MonkeyPatch.context() as patcher: + patcher.setattr(ut.Failure, "__init__", store_raw_exception_info) + return (yield) else: - res = yield - return res - - -def _is_skipped(obj) -> bool: - """Return True if the given object has been marked with @unittest.skip.""" - return bool(getattr(obj, "__unittest_skip__", False)) + return (yield) + + +def _handle_twisted_exc_info( + rawexcinfo: _SysExcInfoType | BaseException, +) -> _SysExcInfoType: + """ + Twisted passes a custom Failure instance to `addError()` instead of using `sys.exc_info()`. + Therefore, if `rawexcinfo` is a `Failure` instance, convert it into the equivalent `sys.exc_info()` tuple + as expected by pytest. + """ + twisted_version = _get_twisted_version() + if twisted_version is TwistedVersion.NotInstalled: + # Unfortunately, because we cannot import `twisted.python.failure` at the top of the file + # and use it in the signature, we need to use `type:ignore` here because we cannot narrow + # the type properly in the `if` statement above. + return rawexcinfo # type:ignore[return-value] + elif twisted_version is TwistedVersion.Version24: + # Twisted calls addError() passing its own classes (like `twisted.python.Failure`), which violates + # the `addError()` signature, so we extract the original `sys.exc_info()` tuple which is stored + # in the object. + if hasattr(rawexcinfo, TWISTED_RAW_EXCINFO_ATTR): + saved_exc_info = getattr(rawexcinfo, TWISTED_RAW_EXCINFO_ATTR) + # Delete the attribute from the original object to avoid leaks. + delattr(rawexcinfo, TWISTED_RAW_EXCINFO_ATTR) + return saved_exc_info # type:ignore[no-any-return] + return rawexcinfo # type:ignore[return-value] + elif twisted_version is TwistedVersion.Version25: + if isinstance(rawexcinfo, BaseException): + import twisted.python.failure + + if isinstance(rawexcinfo, twisted.python.failure.Failure): + tb = rawexcinfo.__traceback__ + if tb is None: + tb = sys.exc_info()[2] + return type(rawexcinfo.value), rawexcinfo.value, tb + + return rawexcinfo # type:ignore[return-value] + else: + # Ideally we would use assert_never() here, but it is not available in all Python versions + # we support, plus we do not require `type_extensions` currently. + assert False, f"Unexpected Twisted version: {twisted_version}" diff --git a/tox.ini b/tox.ini index 8f7d8495285..f1283aa8260 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ envlist = py313 py314 pypy3 - py39-{pexpect,xdist,unittestextras,numpy,pluggymain,pylib} + py39-{pexpect,xdist,twisted24,twisted25,asynctest,numpy,pluggymain,pylib} doctesting doctesting-coverage plugins @@ -36,7 +36,9 @@ description = pexpect: against `pexpect` pluggymain: against the bleeding edge `pluggy` from Git pylib: against `py` lib - unittestextras: against the unit test extras + twisted24: against the unit test extras with twisted prior to 24.0 + twisted25: against the unit test extras with twisted 25.0 or later + asynctest: against the unit test extras with asynctest xdist: with pytest in parallel mode under `{basepython}` doctesting: including doctests @@ -51,7 +53,7 @@ passenv = TERM SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST setenv = - _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} + _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} {env:_PYTEST_FILES:} # See https://docs.python.org/3/library/io.html#io-encoding-warning # If we don't enable this, neither can any of our downstream users! @@ -66,6 +68,12 @@ setenv = doctesting: _PYTEST_TOX_POSARGS_DOCTESTING=doc/en + # The configurations below are related only to standard unittest support. + # Run only tests from test_unittest.py. + asynctest: _PYTEST_FILES=testing/test_unittest.py + twisted24: _PYTEST_FILES=testing/test_unittest.py + twisted25: _PYTEST_FILES=testing/test_unittest.py + nobyte: PYTHONDONTWRITEBYTECODE=1 lsof: _PYTEST_TOX_POSARGS_LSOF=--lsof @@ -79,8 +87,9 @@ deps = pexpect: pexpect>=4.8.0 pluggymain: pluggy @ git+https://github.com/pytest-dev/pluggy.git pylib: py>=1.8.2 - unittestextras: twisted - unittestextras: asynctest + twisted24: twisted<25 + twisted25: twisted>=25 + asynctest: asynctest xdist: pytest-xdist>=2.1.0 xdist: -e . {env:_PYTEST_TOX_EXTRA_DEP:} From 40a1713d42187732d0095dd1623b1424fb2bc489 Mon Sep 17 00:00:00 2001 From: Iwithyou2025 Date: Wed, 18 Jun 2025 05:11:07 +0800 Subject: [PATCH 016/270] docs: update pytest.ini addopts example to use separate -p entries (#13529) --- doc/en/how-to/plugins.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/plugins.rst b/doc/en/how-to/plugins.rst index fca8ab54e63..b2cb1cda5c3 100644 --- a/doc/en/how-to/plugins.rst +++ b/doc/en/how-to/plugins.rst @@ -154,7 +154,10 @@ manually specify each plugin with ``-p`` or :envvar:`PYTEST_PLUGINS`, you can us .. code-block:: ini [pytest] - addopts = --disable-plugin-autoload -p NAME,NAME2 + addopts = + --disable-plugin-autoload + -p NAME + -p NAME2 .. versionadded:: 8.4 From 7f31f3e9a2d2ad429ad11712e42f5580fee5bc05 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 16 Jun 2025 20:43:37 +0300 Subject: [PATCH 017/270] ci: replace softprops/action-gh-release with `gh release create` command Seems better to avoid 3rd party actions when possible. --- .github/workflows/deploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9e63bc68cfd..ba593c7c3a9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -109,8 +109,8 @@ jobs: tox -e generate-gh-release-notes -- "$VERSION" scripts/latest-release-notes.md - name: Publish GitHub Release - uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 - with: - body_path: scripts/latest-release-notes.md - files: dist/* - tag_name: ${{ github.event.inputs.version }} + env: + VERSION: ${{ github.event.inputs.version }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create --notes-file scripts/latest-release-notes.md --verify-tag "$VERSION" dist/* From 210bdde65cb70433c55bc017f9ed08d549bcac57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 03:59:57 +0000 Subject: [PATCH 018/270] build(deps): Bump pytest-asyncio in /testing/plugins_integration Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.26.0 to 1.0.0. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.26.0...v1.0.0) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-version: 1.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index e8010b23113..478f43d8926 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[trio]==4.9.0 django==5.2.1 -pytest-asyncio==0.26.0 +pytest-asyncio==1.0.0 pytest-bdd==8.1.0 pytest-cov==6.1.1 pytest-django==4.11.1 From 1367e030b75292342bcdf3b7933696bd4a14295a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 03:59:53 +0000 Subject: [PATCH 019/270] build(deps): Bump pytest-cov in /testing/plugins_integration Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.1.1 to 6.2.1. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.1.1...v6.2.1) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 6.2.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index e8010b23113..e9c78e401ad 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -2,7 +2,7 @@ anyio[trio]==4.9.0 django==5.2.1 pytest-asyncio==0.26.0 pytest-bdd==8.1.0 -pytest-cov==6.1.1 +pytest-cov==6.2.1 pytest-django==4.11.1 pytest-flakes==4.0.5 pytest-html==4.1.1 From a1934ae1dddda62177ce173e62ff13f715a1f875 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 18 Jun 2025 10:01:23 +0300 Subject: [PATCH 020/270] Cherry pick 8.4.1 release notes Release 8.4.1 (cherry picked from commit 08571152685ab5606efeb879310cb647fb8de50d) --- changelog/13461.bugfix.rst | 3 --- changelog/13477.bugfix.rst | 5 ----- changelog/13492.doc.rst | 1 - changelog/13497.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-8.4.1.rst | 21 +++++++++++++++++++++ doc/en/changelog.rst | 28 ++++++++++++++++++++++++++++ doc/en/example/parametrize.rst | 6 +++--- doc/en/example/pythoncollection.rst | 4 ++-- doc/en/getting-started.rst | 2 +- doc/en/how-to/fixtures.rst | 2 +- 11 files changed, 57 insertions(+), 17 deletions(-) delete mode 100644 changelog/13461.bugfix.rst delete mode 100644 changelog/13477.bugfix.rst delete mode 100644 changelog/13492.doc.rst delete mode 100644 changelog/13497.bugfix.rst create mode 100644 doc/en/announce/release-8.4.1.rst diff --git a/changelog/13461.bugfix.rst b/changelog/13461.bugfix.rst deleted file mode 100644 index 4b45f7cc9da..00000000000 --- a/changelog/13461.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -Corrected ``_pytest.terminal.TerminalReporter.isatty`` to support -being called as a method. Before it was just a boolean which could -break correct code when using ``-o log_cli=true``). diff --git a/changelog/13477.bugfix.rst b/changelog/13477.bugfix.rst deleted file mode 100644 index 7b7f875df09..00000000000 --- a/changelog/13477.bugfix.rst +++ /dev/null @@ -1,5 +0,0 @@ -Reintroduced :class:`pytest.PytestReturnNotNoneWarning` which was removed by accident in pytest `8.4`. - -This warning is raised when a test functions returns a value other than ``None``, which is often a mistake made by beginners. - -See :ref:`return-not-none` for more information. diff --git a/changelog/13492.doc.rst b/changelog/13492.doc.rst deleted file mode 100644 index 6e3f72a860e..00000000000 --- a/changelog/13492.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed outdated warning about ``faulthandler`` not working on Windows. diff --git a/changelog/13497.bugfix.rst b/changelog/13497.bugfix.rst deleted file mode 100644 index 75b4996e5af..00000000000 --- a/changelog/13497.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed compatibility with ``Twisted 25+``. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 702fd26dd0d..2ed23eb1fbb 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-8.4.1 release-8.4.0 release-8.3.5 release-8.3.4 diff --git a/doc/en/announce/release-8.4.1.rst b/doc/en/announce/release-8.4.1.rst new file mode 100644 index 00000000000..07ee26187a7 --- /dev/null +++ b/doc/en/announce/release-8.4.1.rst @@ -0,0 +1,21 @@ +pytest-8.4.1 +======================================= + +pytest 8.4.1 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Bruno Oliveira +* Iwithyou2025 +* John Litborn +* Martin Fischer +* Ran Benita +* SarahPythonista + + +Happy testing, +The pytest Development Team diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 73073ffca1c..63623de8aad 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -31,6 +31,34 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 8.4.1 (2025-06-17) +========================= + +Bug fixes +--------- + +- `#13461 `_: Corrected ``_pytest.terminal.TerminalReporter.isatty`` to support + being called as a method. Before it was just a boolean which could + break correct code when using ``-o log_cli=true``). + + +- `#13477 `_: Reintroduced :class:`pytest.PytestReturnNotNoneWarning` which was removed by accident in pytest `8.4`. + + This warning is raised when a test functions returns a value other than ``None``, which is often a mistake made by beginners. + + See :ref:`return-not-none` for more information. + + +- `#13497 `_: Fixed compatibility with ``Twisted 25+``. + + + +Improved documentation +---------------------- + +- `#13492 `_: Fixed outdated warning about ``faulthandler`` not working on Windows. + + pytest 8.4.0 (2025-06-02) ========================= diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index a7ec55dff0a..8e6479254bb 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 - + diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 760140390cb..01a8f48fdbf 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -152,7 +152,7 @@ The test collection would look like this: configfile: pytest.ini collected 2 items - + @@ -215,7 +215,7 @@ You can always peek at the collection tree without running tests like this: configfile: pytest.ini collected 3 items - + diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index c92e97f556e..c5e9f708828 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 8.4.0 + pytest 8.4.1 .. _`simpletest`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index a86fd1065fd..62ace745d43 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 - + From a3d3918a3253a99ad81e2e6e7862c58df19a8f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 3 Jun 2025 11:08:56 +0200 Subject: [PATCH 021/270] testing: Explicitly pass `-Werror` to tests needing it Explicitly pass `-Werror` to `runpytester()` in the few additional tests needing it, in order to fix test failures when the test suite is run with `-Wdefault` or a similar override. Fixes #13480 --- changelog/13480.bugfix.rst | 1 + testing/test_threadexception.py | 2 +- testing/test_warnings.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/13480.bugfix.rst diff --git a/changelog/13480.bugfix.rst b/changelog/13480.bugfix.rst new file mode 100644 index 00000000000..ed649a33516 --- /dev/null +++ b/changelog/13480.bugfix.rst @@ -0,0 +1 @@ +Fixed a few test failures in pytest's own test suite when run with ``-Wdefault`` or a similar override. diff --git a/testing/test_threadexception.py b/testing/test_threadexception.py index 5dad07b8b85..f4595ec435d 100644 --- a/testing/test_threadexception.py +++ b/testing/test_threadexception.py @@ -211,7 +211,7 @@ def test_it(request): """ ) - result = pytester.runpytest() + result = pytester.runpytest("-Werror") # TODO: should be a test failure or error assert result.ret == pytest.ExitCode.INTERNAL_ERROR diff --git a/testing/test_warnings.py b/testing/test_warnings.py index c302e7c6e3c..b1c64dc9332 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -149,6 +149,7 @@ def test_func(fix): ) +@pytest.mark.skip("issue #13485") def test_works_with_filterwarnings(pytester: Pytester) -> None: """Ensure our warnings capture does not mess with pre-installed filters (#2430).""" pytester.makepyfile( From fa678075840aa5bea55325d5c05e18914d9d205a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 07:49:14 +0000 Subject: [PATCH 022/270] [pre-commit.ci] pre-commit autoupdate (#13501) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.12 → v0.11.13](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.12...v0.11.13) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd43937f8a0..62274b2de7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.12" + rev: "v0.11.13" hooks: - id: ruff args: ["--fix"] @@ -48,7 +48,7 @@ repos: # on <3.11 - exceptiongroup>=1.0.0rc8 - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.401 + rev: v1.1.402 hooks: - id: pyright files: ^(src/|scripts/) From c3084d39b9657fba904baa5374c534d358aa67e2 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 16 Jun 2025 10:29:45 +0300 Subject: [PATCH 023/270] pytester: fix subprocess mode ignores all `pytester.plugins` except the first As far as I can see, there is no reason for this, seems like a mistake. --- changelog/13522.bugfix.rst | 1 + src/_pytest/pytester.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog/13522.bugfix.rst diff --git a/changelog/13522.bugfix.rst b/changelog/13522.bugfix.rst new file mode 100644 index 00000000000..2c785485e1a --- /dev/null +++ b/changelog/13522.bugfix.rst @@ -0,0 +1 @@ +Fixed :fixture:`pytester` in subprocess mode ignored all :attr`pytester.plugins ` except the first. diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 59d2b0befe9..360f640474c 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1494,9 +1494,9 @@ def runpytest_subprocess( __tracebackhide__ = True p = make_numbered_dir(root=self.path, prefix="runpytest-", mode=0o700) args = (f"--basetemp={p}", *args) - plugins = [x for x in self.plugins if isinstance(x, str)] - if plugins: - args = ("-p", plugins[0], *args) + for plugin in self.plugins: + if isinstance(plugin, str): + args = ("-p", plugin, *args) args = self._getpytestargs() + args return self.run(*args, timeout=timeout) From 76d62a34c7e26f7deda8820c53bfea449f64e5a7 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 16 Jun 2025 10:40:46 +0300 Subject: [PATCH 024/270] pytester: avoid a type: ignore --- src/_pytest/pytester.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 360f640474c..587af5ad6c6 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1229,10 +1229,9 @@ def parseconfig(self, *args: str | os.PathLike[str]) -> Config: """ import _pytest.config - new_args = self._ensure_basetemp(args) - new_args = [str(x) for x in new_args] + new_args = [str(x) for x in self._ensure_basetemp(args)] - config = _pytest.config._prepareconfig(new_args, self.plugins) # type: ignore[arg-type] + config = _pytest.config._prepareconfig(new_args, self.plugins) # we don't know what the test will do with this half-setup config # object and thus we make sure it gets unconfigured properly in any # case (otherwise capturing could still be active, for example) From d66a761dc91283556c768e59371dc62d6880c296 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 18 Jun 2025 06:13:14 -0300 Subject: [PATCH 025/270] prepare-release-pr: open PRs as draft (#13534) This way we can trigger the CI jobs just by marking the draft as ready, similar to how the `update-plugin-list` workflow works. --- scripts/prepare-release-pr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/prepare-release-pr.py b/scripts/prepare-release-pr.py index c420a80b3d2..b288e3b3982 100644 --- a/scripts/prepare-release-pr.py +++ b/scripts/prepare-release-pr.py @@ -135,6 +135,7 @@ def prepare_release_pr(base_branch: str, is_major: bool, prerelease: str) -> Non f"--head={release_branch}", f"--title=Release {version}", f"--body={body}", + "--draft", ], check=True, ) From 5a7a91b4188fa749aa2d9de72c1a57fab381f1b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 06:14:50 -0300 Subject: [PATCH 026/270] build(deps): Bump twisted in /testing/plugins_integration (#13521) Bumps [twisted](https://github.com/twisted/twisted) from 24.11.0 to 25.5.0. - [Release notes](https://github.com/twisted/twisted/releases) - [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst) - [Commits](https://github.com/twisted/twisted/compare/twisted-24.11.0...twisted-25.5.0) --- updated-dependencies: - dependency-name: twisted dependency-version: 25.5.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index d4fcfd8f5ea..9959c66b350 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -11,5 +11,5 @@ pytest-rerunfailures==15.1 pytest-sugar==1.0.0 pytest-trio==0.8.0 pytest-twisted==1.14.3 -twisted==24.11.0 +twisted==25.5.0 pytest-xvfb==3.1.1 From d32a34533e03c4f8674de880129b0a565f373d08 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 16 Jun 2025 10:41:04 +0300 Subject: [PATCH 027/270] pytester: error on non-str `pytester.plugins` in subprocess mode instead of silently ignoring In subprocess mode, adding a non-str plugin object to `pytester.plugins` can't work. Previously, such plugins would just be silently ignored. Silently ignoring an explicit setup doesn't seem right. Error instead. --- changelog/13522.bugfix.rst | 4 ++++ src/_pytest/pytester.py | 16 +++++++++++----- testing/test_pytester.py | 22 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/changelog/13522.bugfix.rst b/changelog/13522.bugfix.rst index 2c785485e1a..683304251aa 100644 --- a/changelog/13522.bugfix.rst +++ b/changelog/13522.bugfix.rst @@ -1 +1,5 @@ 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/src/_pytest/pytester.py b/src/_pytest/pytester.py index 587af5ad6c6..de4e2c8b136 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -682,9 +682,11 @@ def __init__( self._name = name self._path: Path = tmp_path_factory.mktemp(name, numbered=True) #: A list of plugins to use with :py:meth:`parseconfig` and - #: :py:meth:`runpytest`. Initially this is an empty list but plugins can - #: be added to the list. The type of items to add to the list depends on - #: the method using them so refer to them for details. + #: :py:meth:`runpytest`. Initially this is an empty list but plugins can + #: be added to the list. + #: + #: When running in subprocess mode, specify plugins by name (str) - adding + #: plugin objects directly is not supported. self.plugins: list[str | _PluggyPlugin] = [] self._sys_path_snapshot = SysPathsSnapshot() self._sys_modules_snapshot = self.__take_sys_modules_snapshot() @@ -1494,8 +1496,12 @@ def runpytest_subprocess( p = make_numbered_dir(root=self.path, prefix="runpytest-", mode=0o700) args = (f"--basetemp={p}", *args) for plugin in self.plugins: - if isinstance(plugin, str): - args = ("-p", plugin, *args) + if not isinstance(plugin, str): + raise ValueError( + f"Specifying plugins as objects is not supported in pytester subprocess mode; " + f"specify by name instead: {plugin}" + ) + args = ("-p", plugin, *args) args = self._getpytestargs() + args return self.run(*args, timeout=timeout) diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 721e8c19d8b..a5ac8a91b8d 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -834,3 +834,25 @@ def test_two(): result.assert_outcomes(passed=1, deselected=1) # If deselected is not passed, it is not checked at all. result.assert_outcomes(passed=1) + + +def test_pytester_subprocess_with_string_plugins(pytester: Pytester) -> None: + """Test that pytester.runpytest_subprocess is OK with named (string) + `.plugins`.""" + pytester.plugins = ["pytester"] + + result = pytester.runpytest_subprocess() + assert result.ret == ExitCode.NO_TESTS_COLLECTED + + +def test_pytester_subprocess_with_non_string_plugins(pytester: Pytester) -> None: + """Test that pytester.runpytest_subprocess fails with a proper error given + non-string `.plugins`.""" + + class MyPlugin: + pass + + pytester.plugins = [MyPlugin()] + + with pytest.raises(ValueError, match="plugins as objects is not supported"): + pytester.runpytest_subprocess() From 48be3c8bce38bc950dba82747d3ecf451a3f45c8 Mon Sep 17 00:00:00 2001 From: bengartner Date: Sun, 22 Jun 2025 10:24:28 -0500 Subject: [PATCH 028/270] Self-test: fix test_doctest_unexpected_exception in Python 3.14 (#13548) Fixes #13547. --- changelog/13547.contrib.rst | 1 + testing/test_doctest.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 changelog/13547.contrib.rst diff --git a/changelog/13547.contrib.rst b/changelog/13547.contrib.rst new file mode 100644 index 00000000000..d8a240c0506 --- /dev/null +++ b/changelog/13547.contrib.rst @@ -0,0 +1 @@ +Self-testing: corrected expected message for ``test_doctest_unexpected_exception`` in Python ``3.14``. diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 1a852ebc82a..f4ed976c839 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -223,9 +223,12 @@ def test_doctest_unexpected_exception(self, pytester: Pytester): "002 >>> 0 / i", "UNEXPECTED EXCEPTION: ZeroDivisionError*", "Traceback (most recent call last):", - ' File "*/doctest.py", line *, in __run', - " *", - *((" *^^^^*", " *", " *") if sys.version_info >= (3, 13) else ()), + *( + (' File "*/doctest.py", line *, in __run', " *") + if sys.version_info <= (3, 14) + else () + ), + *((" *^^^^*", " *", " *") if sys.version_info[:2] == (3, 13) else ()), ' File "", line 1, in ', "ZeroDivisionError: division by zero", "*/test_doctest_unexpected_exception.txt:2: UnexpectedException", From 8ca783cf4a3b4007f513a7446b7069d4dac52587 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sun, 22 Jun 2025 17:49:52 +0200 Subject: [PATCH 029/270] Defer annotation eval on Python 3.14 (#13550) Fixes #13549 --- changelog/13549.bugfix.rst | 3 +++ src/_pytest/compat.py | 13 ++++++++++++- src/_pytest/fixtures.py | 5 +++-- src/_pytest/nodes.py | 2 +- testing/test_collection.py | 40 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 changelog/13549.bugfix.rst diff --git a/changelog/13549.bugfix.rst b/changelog/13549.bugfix.rst new file mode 100644 index 00000000000..e69f6a4d6cf --- /dev/null +++ b/changelog/13549.bugfix.rst @@ -0,0 +1,3 @@ +No longer evaluate type annotations in Python ``3.14`` when inspecting function signatures. + +This prevents crashes during module collection when modules do not explicitly use ``from __future__ import annotations`` and import types for annotations within a ``if TYPE_CHECKING:`` block. diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 7d71838be51..bef8c317bb9 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -8,7 +8,7 @@ import functools import inspect from inspect import Parameter -from inspect import signature +from inspect import Signature import os from pathlib import Path import sys @@ -19,6 +19,10 @@ import py +if sys.version_info >= (3, 14): + from annotationlib import Format + + #: constant to prepare valuing pylib path replacements/lazy proxies later on # intended for removal in pytest 8.0 or 9.0 @@ -60,6 +64,13 @@ def is_async_function(func: object) -> bool: return iscoroutinefunction(func) or inspect.isasyncgenfunction(func) +def signature(obj: Callable[..., Any]) -> Signature: + """Return signature without evaluating annotations.""" + if sys.version_info >= (3, 14): + return inspect.signature(obj, annotation_format=Format.STRING) + return inspect.signature(obj) + + def getlocation(function, curdir: str | os.PathLike[str] | None = None) -> str: function = get_real_func(function) fn = Path(inspect.getfile(function)) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 9966e3414c8..bc5805aaea9 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -49,6 +49,7 @@ from _pytest.compat import NotSetType from _pytest.compat import safe_getattr from _pytest.compat import safe_isclass +from _pytest.compat import signature from _pytest.config import _PluggyPlugin from _pytest.config import Config from _pytest.config import ExitCode @@ -804,8 +805,8 @@ def _format_fixturedef_line(self, fixturedef: FixtureDef[object]) -> str: path, lineno = getfslineno(factory) if isinstance(path, Path): path = bestrelpath(self._pyfuncitem.session.path, path) - signature = inspect.signature(factory) - return f"{path}:{lineno + 1}: def {factory.__name__}{signature}" + sig = signature(factory) + return f"{path}:{lineno + 1}: def {factory.__name__}{sig}" def addfinalizer(self, finalizer: Callable[[], object]) -> None: self._fixturedef.addfinalizer(finalizer) diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index 6d39de95f5b..6690f6ab1f8 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -8,7 +8,6 @@ from collections.abc import MutableMapping from functools import cached_property from functools import lru_cache -from inspect import signature import os import pathlib from pathlib import Path @@ -29,6 +28,7 @@ from _pytest._code.code import Traceback from _pytest._code.code import TracebackStyle from _pytest.compat import LEGACY_PATH +from _pytest.compat import signature from _pytest.config import Config from _pytest.config import ConftestImportFailure from _pytest.config.compat import _check_path diff --git a/testing/test_collection.py b/testing/test_collection.py index dfe10a65220..a8bff2847ba 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1895,3 +1895,43 @@ def test_with_yield(): ) # Assert that no tests were collected result.stdout.fnmatch_lines(["*collected 0 items*"]) + + +def test_annotations_deferred_future(pytester: Pytester): + """Ensure stringified annotations don't raise any errors.""" + pytester.makepyfile( + """ + from __future__ import annotations + import pytest + + @pytest.fixture + def func() -> X: ... # X is undefined + + def test_func(): + assert True + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + result.stdout.fnmatch_lines(["*1 passed*"]) + + +@pytest.mark.skipif( + sys.version_info < (3, 14), reason="Annotations are only skipped on 3.14+" +) +def test_annotations_deferred_314(pytester: Pytester): + """Ensure annotation eval is deferred.""" + pytester.makepyfile( + """ + import pytest + + @pytest.fixture + def func() -> X: ... # X is undefined + + def test_func(): + assert True + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + result.stdout.fnmatch_lines(["*1 passed*"]) From 9ea2a467823236f3ef24cc41bca44013736e1390 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Jun 2025 16:19:10 +0000 Subject: [PATCH 030/270] [automated] Update plugin list (#13551) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 132 ++++++++++++++++++------------- 1 file changed, 78 insertions(+), 54 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 66a3912e5a2..4a278a8f7d1 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =7.1.1,<8.0.0) - :pypi:`pytest-api-framework` pytest framework Jun 14, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Jun 11, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework` pytest framework Jun 20, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Jun 20, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -166,7 +166,7 @@ This list contains 1647 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 13, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 20, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -204,7 +204,7 @@ This list contains 1647 plugins. :pypi:`pytest_browserstack` Py.test plugin for BrowserStack Jan 27, 2016 4 - Beta N/A :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A :pypi:`pytest-budosystems` Budo Systems is a martial arts school management system. This module is the Budo Systems Pytest Plugin. May 07, 2023 3 - Alpha pytest - :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jun 05, 2024 5 - Production/Stable pytest>=8.0.0 + :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jun 17, 2025 5 - Production/Stable pytest>=8.4.0 :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A :pypi:`pytest-bugzilla-notifier` A plugin that allows you to execute create, update, and read information from BugZilla bugs Jun 15, 2018 4 - Beta pytest (>=2.9.2) @@ -468,7 +468,7 @@ This list contains 1647 plugins. :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 - :pypi:`pytest-dsl` A DSL testing framework based on pytest Jun 11, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl` A DSL testing framework based on pytest Jun 18, 2025 N/A pytest>=7.0.0 :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jun 10, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A @@ -491,15 +491,15 @@ This list contains 1647 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Apr 22, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Apr 22, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Apr 22, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Apr 22, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Apr 22, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Apr 22, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Apr 22, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Apr 22, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Apr 22, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Jun 19, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Jun 19, 2025 5 - Production/Stable N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 09, 2023 4 - Beta pytest (==7.0.1) @@ -751,14 +751,14 @@ This list contains 1647 plugins. :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A :pypi:`pytest-info-plugin` Get executed interface information in pytest interface automation framework Sep 14, 2023 N/A N/A :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A - :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Mar 18, 2025 4 - Beta pytest~=8.3 + :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Jun 21, 2025 4 - Beta pytest~=8.3 :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-initry` Plugin for sending automation test data from Pytest to the initry Apr 30, 2024 N/A pytest<9.0.0,>=8.1.1 :pypi:`pytest-inline` A pytest plugin for writing inline tests Oct 24, 2024 4 - Beta pytest<9.0,>=7.0 :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Apr 09, 2025 5 - Production/Stable pytest :pypi:`pytest-inmanta-extensions` Inmanta tests package May 27, 2025 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 09, 2025 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 19, 2025 5 - Production/Stable N/A :pypi:`pytest-inmanta-srlinux` Pytest library to facilitate end to end testing of inmanta projects Apr 22, 2025 3 - Alpha N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Feb 22, 2024 4 - Beta pytest :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A @@ -778,7 +778,7 @@ This list contains 1647 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest - :pypi:`pytest-ipywidgets` May 30, 2025 N/A pytest + :pypi:`pytest-ipywidgets` Jun 19, 2025 N/A pytest :pypi:`pytest-iso` Plugin for pytest to produce test documentation for code audits. May 15, 2025 4 - Beta pytest<9.0.0,>=7.4.0 :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Jun 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 @@ -807,7 +807,7 @@ This list contains 1647 plugins. :pypi:`pytest-json-report-wip` A pytest plugin to report test results as JSON files Oct 28, 2023 4 - Beta pytest >=3.8.0 :pypi:`pytest-jsonschema` A pytest plugin to perform JSONSchema validations Apr 20, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-jtr` pytest plugin supporting json test report output Jul 21, 2024 N/A pytest<8.0.0,>=7.1.2 - :pypi:`pytest-jubilant` Add your description here May 14, 2025 N/A pytest>=8.3.5 + :pypi:`pytest-jubilant` Add your description here Jun 19, 2025 N/A pytest>=8.3.5 :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Apr 04, 2024 4 - Beta pytest>=7.0 :pypi:`pytest-jupyterhub` A reusable JupyterHub pytest plugin Apr 25, 2023 5 - Production/Stable pytest @@ -1006,7 +1006,7 @@ This list contains 1647 plugins. :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Feb 26, 2024 5 - Production/Stable N/A :pypi:`pytest-oar` PyTest plugin for the OAR testing framework May 12, 2025 N/A pytest>=6.0.1 - :pypi:`pytest-oarepo` Jun 13, 2025 N/A pytest>=7.1.2; extra == "base" + :pypi:`pytest-oarepo` Jun 19, 2025 N/A pytest>=7.1.2; extra == "base" :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odc` A pytest plugin for simplifying ODC database tests Aug 04, 2023 4 - Beta pytest (>=3.5.0) @@ -1045,7 +1045,7 @@ This list contains 1647 plugins. :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) :pypi:`pytest-parametrization` Simpler PyTest parametrization May 22, 2022 5 - Production/Stable N/A :pypi:`pytest-parametrization-annotation` A pytest library for parametrizing tests using type hints. Dec 10, 2024 5 - Production/Stable pytest>=7 - :pypi:`pytest-parametrize` pytest decorator for parametrizing test cases in a dict-way Nov 10, 2024 5 - Production/Stable pytest<9.0.0,>=8.3.0 + :pypi:`pytest-parametrize` pytest decorator for parametrizing test cases in a dict-way Jun 15, 2025 5 - Production/Stable pytest<9.0.0,>=8.3.0 :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-parametrized` Pytest decorator for parametrizing tests with default iterables. Dec 21, 2024 5 - Production/Stable pytest :pypi:`pytest-parametrize-suite` A simple pytest extension for creating a named test suite. Jan 19, 2023 5 - Production/Stable pytest @@ -1101,6 +1101,7 @@ This list contains 1647 plugins. :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Jun 21, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1200,6 +1201,7 @@ This list contains 1647 plugins. :pypi:`pytest-ranking` A Pytest plugin for faster fault detection via regression test prioritization Apr 08, 2025 4 - Beta pytest>=7.4.3 :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. Sep 04, 2024 3 - Alpha N/A + :pypi:`pytest-recap` Capture your test sessions. Recap the results. Jun 16, 2025 N/A pytest>=6.2.0 :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Mar 31, 2025 N/A N/A :pypi:`pytest-recording` A pytest plugin powered by VCR.py to record and replay HTTP traffic May 08, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A @@ -1229,7 +1231,7 @@ This list contains 1647 plugins. :pypi:`pytest-reporter` Generate Pytest reports with templates Feb 28, 2024 4 - Beta pytest :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest May 06, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A - :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jun 12, 2025 N/A N/A + :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jun 21, 2025 N/A N/A :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Jun 12, 2025 N/A pytest>=8.0.0 :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) @@ -1263,7 +1265,7 @@ This list contains 1647 plugins. :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Oct 24, 2024 5 - Production/Stable pytest :pypi:`pytest-result-log` A pytest plugin that records the start, end, and result information of each use case in a log file Jan 10, 2024 N/A pytest>=7.2.0 :pypi:`pytest-result-notify` Default template for PDM package Apr 27, 2025 N/A pytest>=8.3.5 - :pypi:`pytest-results` Easily spot regressions in your tests. May 06, 2025 4 - Beta pytest + :pypi:`pytest-results` Easily spot regressions in your tests. Jun 15, 2025 4 - Beta pytest :pypi:`pytest-result-sender` Apr 20, 2023 N/A pytest>=7.3.1 :pypi:`pytest-result-sender-jms` Default template for PDM package May 22, 2025 N/A pytest>=8.3.5 :pypi:`pytest-result-sender-lj` Default template for PDM package Dec 17, 2024 N/A pytest>=8.3.4 @@ -1291,7 +1293,7 @@ This list contains 1647 plugins. :pypi:`pytest-rst` Test code from RST documents with pytest Jan 26, 2023 N/A N/A :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest - :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Jul 21, 2024 4 - Beta pytest>=5 + :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Jun 19, 2025 4 - Beta pytest>=5 :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Jun 10, 2025 4 - Beta pytest>=6.2.0 @@ -1311,7 +1313,7 @@ This list contains 1647 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 12, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 17, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1323,12 +1325,12 @@ This list contains 1647 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 12, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 17, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 :pypi:`pytest-send-email` Send pytest execution result email Sep 02, 2024 N/A pytest - :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io May 23, 2025 N/A pytest + :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Jun 16, 2025 N/A pytest :pypi:`pytest-sequence-markers` Pytest plugin for sequencing markers for execution of tests May 23, 2023 5 - Production/Stable N/A :pypi:`pytest-server` test server exec cmd Sep 09, 2024 N/A N/A :pypi:`pytest-server-fixtures` Extensible server fixtures for py.test Nov 29, 2024 5 - Production/Stable pytest @@ -1565,6 +1567,7 @@ This list contains 1647 plugins. :pypi:`pytest-tutorials` Mar 11, 2023 N/A N/A :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Sep 10, 2024 5 - Production/Stable pytest>=2.3 + :pypi:`pytest-ty` A pytest plugin to run the ty type checker Jun 20, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typed-schema-shot` Pytest plugin for automatic JSON Schema generation and validation from examples Jun 14, 2025 N/A pytest :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -2079,14 +2082,14 @@ This list contains 1647 plugins. An ASGI middleware to populate OpenAPI Specification examples from pytest functions :pypi:`pytest-api-framework` - *last release*: Jun 14, 2025, + *last release*: Jun 20, 2025, *status*: N/A, *requires*: pytest==7.2.2 pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Jun 11, 2025, + *last release*: Jun 20, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2611,7 +2614,7 @@ This list contains 1647 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Jun 13, 2025, + *last release*: Jun 20, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -2877,9 +2880,9 @@ This list contains 1647 plugins. Budo Systems is a martial arts school management system. This module is the Budo Systems Pytest Plugin. :pypi:`pytest-bug` - *last release*: Jun 05, 2024, + *last release*: Jun 17, 2025, *status*: 5 - Production/Stable, - *requires*: pytest>=8.0.0 + *requires*: pytest>=8.4.0 Pytest plugin for marking tests as a bug @@ -4725,7 +4728,7 @@ This list contains 1647 plugins. A Pytest plugin to ignore tests during collection without reporting them in the test summary. :pypi:`pytest-dsl` - *last release*: Jun 11, 2025, + *last release*: Jun 18, 2025, *status*: N/A, *requires*: pytest>=7.0.0 @@ -4886,63 +4889,63 @@ This list contains 1647 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-idf` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: Apr 22, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -6706,7 +6709,7 @@ This list contains 1647 plugins. display more node ininformation. :pypi:`pytest-infrahouse` - *last release*: Mar 18, 2025, + *last release*: Jun 21, 2025, *status*: 4 - Beta, *requires*: pytest~=8.3 @@ -6755,7 +6758,7 @@ This list contains 1647 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Apr 09, 2025, + *last release*: Jun 19, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -6895,7 +6898,7 @@ This list contains 1647 plugins. Pytest plugin to run tests in Jupyter Notebooks :pypi:`pytest-ipywidgets` - *last release*: May 30, 2025, + *last release*: Jun 19, 2025, *status*: N/A, *requires*: pytest @@ -7098,7 +7101,7 @@ This list contains 1647 plugins. pytest plugin supporting json test report output :pypi:`pytest-jubilant` - *last release*: May 14, 2025, + *last release*: Jun 19, 2025, *status*: N/A, *requires*: pytest>=8.3.5 @@ -8491,7 +8494,7 @@ This list contains 1647 plugins. PyTest plugin for the OAR testing framework :pypi:`pytest-oarepo` - *last release*: Jun 13, 2025, + *last release*: Jun 19, 2025, *status*: N/A, *requires*: pytest>=7.1.2; extra == "base" @@ -8764,7 +8767,7 @@ This list contains 1647 plugins. A pytest library for parametrizing tests using type hints. :pypi:`pytest-parametrize` - *last release*: Nov 10, 2024, + *last release*: Jun 15, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9.0.0,>=8.3.0 @@ -9155,6 +9158,13 @@ This list contains 1647 plugins. A plugin to help developing and testing other plugins + :pypi:`pytest-plugins` + *last release*: Jun 21, 2025, + *status*: N/A, + *requires*: pytest + + A Python package for managing pytest plugins. + :pypi:`pytest-plus` *last release*: Feb 02, 2025, *status*: 5 - Production/Stable, @@ -9848,6 +9858,13 @@ This list contains 1647 plugins. Pytest fixtures for REANA. + :pypi:`pytest-recap` + *last release*: Jun 16, 2025, + *status*: N/A, + *requires*: pytest>=6.2.0 + + Capture your test sessions. Recap the results. + :pypi:`pytest-recorder` *last release*: Mar 31, 2025, *status*: N/A, @@ -10052,7 +10069,7 @@ This list contains 1647 plugins. A basic HTML report for pytest using Jinja2 template engine. :pypi:`pytest-reporter-plus` - *last release*: Jun 12, 2025, + *last release*: Jun 21, 2025, *status*: N/A, *requires*: N/A @@ -10290,7 +10307,7 @@ This list contains 1647 plugins. Default template for PDM package :pypi:`pytest-results` - *last release*: May 06, 2025, + *last release*: Jun 15, 2025, *status*: 4 - Beta, *requires*: pytest @@ -10486,7 +10503,7 @@ This list contains 1647 plugins. Coverage-based regression test selection (RTS) plugin for pytest :pypi:`pytest-ruff` - *last release*: Jul 21, 2024, + *last release*: Jun 19, 2025, *status*: 4 - Beta, *requires*: pytest>=5 @@ -10626,7 +10643,7 @@ This list contains 1647 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Jun 12, 2025, + *last release*: Jun 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10710,7 +10727,7 @@ This list contains 1647 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Jun 12, 2025, + *last release*: Jun 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10745,7 +10762,7 @@ This list contains 1647 plugins. Send pytest execution result email :pypi:`pytest-sentry` - *last release*: May 23, 2025, + *last release*: Jun 16, 2025, *status*: N/A, *requires*: pytest @@ -12403,6 +12420,13 @@ This list contains 1647 plugins. A twisted plugin for pytest. + :pypi:`pytest-ty` + *last release*: Jun 20, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0.0 + + A pytest plugin to run the ty type checker + :pypi:`pytest-typechecker` *last release*: Feb 04, 2022, *status*: N/A, From 111685cc506fbaf87c105e67d68fbd881a47a84b Mon Sep 17 00:00:00 2001 From: Aditi De <92822822+coder-aditi@users.noreply.github.com> Date: Sun, 22 Jun 2025 22:11:16 +0530 Subject: [PATCH 031/270] Fix `approx` usage with `decimal.FloatOperation` trap set (#13543) Fixes #13530 --------- Co-authored-by: AD Co-authored-by: Bruno Oliveira --- changelog/13530.bugfix.rst | 1 + src/_pytest/python_api.py | 19 +++++++++++++++++++ testing/python/approx.py | 6 ++++++ 3 files changed, 26 insertions(+) create mode 100644 changelog/13530.bugfix.rst diff --git a/changelog/13530.bugfix.rst b/changelog/13530.bugfix.rst new file mode 100644 index 00000000000..1a5ab365f12 --- /dev/null +++ b/changelog/13530.bugfix.rst @@ -0,0 +1 @@ +Fixed a crash when using :func:`pytest.approx` and :class:`decimal.Decimal` instances with the :class:`decimal.FloatOperation` trap set. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 07794abea95..b732b452683 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -530,6 +530,25 @@ class ApproxDecimal(ApproxScalar): DEFAULT_ABSOLUTE_TOLERANCE = Decimal("1e-12") DEFAULT_RELATIVE_TOLERANCE = Decimal("1e-6") + def __repr__(self) -> str: + if isinstance(self.rel, float): + rel = Decimal.from_float(self.rel) + else: + rel = self.rel + + if isinstance(self.abs, float): + abs_ = Decimal.from_float(self.abs) + else: + abs_ = self.abs + + tol_str = "???" + if rel is not None and Decimal("1e-3") <= rel <= Decimal("1e3"): + tol_str = f"{rel:.1e}" + elif abs_ is not None: + tol_str = f"{abs_:.1e}" + + return f"{self.expected} ± {tol_str}" + def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: """Assert that two numbers (or two ordered sequences of numbers) are equal to each other diff --git a/testing/python/approx.py b/testing/python/approx.py index 75b57b6965c..2ca7ee70945 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -2,6 +2,7 @@ from __future__ import annotations from contextlib import contextmanager +import decimal from decimal import Decimal from fractions import Fraction from math import sqrt @@ -1015,6 +1016,11 @@ def __len__(self): expected_repr = "approx([1 ± 1.0e-06, 2 ± 2.0e-06, 3 ± 3.0e-06, 4 ± 4.0e-06])" assert repr(approx(expected)) == expected_repr + def test_decimal_approx_repr(self, monkeypatch) -> None: + monkeypatch.setitem(decimal.getcontext().traps, decimal.FloatOperation, True) + approx_obj = pytest.approx(decimal.Decimal("2.60")) + assert decimal.Decimal("2.600001") == approx_obj + def test_allow_ordered_sequences_only(self) -> None: """pytest.approx() should raise an error on unordered sequences (#9692).""" with pytest.raises(TypeError, match="only supports ordered sequences"): From c4d289ab9ff35934954a627b670f65e4c7108add Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 22 Jun 2025 16:32:05 -0300 Subject: [PATCH 032/270] Enable triggering the test workflow manually (#13496) Useful in cases we want to run the `test` workflow without any code changes, e.g. to compare a previous run that was successful a few days ago but `main` appears to be broken without code changes a few days later. --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7873b66a49a..1134c34702f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,8 @@ on: - reopened # default - ready_for_review # used in PRs created from the release workflow + workflow_dispatch: # allows manual triggering of the workflow + env: PYTEST_ADDOPTS: "--color=yes" From ede5801f2dd2172fd9e8ae024f29fc4af749fbc0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 09:34:11 -0300 Subject: [PATCH 033/270] build(deps): Bump hynek/build-and-inspect-python-package (#13556) Bumps [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package) from 2.12.0 to 2.13.0. - [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases) - [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/b5076c307dc91924a82ad150cdd1533b444d3310...c52c3a4710070b50470d903818a7b25115dcd076) --- updated-dependencies: - dependency-name: hynek/build-and-inspect-python-package dependency-version: 2.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ba593c7c3a9..6acfddcf912 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,7 +31,7 @@ jobs: persist-credentials: false - name: Build and Check Package - uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 + uses: hynek/build-and-inspect-python-package@c52c3a4710070b50470d903818a7b25115dcd076 with: attest-build-provenance-github: 'true' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1134c34702f..e51b817b805 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,7 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Build and Check Package - uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 + uses: hynek/build-and-inspect-python-package@c52c3a4710070b50470d903818a7b25115dcd076 build: needs: [package] From cc580b53beb09ab8385c9fa4c9532aa90a294ded Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 24 Jun 2025 08:15:06 -0300 Subject: [PATCH 034/270] Rename 13480.bugfix to 13480.contrib (#13554) Since this is related only to internal testing and does not affect end-users, it is more appropriate to announce it in the "Contributor" section of the changelog. Follow up to #13481. --- changelog/13480.bugfix.rst | 1 - changelog/13480.contrib.rst | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 changelog/13480.bugfix.rst create mode 100644 changelog/13480.contrib.rst diff --git a/changelog/13480.bugfix.rst b/changelog/13480.bugfix.rst deleted file mode 100644 index ed649a33516..00000000000 --- a/changelog/13480.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a few test failures in pytest's own test suite when run with ``-Wdefault`` or a similar override. diff --git a/changelog/13480.contrib.rst b/changelog/13480.contrib.rst new file mode 100644 index 00000000000..9079c6f6b5a --- /dev/null +++ b/changelog/13480.contrib.rst @@ -0,0 +1 @@ +Self-testing: fixed a few test failures when run with ``-Wdefault`` or a similar override. From ae7346114d65e3a2c0ccd77af8a0ca00012cd91d Mon Sep 17 00:00:00 2001 From: NayeemJohn <44828643+NayeemJohnY@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:17:21 +0530 Subject: [PATCH 035/270] Add `int` and `float` variants to Parser.addini (#13560) Fixes #13559. --------- Co-authored-by: Bruno Oliveira --- changelog/13559.bugfix.rst | 1 + src/_pytest/config/argparsing.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/13559.bugfix.rst diff --git a/changelog/13559.bugfix.rst b/changelog/13559.bugfix.rst new file mode 100644 index 00000000000..69036f784ac --- /dev/null +++ b/changelog/13559.bugfix.rst @@ -0,0 +1 @@ +Added missing `int` and `float` variants to the `Literal` type annotation of the `type` parameter in :meth:`pytest.Parser.addini`. diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 948dfe8a510..8d4ed823325 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -174,7 +174,9 @@ def addini( self, name: str, help: str, - type: Literal["string", "paths", "pathlist", "args", "linelist", "bool"] + type: Literal[ + "string", "paths", "pathlist", "args", "linelist", "bool", "int", "float" + ] | None = None, default: Any = NOT_SET, ) -> None: From ecc55b435ffd8be19146c75b215886d38421beed Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Wed, 25 Jun 2025 10:36:38 -0400 Subject: [PATCH 036/270] pytest.approx: import numpy conditionally (#13563) This matches existing conditional-import behavior in `pytest.approx`, and improves runtime for users of `pytest.approx` and not `numpy`. --- AUTHORS | 1 + changelog/13563.bugfix.rst | 1 + src/_pytest/python_api.py | 7 ++----- 3 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 changelog/13563.bugfix.rst diff --git a/AUTHORS b/AUTHORS index e5b863e71f1..df338aa8c6e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -261,6 +261,7 @@ Leonardus Chen Lev Maximov Levon Saldamli Lewis Cowles +Liam DeVoe Llandy Riveron Del Risco Loic Esteve lovetheguitar diff --git a/changelog/13563.bugfix.rst b/changelog/13563.bugfix.rst new file mode 100644 index 00000000000..543552e20cf --- /dev/null +++ b/changelog/13563.bugfix.rst @@ -0,0 +1 @@ +:func:`pytest.approx` now only imports ``numpy`` if NumPy is already in ``sys.modules``. This fixes unconditional import behavior introduced in `8.4.0`. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index b732b452683..52e564bd809 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -426,12 +426,9 @@ def is_bool(val: Any) -> bool: # Check if `val` is a native bool or numpy bool. if isinstance(val, bool): return True - try: - import numpy as np - + if np := sys.modules.get("numpy"): return isinstance(val, np.bool_) - except ImportError: - return False + return False asarray = _as_numpy_array(actual) if asarray is not None: From e6f24ed2dd6c8bfd5285e2c32bbf317d0fa48ad7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 11:38:12 -0300 Subject: [PATCH 037/270] [pre-commit.ci] pre-commit autoupdate (#13557) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.12.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.13...v0.12.0) - [github.com/pre-commit/mirrors-mypy: v1.16.0 → v1.16.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.16.0...v1.16.1) * Disable ruff PLC0415 / pylint import-outside-toplevel * Also disable eq-without-hash * Fix the RUF28 at an acceptable cost * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Pierre Sassoulas --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 6 ++++-- testing/test_assertrewrite.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62274b2de7a..c55ecd681cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.13" + rev: "v0.12.0" hooks: - id: ruff args: ["--fix"] @@ -32,7 +32,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.16.0 + rev: v1.16.1 hooks: - id: mypy files: ^(src/|testing/|scripts/) diff --git a/pyproject.toml b/pyproject.toml index 272be0a1582..033567bcb50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -145,6 +145,7 @@ lint.ignore = [ # pylint ignore "PLC0105", # `TypeVar` name "E" does not reflect its covariance; "PLC0414", # Import alias does not rename original package + "PLC0415", # import should be at top level of package "PLR0124", # Name compared with itself "PLR0133", # Two constants compared in a comparison (lots of those in tests) "PLR0402", # Use `from x.y import z` in lieu of alias @@ -157,6 +158,7 @@ lint.ignore = [ "PLR5501", # Use `elif` instead of `else` then `if` "PLW0120", # remove the else and dedent its contents "PLW0603", # Using the global statement + "PLW1641", # Does not implement the __hash__ method "PLW2901", # for loop variable overwritten by assignment target # ruff ignore "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` @@ -240,13 +242,13 @@ disable = [ "else-if-used", # not activated by default, PLR5501 disabled in ruff "empty-comment", # not activated by default, PLR2044 disabled in ruff "eval-used", - "eq-without-hash", + "eq-without-hash", # PLW1641 disabled in ruff "exec-used", "expression-not-assigned", "fixme", "global-statement", # PLW0603 disabled in ruff "import-error", - "import-outside-toplevel", + "import-outside-toplevel", # PLC0415 disabled in ruff "import-private-name", "inconsistent-return-statements", "invalid-bool-returned", diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index e2e448fe5e6..f13c71352de 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -2197,9 +2197,9 @@ def test_simple(): ), ), ) -# fmt: on def test_get_assertion_exprs(src, expected) -> None: assert _get_assertion_exprs(src) == expected +# fmt: on def test_try_makedirs(monkeypatch, tmp_path: Path) -> None: From eced426fd3ee620b73e19ba1790f856594127694 Mon Sep 17 00:00:00 2001 From: karlicoss Date: Fri, 27 Jun 2025 07:20:41 +0100 Subject: [PATCH 038/270] use callable protocols for pytest.skip/exit/fail/xfail instead of _WithException wrapper with __call__ attribute (#13445) This is a more canonical way of typing generic callbacks/decorators (see https://mypy.readthedocs.io/en/stable/protocols.html#callback-protocols) This helps with potential issues/ambiguity with __call__ semanics in type checkers -- according to python spec, __call__ needs to be present on the class, rather than as an instance attribute to be considered callable. This worked in mypy because it didn't handle the spec 100% correctly (in this case this has no negative consequences) However, ty type checker is stricter/more correct about it and every pytest.skip usage results in: ``` error[call-non-callable]: Object of type _WithException[Unknown, ] is not callable ``` For more context, see: [ty] Understand classes that inherit from subscripted Protocol[] as generic astral-sh/ruff#17832 (comment) https://discuss.python.org/t/when-should-we-assume-callable-types-are-method-descriptors/92938 Testing: Tested with running mypy against the following snippet: import pytest reveal_type(pytest.skip) reveal_type(pytest.skip.Exception) reveal_type(pytest.skip(reason="whatever")) Before the change: ``` $ mypy test_pytest_skip.py test_pytest_skip.py:2: note: Revealed type is "_pytest.outcomes._WithException[def (reason: builtins.str =, *, allow_module_level: builtins.bool =) -> Never, def (msg: Union[builtins.str, None] =, pytrace: builtins.bool =, allow_module_level: builtins.bool =, *, _use_item_location: builtins.bool =) -> _pytest.outcomes.Skipped]" test_pytest_skip.py:3: note: Revealed type is "def (msg: Union[builtins.str, None] =, pytrace: builtins.bool =, allow_module_level: builtins.bool =, *, _use_item_location: builtins.bool =) -> _pytest.outcomes.Skipped" test_pytest_skip.py:4: note: Revealed type is "Never" ``` After the change: ``` $ mypy test_pytest_skip.py test_pytest_skip.py:2: note: Revealed type is "_pytest.outcomes._Skip" test_pytest_skip.py:3: note: Revealed type is "type[_pytest.outcomes.Skipped]" test_pytest_skip.py:4: note: Revealed type is "Never" ``` ty type checker is also inferring the same types correctly now. All types are matching and propagated correctly (most importantly, Never as a result of pytest.skip(...) call). --- AUTHORS | 1 + changelog/13445.bugfix.rst | 1 + src/_pytest/outcomes.py | 95 +++++++++++++++++--------------------- testing/python/collect.py | 3 +- 4 files changed, 47 insertions(+), 53 deletions(-) create mode 100644 changelog/13445.bugfix.rst diff --git a/AUTHORS b/AUTHORS index df338aa8c6e..76099413072 100644 --- a/AUTHORS +++ b/AUTHORS @@ -134,6 +134,7 @@ Deysha Rivera Dheeraj C K Dhiren Serai Diego Russo +Dima Gerasimov Dmitry Dygalo Dmitry Pribysh Dominic Mortlock diff --git a/changelog/13445.bugfix.rst b/changelog/13445.bugfix.rst new file mode 100644 index 00000000000..1c601a1045e --- /dev/null +++ b/changelog/13445.bugfix.rst @@ -0,0 +1 @@ +Made the type annotations of :func:`pytest.skip` and friends more spec-complaint to have them work across more type checkers. diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 68ba0543365..766be95c0f7 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -3,13 +3,10 @@ from __future__ import annotations -from collections.abc import Callable import sys from typing import Any -from typing import cast +from typing import ClassVar from typing import NoReturn -from typing import Protocol -from typing import TypeVar from .warning_types import PytestDeprecationWarning @@ -77,35 +74,11 @@ def __init__( super().__init__(msg) -# We need a callable protocol to add attributes, for discussion see -# https://github.com/python/mypy/issues/2087. - -_F = TypeVar("_F", bound=Callable[..., object]) -_ET = TypeVar("_ET", bound=type[BaseException]) - - -class _WithException(Protocol[_F, _ET]): - Exception: _ET - __call__: _F - - -def _with_exception(exception_type: _ET) -> Callable[[_F], _WithException[_F, _ET]]: - def decorate(func: _F) -> _WithException[_F, _ET]: - func_with_exception = cast(_WithException[_F, _ET], func) - func_with_exception.Exception = exception_type - return func_with_exception - - return decorate - - -# Exposed helper methods. +class XFailed(Failed): + """Raised from an explicit call to pytest.xfail().""" -@_with_exception(Exit) -def exit( - reason: str = "", - returncode: int | None = None, -) -> NoReturn: +class _Exit: """Exit testing process. :param reason: @@ -113,21 +86,24 @@ def exit( only because `msg` is deprecated. :param returncode: - Return code to be used when exiting pytest. None means the same as ``0`` (no error), same as :func:`sys.exit`. + Return code to be used when exiting pytest. None means the same as ``0`` (no error), + same as :func:`sys.exit`. :raises pytest.exit.Exception: The exception that is raised. """ - __tracebackhide__ = True - raise Exit(reason, returncode) + Exception: ClassVar[type[Exit]] = Exit -@_with_exception(Skipped) -def skip( - reason: str = "", - *, - allow_module_level: bool = False, -) -> NoReturn: + def __call__(self, reason: str = "", returncode: int | None = None) -> NoReturn: + __tracebackhide__ = True + raise Exit(msg=reason, returncode=returncode) + + +exit: _Exit = _Exit() + + +class _Skip: """Skip an executing test with the given message. This function should be called only during testing (setup, call or teardown) or @@ -155,12 +131,18 @@ def skip( Similarly, use the ``# doctest: +SKIP`` directive (see :py:data:`doctest.SKIP`) to skip a doctest statically. """ - __tracebackhide__ = True - raise Skipped(msg=reason, allow_module_level=allow_module_level) + Exception: ClassVar[type[Skipped]] = Skipped + + def __call__(self, reason: str = "", allow_module_level: bool = False) -> NoReturn: + __tracebackhide__ = True + raise Skipped(msg=reason, allow_module_level=allow_module_level) + + +skip: _Skip = _Skip() -@_with_exception(Failed) -def fail(reason: str = "", pytrace: bool = True) -> NoReturn: + +class _Fail: """Explicitly fail an executing test with the given message. :param reason: @@ -173,16 +155,18 @@ def fail(reason: str = "", pytrace: bool = True) -> NoReturn: :raises pytest.fail.Exception: The exception that is raised. """ - __tracebackhide__ = True - raise Failed(msg=reason, pytrace=pytrace) + Exception: ClassVar[type[Failed]] = Failed -class XFailed(Failed): - """Raised from an explicit call to pytest.xfail().""" + def __call__(self, reason: str = "", pytrace: bool = True) -> NoReturn: + __tracebackhide__ = True + raise Failed(msg=reason, pytrace=pytrace) -@_with_exception(XFailed) -def xfail(reason: str = "") -> NoReturn: +fail: _Fail = _Fail() + + +class _XFail: """Imperatively xfail an executing test or setup function with the given reason. This function should be called only during testing (setup, call or teardown). @@ -201,8 +185,15 @@ def xfail(reason: str = "") -> NoReturn: :raises pytest.xfail.Exception: The exception that is raised. """ - __tracebackhide__ = True - raise XFailed(reason) + + Exception: ClassVar[type[XFailed]] = XFailed + + def __call__(self, reason: str = "") -> NoReturn: + __tracebackhide__ = True + raise XFailed(msg=reason) + + +xfail: _XFail = _XFail() def importorskip( diff --git a/testing/python/collect.py b/testing/python/collect.py index 530f1c340ff..80981ed280f 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -1075,7 +1075,8 @@ class TestTracebackCutting: def test_skip_simple(self): with pytest.raises(pytest.skip.Exception) as excinfo: pytest.skip("xxx") - assert excinfo.traceback[-1].frame.code.name == "skip" + if sys.version_info >= (3, 11): + assert excinfo.traceback[-1].frame.code.raw.co_qualname == "_Skip.__call__" assert excinfo.traceback[-1].ishidden(excinfo) assert excinfo.traceback[-2].frame.code.name == "test_skip_simple" assert not excinfo.traceback[-2].ishidden(excinfo) From 8c5fc5739532c3a6bb602949b65c4158590813fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 29 Jun 2025 08:05:36 +0200 Subject: [PATCH 039/270] [automated] Update plugin list (#13576) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 158 ++++++++++++++++++++++--------- 1 file changed, 111 insertions(+), 47 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 4a278a8f7d1..fe46889c000 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =3.5.0) :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) :pypi:`pytest-annotated` Pytest plugin to allow use of Annotated in tests to resolve fixtures Sep 30, 2024 N/A pytest>=8.3.3 - :pypi:`pytest-ansible` Plugin for pytest to simplify calling ansible modules from tests or fixtures May 26, 2025 5 - Production/Stable pytest>=6 + :pypi:`pytest-ansible` Plugin for pytest to simplify calling ansible modules from tests or fixtures Jun 26, 2025 5 - Production/Stable pytest>=6 :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A @@ -90,15 +90,15 @@ This list contains 1650 plugins. :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Dec 02, 2023 5 - Production/Stable pytest ; extra == 'test' :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-api-framework` pytest framework Jun 20, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Jun 20, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Jun 25, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) - :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Feb 05, 2024 5 - Production/Stable pytest + :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Jun 28, 2025 5 - Production/Stable pytest :pypi:`pytest-archon` Rule your architecture like a real developer Dec 18, 2023 5 - Production/Stable pytest >=7.2 :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Jun 12, 2025 4 - Beta pytest>=3.0; extra == "dev" @@ -124,7 +124,7 @@ This list contains 1650 plugins. :pypi:`pytest-async-generators` Pytest fixtures for async generators Jul 05, 2023 N/A N/A :pypi:`pytest-asyncio` Pytest support for asyncio May 26, 2025 4 - Beta pytest<9,>=8.2 :pypi:`pytest-asyncio-concurrent` Pytest plugin to execute python async tests concurrently. May 17, 2025 4 - Beta pytest>=6.2.0 - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 26, 2025 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jun 24, 2025 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -166,7 +166,7 @@ This list contains 1650 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 20, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 28, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -181,7 +181,7 @@ This list contains 1650 plugins. :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' :pypi:`pytest-black-ng` A pytest plugin to enable format checking with black Oct 20, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) - :pypi:`pytest-blender` Blender Pytest plugin. Aug 02, 2024 N/A pytest + :pypi:`pytest-blender` Blender Pytest plugin. Jun 25, 2025 N/A pytest :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A @@ -394,6 +394,7 @@ This list contains 1650 plugins. :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) + :pypi:`pytest-dino-fm` Minimal package created automatically Jun 27, 2025 N/A N/A :pypi:`pytest-dir-equal` pytest-dir-equals is a pytest plugin providing helpers to assert directories equality allowing golden testing Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-dirty` Static import analysis for thrifty testing. Jun 08, 2025 3 - Alpha pytest>=8.2; extra == "dev" :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A @@ -435,7 +436,7 @@ This list contains 1650 plugins. :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) :pypi:`pytest-docker-compose-v2` Manages Docker containers during your integration tests Dec 11, 2024 4 - Beta pytest>=7.2.2 :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) - :pypi:`pytest-docker-fixtures` pytest docker fixtures May 14, 2025 3 - Alpha pytest + :pypi:`pytest-docker-fixtures` pytest docker fixtures Jun 25, 2025 3 - Alpha pytest :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Aug 12, 2024 4 - Beta pytest :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Aug 12, 2024 4 - Beta pytest :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest @@ -468,7 +469,7 @@ This list contains 1650 plugins. :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 - :pypi:`pytest-dsl` A DSL testing framework based on pytest Jun 18, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl` A DSL testing framework based on pytest Jun 28, 2025 N/A pytest>=7.0.0 :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jun 10, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A @@ -516,6 +517,7 @@ This list contains 1650 plugins. :pypi:`pytest-environment` Pytest Environment Mar 17, 2024 1 - Planning N/A :pypi:`pytest-envraw` py.test plugin that allows you to add environment variables. Aug 27, 2020 4 - Beta pytest (>=2.6.0) :pypi:`pytest-envvars` Pytest plugin to validate use of envvars on your tests Jun 13, 2020 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-envx` Pytest plugin for managing environment variables with interpolation and .env file support. Jun 28, 2025 4 - Beta pytest>=8.4.1 :pypi:`pytest-env-yaml` Apr 02, 2019 N/A N/A :pypi:`pytest-eradicate` pytest plugin to check for commented out code Sep 08, 2020 N/A pytest (>=2.4.2) :pypi:`pytest_erp` py.test plugin to send test info to report portal dynamically Jan 13, 2015 N/A N/A @@ -563,7 +565,7 @@ This list contains 1650 plugins. :pypi:`pytest-f3ts` Pytest Plugin for communicating test results and information to a FixturFab Test Runner GUI May 08, 2025 N/A pytest<8.0.0,>=7.2.1 :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. Mar 05, 2024 6 - Mature pytest (>=6.2) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. Jun 28, 2025 6 - Mature pytest>=7.0 :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screen-record` Create a video of the screen when pytest fails Jan 05, 2023 4 - Beta pytest (>=7.1.2d,<8.0.0) @@ -622,6 +624,7 @@ This list contains 1650 plugins. :pypi:`pytest-fluentbit` A pytest plugin in order to provide logs via fluentbit Jun 16, 2023 4 - Beta pytest (>=7.0.0) :pypi:`pytest-fly` pytest runner and observer Jun 07, 2025 3 - Alpha pytest :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest + :pypi:`pytest-fmu-filter` A pytest plugin to filter fmus Jun 23, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-forbid` Mar 07, 2023 N/A pytest (>=7.2.2,<8.0.0) :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A @@ -683,6 +686,7 @@ This list contains 1650 plugins. :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) :pypi:`pytest-grunnur` Py.Test plugin for Grunnur-based packages. Jul 26, 2024 N/A pytest>=6 :pypi:`pytest_gui_status` Show pytest status in gui Jan 23, 2016 N/A pytest + :pypi:`pytest-hammer-artifacts` Minimal package created automatically Jun 27, 2025 N/A N/A :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-hardware-test-report` A simple plugin to use with pytest Apr 01, 2024 4 - Beta pytest<9.0.0,>=8.0.0 :pypi:`pytest-harmony` Chain tests and data with pytest Jan 17, 2023 N/A pytest (>=7.2.1,<8.0.0) @@ -700,7 +704,7 @@ This list contains 1650 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 14, 2025 3 - Alpha pytest==8.3.5 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 28, 2025 3 - Alpha pytest==8.4.0 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -716,6 +720,7 @@ This list contains 1650 plugins. :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Jun 05, 2025 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 17, 2024 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-html-report` Enhanced HTML reporting for pytest with categories, specifications, and detailed logging Jun 24, 2025 4 - Beta pytest>=6.0 :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A :pypi:`pytest-html-report-merger` May 22, 2024 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A @@ -732,7 +737,7 @@ This list contains 1650 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jun 06, 2025 4 - Beta pytest>=7.0.0 + :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jun 25, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Feb 06, 2025 4 - Beta pytest>=7.1 :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Dec 05, 2023 4 - Beta pytest :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A @@ -772,7 +777,7 @@ This list contains 1650 plugins. :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) :pypi:`pytest-interface-tester` Pytest plugin for checking charm relation interface protocol compliance. Feb 13, 2025 4 - Beta pytest - :pypi:`pytest-invenio` Pytest fixtures for Invenio. May 08, 2025 5 - Production/Stable pytest<9.0.0,>=6 + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Jun 27, 2025 5 - Production/Stable pytest<9.0.0,>=6 :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-iovis` A Pytest plugin to enable Jupyter Notebook testing with Papermill Nov 06, 2024 4 - Beta pytest>=7.1.0 :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A @@ -832,7 +837,7 @@ This list contains 1650 plugins. :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A :pypi:`pytest-langchain` Pytest-style test runner for langchain agents Feb 26, 2023 N/A pytest :pypi:`pytest-lark` Create fancy and clear HTML test reports. Nov 05, 2023 N/A N/A - :pypi:`pytest-latin-hypercube` Implementation of Latin Hypercube Sampling for pytest. Feb 27, 2025 N/A pytest + :pypi:`pytest-latin-hypercube` Implementation of Latin Hypercube Sampling for pytest. Jun 26, 2025 N/A pytest :pypi:`pytest-launchable` Launchable Pytest Plugin Apr 05, 2023 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) @@ -872,7 +877,7 @@ This list contains 1650 plugins. :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-logging-strict` pytest fixture logging configured from packaged YAML May 20, 2025 3 - Alpha pytest - :pypi:`pytest-logikal` Common testing environment Apr 30, 2025 5 - Production/Stable pytest==8.3.5 + :pypi:`pytest-logikal` Common testing environment Jun 27, 2025 5 - Production/Stable pytest==8.3.5 :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-logscanner` Pytest plugin for logscanner (A logger for python logging outputting to easily viewable (and filterable) html files. Good for people not grep savey, and color higlighting and quickly changing filters might even bye useful for commandline wizards.) Sep 30, 2024 4 - Beta pytest>=8.2.2 :pypi:`pytest-loguru` Pytest Loguru Mar 20, 2024 5 - Production/Stable pytest; extra == "test" @@ -916,6 +921,7 @@ This list contains 1650 plugins. :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Feb 12, 2024 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-metaexport` Pytest plugin for exporting custom test metadata to JSON. Jun 24, 2025 N/A pytest>=7.1.0 :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mh` Pytest multihost plugin Jun 05, 2025 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) @@ -1097,11 +1103,11 @@ This list contains 1650 plugins. :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A - :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Apr 15, 2025 N/A N/A + :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Jun 25, 2025 N/A N/A :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Jun 21, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Jun 28, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1197,12 +1203,12 @@ This list contains 1650 plugins. :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. Oct 25, 2024 5 - Production/Stable pytest :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A - :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Jan 20, 2024 5 - Production/Stable pytest >=3.0.0 + :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Jun 22, 2025 5 - Production/Stable pytest :pypi:`pytest-ranking` A Pytest plugin for faster fault detection via regression test prioritization Apr 08, 2025 4 - Beta pytest>=7.4.3 :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. Sep 04, 2024 3 - Alpha N/A :pypi:`pytest-recap` Capture your test sessions. Recap the results. Jun 16, 2025 N/A pytest>=6.2.0 - :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Mar 31, 2025 N/A N/A + :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Jun 27, 2025 N/A N/A :pypi:`pytest-recording` A pytest plugin powered by VCR.py to record and replay HTTP traffic May 08, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-record-video` 用例执行过程中录制视频 Oct 31, 2024 N/A N/A @@ -1567,7 +1573,7 @@ This list contains 1650 plugins. :pypi:`pytest-tutorials` Mar 11, 2023 N/A N/A :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Sep 10, 2024 5 - Production/Stable pytest>=2.3 - :pypi:`pytest-ty` A pytest plugin to run the ty type checker Jun 20, 2025 4 - Beta pytest>=7.0.0 + :pypi:`pytest-ty` A pytest plugin to run the ty type checker Jun 25, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typed-schema-shot` Pytest plugin for automatic JSON Schema generation and validation from examples Jun 14, 2025 N/A pytest :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1575,6 +1581,7 @@ This list contains 1650 plugins. :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Aug 15, 2023 4 - Beta N/A :pypi:`pytest-typing-runner` Pytest plugin to make it easier to run and check python code against static type checkers May 31, 2025 N/A N/A :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) + :pypi:`pytest-tzshift` A Pytest plugin that transparently re-runs tests under a matrix of timezones and locales. Jun 25, 2025 4 - Beta pytest>=7.0 :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest :pypi:`pytest-ui-failed-screenshot` UI自动测试失败时自动截图,并将截图加入到测试报告中 Dec 06, 2022 N/A N/A @@ -1638,6 +1645,7 @@ This list contains 1650 plugins. :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs May 26, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) + :pypi:`pytest-xdist-gnumake` A small example package Jun 22, 2025 N/A pytest :pypi:`pytest-xdist-lock` Extension for pytest-xdist adding test and resource group locks for local and distributed runs Apr 26, 2025 N/A pytest>=6.0 :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) :pypi:`pytest-xdist-worker-stats` A pytest plugin to list worker statistics after a xdist run. Mar 15, 2025 4 - Beta pytest>=7.0.0 @@ -1676,7 +1684,7 @@ This list contains 1650 plugins. :pypi:`pytest-zcc` eee Jun 02, 2024 N/A N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Jul 04, 2024 5 - Production/Stable pytest>=4.5.0 :pypi:`pytest-zeebe` Pytest fixtures for testing Camunda 8 processes using a Zeebe test engine. Feb 01, 2024 N/A pytest (>=7.4.2,<8.0.0) - :pypi:`pytest-zephyr-scale-integration` A library for integrating Jira Zephyr Scale (Adaptavist\TM4J) with pytest May 15, 2025 N/A pytest + :pypi:`pytest-zephyr-scale-integration` A library for integrating Jira Zephyr Scale (Adaptavist\TM4J) with pytest Jun 26, 2025 N/A pytest :pypi:`pytest-zephyr-telegram` Плагин для отправки данных автотестов в Телеграм и Зефир Sep 30, 2024 N/A pytest==8.3.2 :pypi:`pytest-zest` Zesty additions to pytest. Nov 17, 2022 N/A N/A :pypi:`pytest-zhongwen-wendang` PyTest 中文文档 Mar 04, 2024 4 - Beta N/A @@ -2012,7 +2020,7 @@ This list contains 1650 plugins. Pytest plugin to allow use of Annotated in tests to resolve fixtures :pypi:`pytest-ansible` - *last release*: May 26, 2025, + *last release*: Jun 26, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6 @@ -2082,14 +2090,14 @@ This list contains 1650 plugins. An ASGI middleware to populate OpenAPI Specification examples from pytest functions :pypi:`pytest-api-framework` - *last release*: Jun 20, 2025, + *last release*: Jun 22, 2025, *status*: N/A, *requires*: pytest==7.2.2 pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Jun 20, 2025, + *last release*: Jun 25, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2138,7 +2146,7 @@ This list contains 1650 plugins. A plugin to use approvaltests with pytest :pypi:`pytest-approvaltests-geo` - *last release*: Feb 05, 2024, + *last release*: Jun 28, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -2320,7 +2328,7 @@ This list contains 1650 plugins. Pytest plugin to execute python async tests concurrently. :pypi:`pytest-asyncio-cooperative` - *last release*: Apr 26, 2025, + *last release*: Jun 24, 2025, *status*: N/A, *requires*: N/A @@ -2614,7 +2622,7 @@ This list contains 1650 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Jun 20, 2025, + *last release*: Jun 28, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -2719,7 +2727,7 @@ This list contains 1650 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: Aug 02, 2024, + *last release*: Jun 25, 2025, *status*: N/A, *requires*: pytest @@ -4209,6 +4217,13 @@ This list contains 1650 plugins. PyTest plugin for generating Difido reports + :pypi:`pytest-dino-fm` + *last release*: Jun 27, 2025, + *status*: N/A, + *requires*: N/A + + Minimal package created automatically + :pypi:`pytest-dir-equal` *last release*: Dec 11, 2023, *status*: 4 - Beta, @@ -4497,7 +4512,7 @@ This list contains 1650 plugins. A plugin to use docker databases for pytests :pypi:`pytest-docker-fixtures` - *last release*: May 14, 2025, + *last release*: Jun 25, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -4728,7 +4743,7 @@ This list contains 1650 plugins. A Pytest plugin to ignore tests during collection without reporting them in the test summary. :pypi:`pytest-dsl` - *last release*: Jun 18, 2025, + *last release*: Jun 28, 2025, *status*: N/A, *requires*: pytest>=7.0.0 @@ -5063,6 +5078,13 @@ This list contains 1650 plugins. Pytest plugin to validate use of envvars on your tests + :pypi:`pytest-envx` + *last release*: Jun 28, 2025, + *status*: 4 - Beta, + *requires*: pytest>=8.4.1 + + Pytest plugin for managing environment variables with interpolation and .env file support. + :pypi:`pytest-env-yaml` *last release*: Apr 02, 2019, *status*: N/A, @@ -5393,9 +5415,9 @@ This list contains 1650 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: Mar 05, 2024, + *last release*: Jun 28, 2025, *status*: 6 - Mature, - *requires*: pytest (>=6.2) + *requires*: pytest>=7.0 Factory Boy support for pytest. @@ -5805,6 +5827,13 @@ This list contains 1650 plugins. Pytest fixtures for simplifying Flyte integration testing + :pypi:`pytest-fmu-filter` + *last release*: Jun 23, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0.0 + + A pytest plugin to filter fmus + :pypi:`pytest-focus` *last release*: May 04, 2019, *status*: 4 - Beta, @@ -6232,6 +6261,13 @@ This list contains 1650 plugins. Show pytest status in gui + :pypi:`pytest-hammer-artifacts` + *last release*: Jun 27, 2025, + *status*: N/A, + *requires*: N/A + + Minimal package created automatically + :pypi:`pytest-hammertime` *last release*: Jul 28, 2018, *status*: N/A, @@ -6352,9 +6388,9 @@ This list contains 1650 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 14, 2025, + *last release*: Jun 28, 2025, *status*: 3 - Alpha, - *requires*: pytest==8.3.5 + *requires*: pytest==8.4.0 Experimental package to automatically extract test plugins for Home Assistant custom components @@ -6463,6 +6499,13 @@ This list contains 1650 plugins. Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. + :pypi:`pytest-html-report` + *last release*: Jun 24, 2025, + *status*: 4 - Beta, + *requires*: pytest>=6.0 + + Enhanced HTML reporting for pytest with categories, specifications, and detailed logging + :pypi:`pytest-html-reporter` *last release*: Feb 13, 2022, *status*: N/A, @@ -6576,7 +6619,7 @@ This list contains 1650 plugins. help hypo module for pytest :pypi:`pytest-iam` - *last release*: Jun 06, 2025, + *last release*: Jun 25, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -6856,7 +6899,7 @@ This list contains 1650 plugins. Pytest plugin for checking charm relation interface protocol compliance. :pypi:`pytest-invenio` - *last release*: May 08, 2025, + *last release*: Jun 27, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9.0.0,>=6 @@ -7276,7 +7319,7 @@ This list contains 1650 plugins. Create fancy and clear HTML test reports. :pypi:`pytest-latin-hypercube` - *last release*: Feb 27, 2025, + *last release*: Jun 26, 2025, *status*: N/A, *requires*: pytest @@ -7556,7 +7599,7 @@ This list contains 1650 plugins. pytest fixture logging configured from packaged YAML :pypi:`pytest-logikal` - *last release*: Apr 30, 2025, + *last release*: Jun 27, 2025, *status*: 5 - Production/Stable, *requires*: pytest==8.3.5 @@ -7863,6 +7906,13 @@ This list contains 1650 plugins. pytest plugin for test session metadata + :pypi:`pytest-metaexport` + *last release*: Jun 24, 2025, + *status*: N/A, + *requires*: pytest>=7.1.0 + + Pytest plugin for exporting custom test metadata to JSON. + :pypi:`pytest-metrics` *last release*: Apr 04, 2020, *status*: N/A, @@ -9131,7 +9181,7 @@ This list contains 1650 plugins. A pytest fixture for visual testing with Playwright :pypi:`pytest-playwright-visual-snapshot` - *last release*: Apr 15, 2025, + *last release*: Jun 25, 2025, *status*: N/A, *requires*: N/A @@ -9159,7 +9209,7 @@ This list contains 1650 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Jun 21, 2025, + *last release*: Jun 28, 2025, *status*: N/A, *requires*: pytest @@ -9831,9 +9881,9 @@ This list contains 1650 plugins. Randomise the order in which pytest tests are run with some control over the randomness :pypi:`pytest-random-order` - *last release*: Jan 20, 2024, + *last release*: Jun 22, 2025, *status*: 5 - Production/Stable, - *requires*: pytest >=3.0.0 + *requires*: pytest Randomise the order in which pytest tests are run with some control over the randomness @@ -9866,7 +9916,7 @@ This list contains 1650 plugins. Capture your test sessions. Recap the results. :pypi:`pytest-recorder` - *last release*: Mar 31, 2025, + *last release*: Jun 27, 2025, *status*: N/A, *requires*: N/A @@ -12421,8 +12471,8 @@ This list contains 1650 plugins. A twisted plugin for pytest. :pypi:`pytest-ty` - *last release*: Jun 20, 2025, - *status*: 4 - Beta, + *last release*: Jun 25, 2025, + *status*: 3 - Alpha, *requires*: pytest>=7.0.0 A pytest plugin to run the ty type checker @@ -12476,6 +12526,13 @@ This list contains 1650 plugins. Typhoon HIL plugin for pytest + :pypi:`pytest-tzshift` + *last release*: Jun 25, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0 + + A Pytest plugin that transparently re-runs tests under a matrix of timezones and locales. + :pypi:`pytest-ubersmith` *last release*: Apr 13, 2015, *status*: N/A, @@ -12917,6 +12974,13 @@ This list contains 1650 plugins. forked from pytest-xdist + :pypi:`pytest-xdist-gnumake` + *last release*: Jun 22, 2025, + *status*: N/A, + *requires*: pytest + + A small example package + :pypi:`pytest-xdist-lock` *last release*: Apr 26, 2025, *status*: N/A, @@ -13184,7 +13248,7 @@ This list contains 1650 plugins. Pytest fixtures for testing Camunda 8 processes using a Zeebe test engine. :pypi:`pytest-zephyr-scale-integration` - *last release*: May 15, 2025, + *last release*: Jun 26, 2025, *status*: N/A, *requires*: pytest From e920a27e7926dee4a05c147bd9304df14b8b8a22 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 18:56:33 -0300 Subject: [PATCH 040/270] [pre-commit.ci] pre-commit autoupdate (#13578) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.0 → v0.12.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.0...v0.12.1) - [github.com/woodruffw/zizmor-pre-commit: v1.9.0 → v1.10.0](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.9.0...v1.10.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c55ecd681cb..90a485abbbf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.0" + rev: "v0.12.1" hooks: - id: ruff args: ["--fix"] @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.9.0 + rev: v1.10.0 hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs From c5a75f2498c86850c4ce13bcf10d56efc92394a4 Mon Sep 17 00:00:00 2001 From: Aditi De <92822822+coder-aditi@users.noreply.github.com> Date: Wed, 2 Jul 2025 02:45:06 +0530 Subject: [PATCH 041/270] Fix crash with `times` output style and skipped module (#13573) Fixes #13478 --------- Co-authored-by: AD Co-authored-by: Bruno Oliveira --- changelog/13478.bugfix.rst | 1 + src/_pytest/terminal.py | 4 +++- testing/test_terminal.py | 25 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 changelog/13478.bugfix.rst diff --git a/changelog/13478.bugfix.rst b/changelog/13478.bugfix.rst new file mode 100644 index 00000000000..1147ee54c9e --- /dev/null +++ b/changelog/13478.bugfix.rst @@ -0,0 +1 @@ +Fixed a crash when using :confval:`console_output_style` with ``times`` and a module is skipped. diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 5f27c46b41e..a95f79ba6b6 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -734,7 +734,9 @@ def _get_progress_information_message(self) -> str: last_in_module = tests_completed == tests_in_module if self.showlongtestinfo or last_in_module: self._timing_nodeids_reported.update(r.nodeid for r in not_reported) - return format_node_duration(sum(r.duration for r in not_reported)) + return format_node_duration( + sum(r.duration for r in not_reported if isinstance(r, TestReport)) + ) return "" if collected: return f" [{len(self._progress_nodeids_reported) * 100 // collected:3d}%]" diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 3ea10195c6b..8c50311e9aa 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -112,6 +112,31 @@ def test_func(): [" def test_func():", "> assert 0", "E assert 0"] ) + def test_console_output_style_times_with_skipped_and_passed( + self, pytester: Pytester + ) -> None: + pytester.makepyfile( + test_repro=""" + def test_hello(): + pass + """, + test_repro_skip=""" + import pytest + pytest.importorskip("fakepackage_does_not_exist") + """, + ) + result = pytester.runpytest( + "test_repro.py", + "test_repro_skip.py", + "-o", + "console_output_style=times", + ) + + result.stdout.fnmatch_lines("* 1 passed, 1 skipped in *") + + combined = "\n".join(result.stdout.lines + result.stderr.lines) + assert "INTERNALERROR" not in combined + def test_internalerror(self, pytester: Pytester, linecomp) -> None: modcol = pytester.getmodulecol("def test_one(): pass") rep = TerminalReporter(modcol.config, file=linecomp.stringio) From 39ed26ac3eb06e9402294e7ff6274d9c686245d1 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Sat, 5 Jul 2025 15:50:47 +0200 Subject: [PATCH 042/270] doc: fix grammar error i.e. -> e.g. (#13586) The list is probably not exhaustive hence e.g. should be used not I.e. --- doc/en/how-to/assert.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/how-to/assert.rst b/doc/en/how-to/assert.rst index c83fb93c4b1..8e368c35f7a 100644 --- a/doc/en/how-to/assert.rst +++ b/doc/en/how-to/assert.rst @@ -556,7 +556,7 @@ Note that you still get the benefits of assertion introspection, the only change the ``.pyc`` files won't be cached on disk. Additionally, rewriting will silently skip caching if it cannot write new ``.pyc`` files, -i.e. in a read-only filesystem or a zipfile. +e.g. in a read-only filesystem or a zipfile. Disabling assert rewriting From 22351c4febaee3ffdceb6289acaaefdf63b93f23 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 08:44:20 +0200 Subject: [PATCH 043/270] [pre-commit.ci] pre-commit autoupdate (#13590) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.1 → v0.12.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.1...v0.12.2) - [github.com/woodruffw/zizmor-pre-commit: v1.10.0 → v1.11.0](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.10.0...v1.11.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 90a485abbbf..cea670682c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.1" + rev: "v0.12.2" hooks: - id: ruff args: ["--fix"] @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.10.0 + rev: v1.11.0 hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs From c486cdb7a3aeb5d98efb84ce00f49feb1977e4c5 Mon Sep 17 00:00:00 2001 From: Eero Vaher Date: Tue, 8 Jul 2025 08:47:26 +0200 Subject: [PATCH 044/270] Update URL of `pytest-doctestplus` (#13589) --- doc/en/how-to/doctest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/how-to/doctest.rst b/doc/en/how-to/doctest.rst index c2a6cc8e958..0a778a8a246 100644 --- a/doc/en/how-to/doctest.rst +++ b/doc/en/how-to/doctest.rst @@ -307,7 +307,7 @@ While the built-in pytest support provides a good set of functionalities for usi doctests, if you use them extensively you might be interested in those external packages which add many more features, and include pytest integration: -* `pytest-doctestplus `__: provides +* `pytest-doctestplus `__: provides advanced doctest support and enables the testing of reStructuredText (".rst") files. * `Sybil `__: provides a way to test examples in From 1d7d63555e431d4562bcacbdc97038b0613d20ba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:43:30 +0200 Subject: [PATCH 045/270] [automated] Update plugin list (#13588) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 178 +++++++++++++++++++++---------- 1 file changed, 121 insertions(+), 57 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index fe46889c000..f131b07c0f2 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =3.5.0) :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) :pypi:`pytest-annotated` Pytest plugin to allow use of Annotated in tests to resolve fixtures Sep 30, 2024 N/A pytest>=8.3.3 - :pypi:`pytest-ansible` Plugin for pytest to simplify calling ansible modules from tests or fixtures Jun 26, 2025 5 - Production/Stable pytest>=6 + :pypi:`pytest-ansible` Plugin for pytest to simplify calling ansible modules from tests or fixtures Jul 01, 2025 5 - Production/Stable pytest>=6 :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A @@ -122,7 +122,7 @@ This list contains 1658 plugins. :pypi:`pytest_async` pytest-async - Run your coroutine in event loop without decorator Feb 26, 2020 N/A N/A :pypi:`pytest-async-benchmark` pytest-async-benchmark: Modern pytest benchmarking for async code. 🚀 May 28, 2025 N/A pytest>=8.3.5 :pypi:`pytest-async-generators` Pytest fixtures for async generators Jul 05, 2023 N/A N/A - :pypi:`pytest-asyncio` Pytest support for asyncio May 26, 2025 4 - Beta pytest<9,>=8.2 + :pypi:`pytest-asyncio` Pytest support for asyncio Jun 30, 2025 4 - Beta pytest<9,>=8.2 :pypi:`pytest-asyncio-concurrent` Pytest plugin to execute python async tests concurrently. May 17, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jun 24, 2025 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) @@ -143,6 +143,7 @@ This list contains 1658 plugins. :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest :pypi:`pytest-aviator` Aviator's Flakybot pytest plugin that automatically reruns flaky tests. Nov 04, 2022 4 - Beta pytest :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-awaiting-fix` A simple plugin to use with pytest for traceability across Jira and disabled automated tests Jul 01, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-apigateway` pytest plugin for AWS ApiGateway May 24, 2024 4 - Beta pytest :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A @@ -166,7 +167,7 @@ This list contains 1658 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 28, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jul 03, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -301,7 +302,7 @@ This list contains 1658 plugins. :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts May 31, 2023 4 - Beta pytest (>=4.0.0) :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest - :pypi:`pytest-container` Pytest fixtures for writing container based tests Dec 04, 2024 4 - Beta pytest>=3.10 + :pypi:`pytest-container` Pytest fixtures for writing container based tests Jun 30, 2025 4 - Beta pytest>=3.10 :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A :pypi:`pytest-contexts` A plugin to run tests written with the Contexts framework using pytest May 19, 2021 4 - Beta N/A :pypi:`pytest-continuous` A pytest plugin to run tests continuously until failure or interruption. Apr 23, 2024 N/A N/A @@ -395,6 +396,7 @@ This list contains 1658 plugins. :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) :pypi:`pytest-dino-fm` Minimal package created automatically Jun 27, 2025 N/A N/A + :pypi:`pytest-directives` Control your tests flow Jul 01, 2025 3 - Alpha N/A :pypi:`pytest-dir-equal` pytest-dir-equals is a pytest plugin providing helpers to assert directories equality allowing golden testing Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-dirty` Static import analysis for thrifty testing. Jun 08, 2025 3 - Alpha pytest>=8.2; extra == "dev" :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A @@ -429,7 +431,7 @@ This list contains 1658 plugins. :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A - :pypi:`pytest-docker` Simple pytest fixtures for Docker and Docker Compose based tests May 26, 2025 N/A pytest<9.0,>=4.0 + :pypi:`pytest-docker` Simple pytest fixtures for Docker and Docker Compose based tests Jul 04, 2025 N/A pytest<9.0,>=4.0 :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Aug 12, 2024 4 - Beta pytest :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) @@ -469,8 +471,8 @@ This list contains 1658 plugins. :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 - :pypi:`pytest-dsl` A DSL testing framework based on pytest Jun 28, 2025 N/A pytest>=7.0.0 - :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jun 10, 2025 N/A pytest>=7.0.0; extra == "dev" + :pypi:`pytest-dsl` A DSL testing framework based on pytest Jul 03, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jul 03, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A @@ -533,7 +535,7 @@ This list contains 1658 plugins. :pypi:`pytest_evm` The testing package containing tools to test Web3-based projects Sep 23, 2024 4 - Beta pytest<9.0.0,>=8.1.1 :pypi:`pytest_exact_fixtures` Parse queries in Lucene and Elasticsearch syntaxes Feb 04, 2019 N/A N/A :pypi:`pytest-examples` Pytest plugin for testing examples in docstrings and markdown files. May 06, 2025 N/A pytest>=7 - :pypi:`pytest-exasol-backend` Jun 06, 2025 N/A pytest<9,>=7 + :pypi:`pytest-exasol-backend` Jul 02, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-extension` Jun 13, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-itde` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-saas` Nov 22, 2024 N/A pytest<9,>=7 @@ -565,7 +567,7 @@ This list contains 1658 plugins. :pypi:`pytest-f3ts` Pytest Plugin for communicating test results and information to a FixturFab Test Runner GUI May 08, 2025 N/A pytest<8.0.0,>=7.2.1 :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. Jun 28, 2025 6 - Mature pytest>=7.0 + :pypi:`pytest-factoryboy` Factory Boy support for pytest. Jul 01, 2025 6 - Mature pytest>=7.0 :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screen-record` Create a video of the screen when pytest fails Jan 05, 2023 4 - Beta pytest (>=7.1.2d,<8.0.0) @@ -684,9 +686,11 @@ This list contains 1658 plugins. :pypi:`pytest-group-by-class` A Pytest plugin for running a subset of your tests by splitting them in to groups of classes. Jun 27, 2023 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) + :pypi:`pytest-grpc-aio` pytest plugin for grpc.aio Jul 02, 2025 N/A pytest>=3.6.0 :pypi:`pytest-grunnur` Py.Test plugin for Grunnur-based packages. Jul 26, 2024 N/A pytest>=6 :pypi:`pytest_gui_status` Show pytest status in gui Jan 23, 2016 N/A pytest :pypi:`pytest-hammer-artifacts` Minimal package created automatically Jun 27, 2025 N/A N/A + :pypi:`pytest-hammer-cluster` Minimal package created automatically Jun 30, 2025 N/A N/A :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-hardware-test-report` A simple plugin to use with pytest Apr 01, 2024 4 - Beta pytest<9.0.0,>=8.0.0 :pypi:`pytest-harmony` Chain tests and data with pytest Jan 17, 2023 N/A pytest (>=7.2.1,<8.0.0) @@ -704,7 +708,7 @@ This list contains 1658 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 28, 2025 3 - Alpha pytest==8.4.0 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 05, 2025 3 - Alpha pytest==8.4.0 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -762,7 +766,7 @@ This list contains 1658 plugins. :pypi:`pytest-initry` Plugin for sending automation test data from Pytest to the initry Apr 30, 2024 N/A pytest<9.0.0,>=8.1.1 :pypi:`pytest-inline` A pytest plugin for writing inline tests Oct 24, 2024 4 - Beta pytest<9.0,>=7.0 :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Apr 09, 2025 5 - Production/Stable pytest - :pypi:`pytest-inmanta-extensions` Inmanta tests package May 27, 2025 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Jul 04, 2025 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 19, 2025 5 - Production/Stable N/A :pypi:`pytest-inmanta-srlinux` Pytest library to facilitate end to end testing of inmanta projects Apr 22, 2025 3 - Alpha N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Feb 22, 2024 4 - Beta pytest @@ -772,19 +776,19 @@ This list contains 1658 plugins. :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 19, 2024 N/A pytest (>=7.2.0,<9.0.0) :pypi:`pytest-instafail` pytest plugin to show failures instantly Mar 31, 2023 4 - Beta pytest (>=5) :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) + :pypi:`pytest-insubprocess` A pytest plugin to execute test cases in a subprocess Jul 01, 2025 4 - Beta pytest>=7.4 :pypi:`pytest-integration` Organizing pytests by integration or not Nov 17, 2022 N/A N/A :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest May 22, 2023 N/A pytest (>=5.2) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) :pypi:`pytest-interface-tester` Pytest plugin for checking charm relation interface protocol compliance. Feb 13, 2025 4 - Beta pytest - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Jun 27, 2025 5 - Production/Stable pytest<9.0.0,>=6 + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Jul 01, 2025 5 - Production/Stable pytest<9.0.0,>=6 :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-iovis` A Pytest plugin to enable Jupyter Notebook testing with Papermill Nov 06, 2024 4 - Beta pytest>=7.1.0 :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest - :pypi:`pytest-ipywidgets` Jun 19, 2025 N/A pytest - :pypi:`pytest-iso` Plugin for pytest to produce test documentation for code audits. May 15, 2025 4 - Beta pytest<9.0.0,>=7.4.0 + :pypi:`pytest-ipywidgets` Jul 04, 2025 N/A pytest :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Jun 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 :pypi:`pytest-isort` py.test plugin to check import ordering using isort Mar 05, 2024 5 - Production/Stable pytest (>=5.0) @@ -831,6 +835,7 @@ This list contains 1658 plugins. :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :pypi:`pytest-kubernetes` Feb 04, 2025 N/A pytest<9.0.0,>=8.3.0 + :pypi:`pytest_kustomize` Parse and validate kustomize output Jul 03, 2025 N/A N/A :pypi:`pytest-kuunda` pytest plugin to help with test data setup for PySpark tests Feb 25, 2024 4 - Beta pytest >=6.2.0 :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 27, 2024 5 - Production/Stable pytest<9,>=3.6 @@ -936,6 +941,7 @@ This list contains 1658 plugins. :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest May 26, 2025 5 - Production/Stable pytest>=6.2.5 + :pypi:`pytest-mock-2.0.0` Minimal package created automatically Jun 30, 2025 N/A N/A :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest @@ -953,7 +959,7 @@ This list contains 1658 plugins. :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Feb 28, 2025 5 - Production/Stable pytest>=6.2 :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures May 16, 2023 5 - Production/Stable N/A :pypi:`pytest-mongodb-nono` pytest plugin for MongoDB Jan 07, 2025 N/A N/A - :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jun 09, 2025 N/A N/A + :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jul 03, 2025 N/A N/A :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Jun 25, 2023 5 - Production/Stable pytest :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A @@ -1012,7 +1018,7 @@ This list contains 1658 plugins. :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Feb 26, 2024 5 - Production/Stable N/A :pypi:`pytest-oar` PyTest plugin for the OAR testing framework May 12, 2025 N/A pytest>=6.0.1 - :pypi:`pytest-oarepo` Jun 19, 2025 N/A pytest>=7.1.2; extra == "base" + :pypi:`pytest-oarepo` Jul 02, 2025 N/A pytest>=7.1.2; extra == "base" :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odc` A pytest plugin for simplifying ODC database tests Aug 04, 2023 4 - Beta pytest (>=3.5.0) @@ -1029,7 +1035,7 @@ This list contains 1658 plugins. :pypi:`pytest-open-html` Auto-open HTML reports after pytest runs Mar 31, 2025 N/A pytest>=6.0 :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Apr 25, 2025 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Mar 22, 2025 5 - Production/Stable pytest>=5.0 - :pypi:`pytest-operator` Fixtures for Operators Sep 28, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Charmed Operators Sep 28, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Apr 15, 2025 4 - Beta pytest; extra == "dev" :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -1103,7 +1109,7 @@ This list contains 1658 plugins. :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A - :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Jun 25, 2025 N/A N/A + :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Jul 02, 2025 N/A N/A :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) @@ -1186,7 +1192,7 @@ This list contains 1658 plugins. :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 14, 2024 5 - Production/Stable pytest>=6.0 :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A - :pypi:`pytest-qt` pytest support for PyQt and PySide applications Feb 07, 2024 5 - Production/Stable pytest + :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jul 01, 2025 5 - Production/Stable pytest :pypi:`pytest-qt-app` QT app fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 05, 2022 4 - Beta pytest (>=4.0) @@ -1219,7 +1225,7 @@ This list contains 1658 plugins. :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A :pypi:`pytest-regex` Select pytest tests with regular expressions May 29, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. May 30, 2025 5 - Production/Stable pytest>=6.2.0 + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jul 04, 2025 5 - Production/Stable pytest>=6.2.0 :pypi:`pytest-regtest` pytest plugin for snapshot regression testing Nov 12, 2024 N/A pytest>7.2 :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relative-path` Handle relative path in pytest options or ini configs Aug 30, 2024 N/A pytest @@ -1237,7 +1243,7 @@ This list contains 1658 plugins. :pypi:`pytest-reporter` Generate Pytest reports with templates Feb 28, 2024 4 - Beta pytest :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest May 06, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A - :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jun 21, 2025 N/A N/A + :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jun 29, 2025 N/A N/A :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Jun 12, 2025 N/A pytest>=8.0.0 :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) @@ -1248,6 +1254,7 @@ This list contains 1658 plugins. :pypi:`pytest-report-stream` A pytest plugin which allows to stream test reports at runtime Oct 22, 2023 4 - Beta N/A :pypi:`pytest-repo-structure` Pytest Repo Structure Mar 18, 2024 1 - Planning N/A :pypi:`pytest-req` pytest requests plugin Aug 31, 2024 5 - Production/Stable pytest<9.0.0,>=8.3.2 + :pypi:`pytest-reqcov` A pytest plugin for requirement coverage tracking Jul 04, 2025 3 - Alpha pytest>=6.0 :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A @@ -1319,7 +1326,7 @@ This list contains 1658 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 04, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1331,12 +1338,12 @@ This list contains 1658 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 04, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 :pypi:`pytest-send-email` Send pytest execution result email Sep 02, 2024 N/A pytest - :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Jun 16, 2025 N/A pytest + :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Jul 01, 2025 N/A pytest :pypi:`pytest-sequence-markers` Pytest plugin for sequencing markers for execution of tests May 23, 2023 5 - Production/Stable N/A :pypi:`pytest-server` test server exec cmd Sep 09, 2024 N/A N/A :pypi:`pytest-server-fixtures` Extensible server fixtures for py.test Nov 29, 2024 5 - Production/Stable pytest @@ -1642,7 +1649,7 @@ This list contains 1658 plugins. :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest :pypi:`pytest-workaround-12888` forces an import of readline early in the process to work around pytest bug #12888 Jan 15, 2025 N/A N/A :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Mar 18, 2024 5 - Production/Stable pytest >=7.0.0 - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs May 26, 2025 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Jul 01, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-gnumake` A small example package Jun 22, 2025 N/A pytest @@ -1678,6 +1685,7 @@ This list contains 1658 plugins. :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Apr 09, 2025 N/A pytest<9.0.0,>=8.3.3 :pypi:`pytest-youqu-playwright` pytest-youqu-playwright Jun 12, 2024 N/A pytest + :pypi:`pytest-yt-local` Minimal package created automatically Jun 30, 2025 N/A N/A :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0 :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A @@ -2020,7 +2028,7 @@ This list contains 1658 plugins. Pytest plugin to allow use of Annotated in tests to resolve fixtures :pypi:`pytest-ansible` - *last release*: Jun 26, 2025, + *last release*: Jul 01, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6 @@ -2314,7 +2322,7 @@ This list contains 1658 plugins. Pytest fixtures for async generators :pypi:`pytest-asyncio` - *last release*: May 26, 2025, + *last release*: Jun 30, 2025, *status*: 4 - Beta, *requires*: pytest<9,>=8.2 @@ -2460,6 +2468,13 @@ This list contains 1658 plugins. Makes pytest skip tests that don not need rerunning + :pypi:`pytest-awaiting-fix` + *last release*: Jul 01, 2025, + *status*: 4 - Beta, + *requires*: pytest>=6.2.0 + + A simple plugin to use with pytest for traceability across Jira and disabled automated tests + :pypi:`pytest-aws` *last release*: Oct 04, 2017, *status*: 4 - Beta, @@ -2622,7 +2637,7 @@ This list contains 1658 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Jun 28, 2025, + *last release*: Jul 03, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -3567,7 +3582,7 @@ This list contains 1658 plugins. pytest plugin with fixtures for testing consul aware apps :pypi:`pytest-container` - *last release*: Dec 04, 2024, + *last release*: Jun 30, 2025, *status*: 4 - Beta, *requires*: pytest>=3.10 @@ -4224,6 +4239,13 @@ This list contains 1658 plugins. Minimal package created automatically + :pypi:`pytest-directives` + *last release*: Jul 01, 2025, + *status*: 3 - Alpha, + *requires*: N/A + + Control your tests flow + :pypi:`pytest-dir-equal` *last release*: Dec 11, 2023, *status*: 4 - Beta, @@ -4463,7 +4485,7 @@ This list contains 1658 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: May 26, 2025, + *last release*: Jul 04, 2025, *status*: N/A, *requires*: pytest<9.0,>=4.0 @@ -4743,14 +4765,14 @@ This list contains 1658 plugins. A Pytest plugin to ignore tests during collection without reporting them in the test summary. :pypi:`pytest-dsl` - *last release*: Jun 28, 2025, + *last release*: Jul 03, 2025, *status*: N/A, *requires*: pytest>=7.0.0 A DSL testing framework based on pytest :pypi:`pytest-dsl-ui` - *last release*: Jun 10, 2025, + *last release*: Jul 03, 2025, *status*: N/A, *requires*: pytest>=7.0.0; extra == "dev" @@ -5191,7 +5213,7 @@ This list contains 1658 plugins. Pytest plugin for testing examples in docstrings and markdown files. :pypi:`pytest-exasol-backend` - *last release*: Jun 06, 2025, + *last release*: Jul 02, 2025, *status*: N/A, *requires*: pytest<9,>=7 @@ -5415,7 +5437,7 @@ This list contains 1658 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: Jun 28, 2025, + *last release*: Jul 01, 2025, *status*: 6 - Mature, *requires*: pytest>=7.0 @@ -6247,6 +6269,13 @@ This list contains 1658 plugins. pytest plugin for grpc + :pypi:`pytest-grpc-aio` + *last release*: Jul 02, 2025, + *status*: N/A, + *requires*: pytest>=3.6.0 + + pytest plugin for grpc.aio + :pypi:`pytest-grunnur` *last release*: Jul 26, 2024, *status*: N/A, @@ -6268,6 +6297,13 @@ This list contains 1658 plugins. Minimal package created automatically + :pypi:`pytest-hammer-cluster` + *last release*: Jun 30, 2025, + *status*: N/A, + *requires*: N/A + + Minimal package created automatically + :pypi:`pytest-hammertime` *last release*: Jul 28, 2018, *status*: N/A, @@ -6388,7 +6424,7 @@ This list contains 1658 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 28, 2025, + *last release*: Jul 05, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.0 @@ -6794,7 +6830,7 @@ This list contains 1658 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: May 27, 2025, + *last release*: Jul 04, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -6863,6 +6899,13 @@ This list contains 1658 plugins. pytest plugin to instrument tests + :pypi:`pytest-insubprocess` + *last release*: Jul 01, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.4 + + A pytest plugin to execute test cases in a subprocess + :pypi:`pytest-integration` *last release*: Nov 17, 2022, *status*: N/A, @@ -6899,7 +6942,7 @@ This list contains 1658 plugins. Pytest plugin for checking charm relation interface protocol compliance. :pypi:`pytest-invenio` - *last release*: Jun 27, 2025, + *last release*: Jul 01, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9.0.0,>=6 @@ -6941,19 +6984,12 @@ This list contains 1658 plugins. Pytest plugin to run tests in Jupyter Notebooks :pypi:`pytest-ipywidgets` - *last release*: Jun 19, 2025, + *last release*: Jul 04, 2025, *status*: N/A, *requires*: pytest - :pypi:`pytest-iso` - *last release*: May 15, 2025, - *status*: 4 - Beta, - *requires*: pytest<9.0.0,>=7.4.0 - - Plugin for pytest to produce test documentation for code audits. - :pypi:`pytest-isolate` *last release*: Jun 08, 2025, *status*: 4 - Beta, @@ -7276,6 +7312,13 @@ This list contains 1658 plugins. + :pypi:`pytest_kustomize` + *last release*: Jul 03, 2025, + *status*: N/A, + *requires*: N/A + + Parse and validate kustomize output + :pypi:`pytest-kuunda` *last release*: Feb 25, 2024, *status*: 4 - Beta, @@ -8011,6 +8054,13 @@ This list contains 1658 plugins. Thin-wrapper around the mock package for easier use with pytest + :pypi:`pytest-mock-2.0.0` + *last release*: Jun 30, 2025, + *status*: N/A, + *requires*: N/A + + Minimal package created automatically + :pypi:`pytest-mock-api` *last release*: Feb 13, 2019, *status*: 1 - Planning, @@ -8131,7 +8181,7 @@ This list contains 1658 plugins. pytest plugin for MongoDB :pypi:`pytest-mongodb-ry` - *last release*: Jun 09, 2025, + *last release*: Jul 03, 2025, *status*: N/A, *requires*: N/A @@ -8544,7 +8594,7 @@ This list contains 1658 plugins. PyTest plugin for the OAR testing framework :pypi:`pytest-oarepo` - *last release*: Jun 19, 2025, + *last release*: Jul 02, 2025, *status*: N/A, *requires*: pytest>=7.1.2; extra == "base" @@ -8667,7 +8717,7 @@ This list contains 1658 plugins. *status*: N/A, *requires*: pytest - Fixtures for Operators + Fixtures for Charmed Operators :pypi:`pytest-optional` *last release*: Oct 07, 2015, @@ -9181,7 +9231,7 @@ This list contains 1658 plugins. A pytest fixture for visual testing with Playwright :pypi:`pytest-playwright-visual-snapshot` - *last release*: Jun 25, 2025, + *last release*: Jul 02, 2025, *status*: N/A, *requires*: N/A @@ -9762,7 +9812,7 @@ This list contains 1658 plugins. pytest plugin to generate test result QR codes :pypi:`pytest-qt` - *last release*: Feb 07, 2024, + *last release*: Jul 01, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -9993,7 +10043,7 @@ This list contains 1658 plugins. Management of Pytest dependencies via regex patterns :pypi:`pytest-regressions` - *last release*: May 30, 2025, + *last release*: Jul 04, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6.2.0 @@ -10119,7 +10169,7 @@ This list contains 1658 plugins. A basic HTML report for pytest using Jinja2 template engine. :pypi:`pytest-reporter-plus` - *last release*: Jun 21, 2025, + *last release*: Jun 29, 2025, *status*: N/A, *requires*: N/A @@ -10195,6 +10245,13 @@ This list contains 1658 plugins. pytest requests plugin + :pypi:`pytest-reqcov` + *last release*: Jul 04, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=6.0 + + A pytest plugin for requirement coverage tracking + :pypi:`pytest-reqs` *last release*: May 12, 2019, *status*: N/A, @@ -10693,7 +10750,7 @@ This list contains 1658 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Jun 17, 2025, + *last release*: Jul 04, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10777,7 +10834,7 @@ This list contains 1658 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Jun 17, 2025, + *last release*: Jul 04, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10812,7 +10869,7 @@ This list contains 1658 plugins. Send pytest execution result email :pypi:`pytest-sentry` - *last release*: Jun 16, 2025, + *last release*: Jul 01, 2025, *status*: N/A, *requires*: pytest @@ -12954,7 +13011,7 @@ This list contains 1658 plugins. A pytest plugin for configuring workflow/pipeline tests using YAML files :pypi:`pytest-xdist` - *last release*: May 26, 2025, + *last release*: Jul 01, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0.0 @@ -13205,6 +13262,13 @@ This list contains 1658 plugins. pytest-youqu-playwright + :pypi:`pytest-yt-local` + *last release*: Jun 30, 2025, + *status*: N/A, + *requires*: N/A + + Minimal package created automatically + :pypi:`pytest-yuk` *last release*: Mar 26, 2021, *status*: N/A, From c02465cee0250cd8040a06032ec8732a6228bd13 Mon Sep 17 00:00:00 2001 From: karlicoss Date: Sat, 12 Jul 2025 12:03:22 +0100 Subject: [PATCH 046/270] Support PEP420 (implicit namespace packages) as `--pyargs` target. (#13426) Previously, when running `--pyargs pkg`, if you didn't have `pkg/__init__.py`, pytest would fail with `ERROR: module or package not found: pkg (missing __init__.py?)`. If used in conjunction with `consider_namespace_packages` in config, pytest discovers the package and tests inside it correctly. If used in conjunction with `consider_namespace_packages` in config, test modules get correct `__package__` and `__name__` attributes as well. In addition, remove `"namespace"` origin handling -- this value isn't used since python 3.8. See: - https://github.com/python/cpython/pull/5481 - https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec.submodule_search_locations Fixes #478 Fixes #2371 Fixes #10569 --- changelog/478.feature.rst | 3 ++ doc/en/reference/reference.rst | 1 + src/_pytest/main.py | 42 +++++++++++++++++++---- testing/test_collection.py | 61 ++++++++++++++++++++++++++++++++++ testing/test_main.py | 17 ++++++++-- 5 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 changelog/478.feature.rst diff --git a/changelog/478.feature.rst b/changelog/478.feature.rst new file mode 100644 index 00000000000..cd13ddd9733 --- /dev/null +++ b/changelog/478.feature.rst @@ -0,0 +1,3 @@ +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/reference/reference.rst b/doc/en/reference/reference.rst index cfdc3eb3421..7ec1b110baf 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1384,6 +1384,7 @@ passed multiple times. The expected format is ``name=value``. For example:: when collecting Python modules. Default is ``False``. Set to ``True`` if the package you are testing is part of a namespace package. + Namespace packages are also supported as ``--pyargs`` target. Only `native namespace packages `__ are supported, with no plans to support `legacy namespace packages `__. diff --git a/src/_pytest/main.py b/src/_pytest/main.py index dac084b553a..77d8b52ca46 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -774,6 +774,9 @@ def perform_collect( self._collection_cache = {} self.items = [] items: Sequence[nodes.Item | nodes.Collector] = self.items + consider_namespace_packages: bool = self.config.getini( + "consider_namespace_packages" + ) try: initialpaths: list[Path] = [] initialpaths_with_parents: list[Path] = [] @@ -782,6 +785,7 @@ def perform_collect( self.config.invocation_params.dir, arg, as_pypath=self.config.option.pyargs, + consider_namespace_packages=consider_namespace_packages, ) self._initial_parts.append(collection_argument) initialpaths.append(collection_argument.path) @@ -981,7 +985,9 @@ def genitems(self, node: nodes.Item | nodes.Collector) -> Iterator[nodes.Item]: node.ihook.pytest_collectreport(report=rep) -def search_pypath(module_name: str) -> str | None: +def search_pypath( + module_name: str, *, consider_namespace_packages: bool = False +) -> str | None: """Search sys.path for the given a dotted module name, and return its file system path if found.""" try: @@ -991,13 +997,29 @@ def search_pypath(module_name: str) -> str | None: # ValueError: not a module name except (AttributeError, ImportError, ValueError): return None - if spec is None or spec.origin is None or spec.origin == "namespace": + + if spec is None: return None - elif spec.submodule_search_locations: - return os.path.dirname(spec.origin) - else: + + if ( + spec.submodule_search_locations is None + or len(spec.submodule_search_locations) == 0 + ): + # Must be a simple module. return spec.origin + if consider_namespace_packages: + # If submodule_search_locations is set, it's a package (regular or namespace). + # Typically there is a single entry, but documentation claims it can be empty too + # (e.g. if the package has no physical location). + return spec.submodule_search_locations[0] + + if spec.origin is None: + # This is only the case for namespace packages + return None + + return os.path.dirname(spec.origin) + @dataclasses.dataclass(frozen=True) class CollectionArgument: @@ -1009,7 +1031,11 @@ class CollectionArgument: def resolve_collection_argument( - invocation_path: Path, arg: str, *, as_pypath: bool = False + invocation_path: Path, + arg: str, + *, + as_pypath: bool = False, + consider_namespace_packages: bool = False, ) -> CollectionArgument: """Parse path arguments optionally containing selection parts and return (fspath, names). @@ -1049,7 +1075,9 @@ def resolve_collection_argument( parts[-1] = f"{parts[-1]}{squacket}{rest}" module_name = None if as_pypath: - pyarg_strpath = search_pypath(strpath) + pyarg_strpath = search_pypath( + strpath, consider_namespace_packages=consider_namespace_packages + ) if pyarg_strpath is not None: module_name = strpath strpath = pyarg_strpath diff --git a/testing/test_collection.py b/testing/test_collection.py index a8bff2847ba..76091744dc6 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1935,3 +1935,64 @@ def test_func(): result = pytester.runpytest() assert result.ret == 0 result.stdout.fnmatch_lines(["*1 passed*"]) + + +@pytest.mark.parametrize("import_mode", ["prepend", "importlib", "append"]) +def test_namespace_packages(pytester: Pytester, import_mode: str): + pytester.makeini( + f""" + [pytest] + consider_namespace_packages = true + pythonpath = . + python_files = *.py + addopts = --import-mode {import_mode} + """ + ) + pytester.makepyfile( + **{ + "pkg/module1.py": "def test_module1(): pass", + "pkg/subpkg_namespace/module2.py": "def test_module1(): pass", + "pkg/subpkg_regular/__init__.py": "", + "pkg/subpkg_regular/module3": "def test_module3(): pass", + } + ) + + # should collect when called with top-level package correctly + result = pytester.runpytest("--collect-only", "--pyargs", "pkg") + result.stdout.fnmatch_lines( + [ + "collected 3 items", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + ] + ) + + # should also work when called against a more specific subpackage/module + result = pytester.runpytest("--collect-only", "--pyargs", "pkg.subpkg_namespace") + result.stdout.fnmatch_lines( + [ + "collected 1 item", + "", + " ", + " ", + " ", + ] + ) + + result = pytester.runpytest("--collect-only", "--pyargs", "pkg.subpkg_regular") + result.stdout.fnmatch_lines( + [ + "collected 1 item", + "", + " ", + " ", + " ", + ] + ) diff --git a/testing/test_main.py b/testing/test_main.py index 94eac02ce63..4a5591bb361 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -169,8 +169,13 @@ def test_dir(self, invocation_path: Path) -> None: ): resolve_collection_argument(invocation_path, "src/pkg::foo::bar") - def test_pypath(self, invocation_path: Path) -> None: + @pytest.mark.parametrize("namespace_package", [False, True]) + def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None: """Dotted name and parts.""" + if namespace_package: + # Namespace package doesn't have to contain __init__py + (invocation_path / "src/pkg/__init__.py").unlink() + assert resolve_collection_argument( invocation_path, "pkg.test", as_pypath=True ) == CollectionArgument( @@ -186,7 +191,10 @@ def test_pypath(self, invocation_path: Path) -> None: module_name="pkg.test", ) assert resolve_collection_argument( - invocation_path, "pkg", as_pypath=True + invocation_path, + "pkg", + as_pypath=True, + consider_namespace_packages=namespace_package, ) == CollectionArgument( path=invocation_path / "src/pkg", parts=[], @@ -197,7 +205,10 @@ def test_pypath(self, invocation_path: Path) -> None: UsageError, match=r"package argument cannot contain :: selection parts" ): resolve_collection_argument( - invocation_path, "pkg::foo::bar", as_pypath=True + invocation_path, + "pkg::foo::bar", + as_pypath=True, + consider_namespace_packages=namespace_package, ) def test_parametrized_name_with_colons(self, invocation_path: Path) -> None: From 678c1a1e3318948f32d078c3d058d71b6b2849b0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 13 Jul 2025 04:48:36 +0000 Subject: [PATCH 047/270] [automated] Update plugin list (#13595) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 130 ++++++++++++++++++++----------- 1 file changed, 85 insertions(+), 45 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index f131b07c0f2..6b0ea057187 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =8.3 - :pypi:`logassert` Simple but powerful assertion and verification of logged lines May 15, 2025 5 - Production/Stable pytest; extra == "dev" + :pypi:`logassert` Simple but powerful assertion and verification of logged lines Jul 12, 2025 5 - Production/Stable pytest; extra == "dev" :pypi:`logot` Test whether your code is logging correctly 🪵 May 05, 2025 5 - Production/Stable pytest; extra == "pytest" :pypi:`nuts` Network Unit Testing System May 10, 2025 N/A pytest<8,>=7 :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Apr 07, 2023 N/A N/A @@ -80,7 +80,7 @@ This list contains 1666 plugins. :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jul 31, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) :pypi:`pytest-annotated` Pytest plugin to allow use of Annotated in tests to resolve fixtures Sep 30, 2024 N/A pytest>=8.3.3 - :pypi:`pytest-ansible` Plugin for pytest to simplify calling ansible modules from tests or fixtures Jul 01, 2025 5 - Production/Stable pytest>=6 + :pypi:`pytest-ansible` Plugin for pytest to simplify calling ansible modules from tests or fixtures Jul 07, 2025 5 - Production/Stable pytest>=6 :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A @@ -167,7 +167,7 @@ This list contains 1666 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jul 03, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jul 11, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -265,7 +265,7 @@ This list contains 1666 plugins. :pypi:`pytest-cleanslate` Collects and executes pytest tests separately Apr 10, 2025 N/A pytest :pypi:`pytest_cleanup` Automated, comprehensive and well-organised pytest test cases. Jan 28, 2020 N/A N/A :pypi:`pytest-cleanuptotal` A cleanup plugin for pytest Nov 08, 2024 5 - Production/Stable N/A - :pypi:`pytest-clerk` A set of pytest fixtures to help with integration testing with Clerk. Jan 30, 2025 N/A pytest<9.0.0,>=8.0.0 + :pypi:`pytest-clerk` A set of pytest fixtures to help with integration testing with Clerk. Jul 10, 2025 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-cli2-ansible` Mar 05, 2025 N/A N/A :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-cli-fixtures` Automatically register fixtures for custom CLI arguments Jul 28, 2022 N/A pytest (~=7.0) @@ -286,7 +286,7 @@ This list contains 1666 plugins. :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Jun 10, 2025 5 - Production/Stable pytest>=3.8 + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Jul 10, 2025 5 - Production/Stable pytest>=3.8 :pypi:`pytest-collect-appoint-info` set your encoding Aug 03, 2023 N/A pytest :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A @@ -408,7 +408,7 @@ This list contains 1666 plugins. :pypi:`pytest-ditto-pyarrow` pytest-ditto plugin for pyarrow tables. Jun 09, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-django` A Django plugin for pytest. Apr 03, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Jun 06, 2025 5 - Production/Stable pytest + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Jul 12, 2025 5 - Production/Stable pytest :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A :pypi:`pytest-django-class` A pytest plugin for running django in class-scoped fixtures Aug 08, 2023 4 - Beta N/A @@ -658,7 +658,7 @@ This list contains 1666 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jun 13, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 09, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -741,7 +741,7 @@ This list contains 1666 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jun 25, 2025 4 - Beta pytest>=7.0.0 + :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jul 09, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Feb 06, 2025 4 - Beta pytest>=7.1 :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Dec 05, 2023 4 - Beta pytest :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A @@ -751,7 +751,7 @@ This list contains 1666 plugins. :pypi:`pytest-ignore-test-results` A pytest plugin to ignore test results. Feb 03, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-image-diff` Dec 31, 2024 3 - Alpha pytest :pypi:`pytest-image-snapshot` A pytest plugin for image snapshot management and comparison. Jul 01, 2024 4 - Beta pytest>=3.5.0 - :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. Jun 07, 2025 4 - Beta pytest>=8.0.0 + :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. Jul 12, 2025 4 - Beta pytest>=8.0.0 :pypi:`pytest-import-check` pytest plugin to check whether Python modules can be imported Jul 19, 2024 3 - Alpha pytest>=8.1 :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-infinity` Jun 09, 2024 N/A pytest<9.0.0,>=8.0.0 @@ -782,7 +782,7 @@ This list contains 1666 plugins. :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) :pypi:`pytest-interface-tester` Pytest plugin for checking charm relation interface protocol compliance. Feb 13, 2025 4 - Beta pytest - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Jul 01, 2025 5 - Production/Stable pytest<9.0.0,>=6 + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Jul 09, 2025 5 - Production/Stable pytest<9.0.0,>=6 :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-iovis` A Pytest plugin to enable Jupyter Notebook testing with Papermill Nov 06, 2024 4 - Beta pytest>=7.1.0 :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A @@ -816,10 +816,11 @@ This list contains 1666 plugins. :pypi:`pytest-json-report-wip` A pytest plugin to report test results as JSON files Oct 28, 2023 4 - Beta pytest >=3.8.0 :pypi:`pytest-jsonschema` A pytest plugin to perform JSONSchema validations Apr 20, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-jtr` pytest plugin supporting json test report output Jul 21, 2024 N/A pytest<8.0.0,>=7.1.2 - :pypi:`pytest-jubilant` Add your description here Jun 19, 2025 N/A pytest>=8.3.5 + :pypi:`pytest-jubilant` Add your description here Jul 07, 2025 N/A pytest>=8.3.5 :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Apr 04, 2024 4 - Beta pytest>=7.0 :pypi:`pytest-jupyterhub` A reusable JupyterHub pytest plugin Apr 25, 2023 5 - Production/Stable pytest + :pypi:`pytest-k8s` Kubernetes-based testing for pytest Jul 07, 2025 N/A pytest>=8.4.1 :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 14, 2024 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kairos` Pytest plugin with random number generation, reproducibility, and test repetition Aug 08, 2024 5 - Production/Stable pytest>=5.0.0 @@ -835,7 +836,7 @@ This list contains 1666 plugins. :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :pypi:`pytest-kubernetes` Feb 04, 2025 N/A pytest<9.0.0,>=8.3.0 - :pypi:`pytest_kustomize` Parse and validate kustomize output Jul 03, 2025 N/A N/A + :pypi:`pytest_kustomize` Parse and validate kustomize output Jul 09, 2025 N/A N/A :pypi:`pytest-kuunda` pytest plugin to help with test data setup for PySpark tests Feb 25, 2024 4 - Beta pytest >=6.2.0 :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 27, 2024 5 - Production/Stable pytest<9,>=3.6 @@ -846,7 +847,7 @@ This list contains 1666 plugins. :pypi:`pytest-launchable` Launchable Pytest Plugin Apr 05, 2023 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) - :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. May 27, 2025 N/A pytest>=7 + :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. Jul 12, 2025 N/A pytest>=7 :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest :pypi:`pytest-leak-finder` Find the test that's leaking before the one that fails Feb 15, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A @@ -913,6 +914,7 @@ This list contains 1666 plugins. :pypi:`pytest-maybe-context` Simplify tests with warning and exception cases. Apr 16, 2023 N/A pytest (>=7,<8) :pypi:`pytest-maybe-raises` Pytest fixture for optional exception testing. May 27, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.4.0) + :pypi:`pytest-mcp` Pytest-style framework for evaluating Model Context Protocol (MCP) servers. Jul 07, 2025 N/A pytest>=8.4.0 :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) :pypi:`pytest-md-report` A pytest plugin to generate test outcomes reports with markdown table format. May 02, 2025 4 - Beta pytest!=6.0.0,<9,>=3.3.2 :pypi:`pytest-meilisearch` Pytest helpers for testing projects using Meilisearch Oct 08, 2024 N/A pytest>=7.4.3 @@ -921,13 +923,15 @@ This list contains 1666 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Jul 25, 2024 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Jun 12, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Jul 08, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Feb 12, 2024 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-metaexport` Pytest plugin for exporting custom test metadata to JSON. Jun 24, 2025 N/A pytest>=7.1.0 :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest + :pypi:`pytest-mfd-config` Pytest Plugin that handles test and topology configs and all their belongings like helper fixtures. Jul 11, 2025 N/A pytest<9,>=7.2.1 + :pypi:`pytest-mfd-logging` Module for handling PyTest logging. Jul 09, 2025 N/A pytest<9,>=7.2.1 :pypi:`pytest-mh` Pytest multihost plugin Jun 05, 2025 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-mimic` Easily record function calls while testing Apr 24, 2025 4 - Beta pytest>=6.2.0 @@ -952,6 +956,7 @@ This list contains 1666 plugins. :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest :pypi:`pytest-modalt` Massively distributed pytest runs using modal.com Feb 27, 2024 4 - Beta pytest >=6.2.0 + :pypi:`pytest-modern` A more modern pytest Jul 10, 2025 2 - Pre-Alpha pytest>=8 :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) @@ -1184,7 +1189,7 @@ This list contains 1666 plugins. :pypi:`pytest-python-test-engineer-sort` Sort plugin for Pytest May 13, 2024 N/A pytest>=6.2.0 :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-pyvenv` A package for create venv in tests Feb 27, 2024 N/A pytest ; extra == 'test' - :pypi:`pytest-pyvista` Pytest-pyvista package Sep 29, 2023 4 - Beta pytest>=3.5.0 + :pypi:`pytest-pyvista` Pytest-pyvista package. Jul 07, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-qanova` A pytest plugin to collect test information Sep 05, 2024 3 - Alpha pytest :pypi:`pytest-qaseio` Pytest plugin for Qase.io integration Mar 18, 2025 5 - Production/Stable pytest<9.0.0,>=7.2.2 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) @@ -1243,14 +1248,14 @@ This list contains 1666 plugins. :pypi:`pytest-reporter` Generate Pytest reports with templates Feb 28, 2024 4 - Beta pytest :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest May 06, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A - :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jun 29, 2025 N/A N/A - :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Jun 12, 2025 N/A pytest>=8.0.0 + :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jul 12, 2025 N/A N/A + :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Jul 08, 2025 N/A pytest>=8.4.0 :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility May 22, 2023 3 - Alpha pytest :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 12, 2025 N/A pytest>=4.6.10 + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jul 08, 2025 N/A pytest>=4.6.10 :pypi:`pytest-report-stream` A pytest plugin which allows to stream test reports at runtime Oct 22, 2023 4 - Beta N/A :pypi:`pytest-repo-structure` Pytest Repo Structure Mar 18, 2024 1 - Planning N/A :pypi:`pytest-req` pytest requests plugin Aug 31, 2024 5 - Production/Stable pytest<9.0.0,>=8.3.2 @@ -1317,7 +1322,7 @@ This list contains 1666 plugins. :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Oct 22, 2024 5 - Production/Stable pytest>=7.4.0 + :pypi:`pytest-salt-factories` Pytest Salt Plugin Jul 08, 2025 5 - Production/Stable pytest>=7.4.0 :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sample-argvalues` A utility function to help choose a random sample from your argvalues in pytest. May 07, 2024 N/A pytest @@ -1326,7 +1331,7 @@ This list contains 1666 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 04, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 11, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1338,7 +1343,7 @@ This list contains 1666 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 04, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 11, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1713,7 +1718,7 @@ This list contains 1666 plugins. Python Testing for Databricks :pypi:`logassert` - *last release*: May 15, 2025, + *last release*: Jul 12, 2025, *status*: 5 - Production/Stable, *requires*: pytest; extra == "dev" @@ -2028,7 +2033,7 @@ This list contains 1666 plugins. Pytest plugin to allow use of Annotated in tests to resolve fixtures :pypi:`pytest-ansible` - *last release*: Jul 01, 2025, + *last release*: Jul 07, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6 @@ -2637,7 +2642,7 @@ This list contains 1666 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Jul 03, 2025, + *last release*: Jul 11, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -3323,7 +3328,7 @@ This list contains 1666 plugins. A cleanup plugin for pytest :pypi:`pytest-clerk` - *last release*: Jan 30, 2025, + *last release*: Jul 10, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.0.0 @@ -3470,7 +3475,7 @@ This list contains 1666 plugins. pytest plugin to run pycodestyle :pypi:`pytest-codspeed` - *last release*: Jun 10, 2025, + *last release*: Jul 10, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=3.8 @@ -4324,7 +4329,7 @@ This list contains 1666 plugins. A Django plugin for pytest. :pypi:`pytest-djangoapp` - *last release*: Jun 06, 2025, + *last release*: Jul 12, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -6074,7 +6079,7 @@ This list contains 1666 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Jun 13, 2025, + *last release*: Jul 09, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6655,7 +6660,7 @@ This list contains 1666 plugins. help hypo module for pytest :pypi:`pytest-iam` - *last release*: Jun 25, 2025, + *last release*: Jul 09, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -6725,7 +6730,7 @@ This list contains 1666 plugins. A pytest plugin for image snapshot management and comparison. :pypi:`pytest-impacted` - *last release*: Jun 07, 2025, + *last release*: Jul 12, 2025, *status*: 4 - Beta, *requires*: pytest>=8.0.0 @@ -6942,7 +6947,7 @@ This list contains 1666 plugins. Pytest plugin for checking charm relation interface protocol compliance. :pypi:`pytest-invenio` - *last release*: Jul 01, 2025, + *last release*: Jul 09, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9.0.0,>=6 @@ -7180,7 +7185,7 @@ This list contains 1666 plugins. pytest plugin supporting json test report output :pypi:`pytest-jubilant` - *last release*: Jun 19, 2025, + *last release*: Jul 07, 2025, *status*: N/A, *requires*: pytest>=8.3.5 @@ -7207,6 +7212,13 @@ This list contains 1666 plugins. A reusable JupyterHub pytest plugin + :pypi:`pytest-k8s` + *last release*: Jul 07, 2025, + *status*: N/A, + *requires*: pytest>=8.4.1 + + Kubernetes-based testing for pytest + :pypi:`pytest-kafka` *last release*: Aug 14, 2024, *status*: N/A, @@ -7313,7 +7325,7 @@ This list contains 1666 plugins. :pypi:`pytest_kustomize` - *last release*: Jul 03, 2025, + *last release*: Jul 09, 2025, *status*: N/A, *requires*: N/A @@ -7390,7 +7402,7 @@ This list contains 1666 plugins. It helps to use fixtures in pytest.mark.parametrize :pypi:`pytest-lazy-fixtures` - *last release*: May 27, 2025, + *last release*: Jul 12, 2025, *status*: N/A, *requires*: pytest>=7 @@ -7858,6 +7870,13 @@ This list contains 1666 plugins. pytest plugin to run the mccabe code complexity checker. + :pypi:`pytest-mcp` + *last release*: Jul 07, 2025, + *status*: N/A, + *requires*: pytest>=8.4.0 + + Pytest-style framework for evaluating Model Context Protocol (MCP) servers. + :pypi:`pytest-md` *last release*: Jul 11, 2019, *status*: 3 - Alpha, @@ -7915,7 +7934,7 @@ This list contains 1666 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Jun 12, 2025, + *last release*: Jul 08, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -7963,6 +7982,20 @@ This list contains 1666 plugins. Custom metrics report for pytest + :pypi:`pytest-mfd-config` + *last release*: Jul 11, 2025, + *status*: N/A, + *requires*: pytest<9,>=7.2.1 + + Pytest Plugin that handles test and topology configs and all their belongings like helper fixtures. + + :pypi:`pytest-mfd-logging` + *last release*: Jul 09, 2025, + *status*: N/A, + *requires*: pytest<9,>=7.2.1 + + Module for handling PyTest logging. + :pypi:`pytest-mh` *last release*: Jun 05, 2025, *status*: N/A, @@ -8131,6 +8164,13 @@ This list contains 1666 plugins. Massively distributed pytest runs using modal.com + :pypi:`pytest-modern` + *last release*: Jul 10, 2025, + *status*: 2 - Pre-Alpha, + *requires*: pytest>=8 + + A more modern pytest + :pypi:`pytest-modified-env` *last release*: Jan 29, 2022, *status*: 4 - Beta, @@ -9756,11 +9796,11 @@ This list contains 1666 plugins. A package for create venv in tests :pypi:`pytest-pyvista` - *last release*: Sep 29, 2023, + *last release*: Jul 07, 2025, *status*: 4 - Beta, *requires*: pytest>=3.5.0 - Pytest-pyvista package + Pytest-pyvista package. :pypi:`pytest-qanova` *last release*: Sep 05, 2024, @@ -10169,16 +10209,16 @@ This list contains 1666 plugins. A basic HTML report for pytest using Jinja2 template engine. :pypi:`pytest-reporter-plus` - *last release*: Jun 29, 2025, + *last release*: Jul 12, 2025, *status*: N/A, *requires*: N/A Lightweight enhanced HTML reporter for Pytest :pypi:`pytest-report-extras` - *last release*: Jun 12, 2025, + *last release*: Jul 08, 2025, *status*: N/A, - *requires*: pytest>=8.0.0 + *requires*: pytest>=8.4.0 Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. @@ -10218,7 +10258,7 @@ This list contains 1666 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Jun 12, 2025, + *last release*: Jul 08, 2025, *status*: N/A, *requires*: pytest>=4.6.10 @@ -10687,7 +10727,7 @@ This list contains 1666 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Oct 22, 2024, + *last release*: Jul 08, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.4.0 @@ -10750,7 +10790,7 @@ This list contains 1666 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Jul 04, 2025, + *last release*: Jul 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10834,7 +10874,7 @@ This list contains 1666 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Jul 04, 2025, + *last release*: Jul 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A From 81b6451dd1ab12c53b216077e58c5a6f16fe17f5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 13:15:22 -0300 Subject: [PATCH 048/270] [pre-commit.ci] pre-commit autoupdate (#13597) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.2 → v0.12.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.2...v0.12.3) - [github.com/RobertCraigie/pyright-python: v1.1.402 → v1.1.403](https://github.com/RobertCraigie/pyright-python/compare/v1.1.402...v1.1.403) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cea670682c4..f6cd3799512 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.2" + rev: "v0.12.3" hooks: - id: ruff args: ["--fix"] @@ -48,7 +48,7 @@ repos: # on <3.11 - exceptiongroup>=1.0.0rc8 - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.402 + rev: v1.1.403 hooks: - id: pyright files: ^(src/|scripts/) From 91b3a262d094f023381921f33042c72f94c906de Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 18 Jul 2025 22:02:42 +0200 Subject: [PATCH 049/270] doc: Update trainings --- doc/en/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index fb5d0482c0d..2b58bebc20f 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,7 @@ .. sidebar:: **Next Open Trainings and Events** - - `pytest - simple, rapid and fun testing with Python `_, at `EuroPython 2025 `_, **July 14th** (3h), Prague, Czech Republic + - `Testen mit pytest `_ (German), via `Letsboot `_ (3 day in-depth training), **October 29th -- 31st**, Zurich (CH) - `Professional Testing with Python `_, via `Python Academy `_ (3 day in-depth training), **March 3th -- 5th 2026**, Leipzig (DE) / Remote Also see :doc:`previous talks and blogposts ` From cfc66062cb298e8b90a2849127e2104cd5070293 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 13:56:37 -0300 Subject: [PATCH 050/270] build(deps): Bump pytest-asyncio in /testing/plugins_integration (#13610) Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 1.0.0 to 1.1.0. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v1.0.0...v1.1.0) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-version: 1.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 9959c66b350..1bc4ffe6dbe 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[trio]==4.9.0 django==5.2.1 -pytest-asyncio==1.0.0 +pytest-asyncio==1.1.0 pytest-bdd==8.1.0 pytest-cov==6.2.1 pytest-django==4.11.1 From 05ad7303972cce2124ae1eb3fdb5535420a5260b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 26 Jul 2025 01:01:45 +0000 Subject: [PATCH 051/270] [automated] Update plugin list (#13608) Co-authored-by: pytest bot Co-authored-by: Sorin Sbarnea --- doc/en/reference/plugin_list.rst | 200 +++++++++++++++---------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 6b0ea057187..f3adccd8131 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -73,6 +73,7 @@ This list contains 1671 plugins. :pypi:`pytest-allure-id2history` Overwrite allure history id with testcase full name and testcase id if testcase has id, exclude parameters. May 14, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-allure-intersection` Oct 27, 2022 N/A pytest (<5) :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest + :pypi:`pytest-allure-step` Enhanced logging integration with Allure reports for pytest Jul 13, 2025 3 - Alpha pytest>=6.0.0 :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-amaranth-sim` Fixture to automate running Amaranth simulations Sep 21, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-analyzer` this plugin allows to analyze tests in pytest project, collect test metadata and sync it with testomat.io TCM system Feb 21, 2024 N/A pytest <8.0.0,>=7.3.1 @@ -91,14 +92,14 @@ This list contains 1671 plugins. :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Jun 25, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Jul 14, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) - :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Jun 28, 2025 5 - Production/Stable pytest + :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Jul 14, 2025 5 - Production/Stable pytest :pypi:`pytest-archon` Rule your architecture like a real developer Dec 18, 2023 5 - Production/Stable pytest >=7.2 :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Jun 12, 2025 4 - Beta pytest>=3.0; extra == "dev" @@ -122,7 +123,7 @@ This list contains 1671 plugins. :pypi:`pytest_async` pytest-async - Run your coroutine in event loop without decorator Feb 26, 2020 N/A N/A :pypi:`pytest-async-benchmark` pytest-async-benchmark: Modern pytest benchmarking for async code. 🚀 May 28, 2025 N/A pytest>=8.3.5 :pypi:`pytest-async-generators` Pytest fixtures for async generators Jul 05, 2023 N/A N/A - :pypi:`pytest-asyncio` Pytest support for asyncio Jun 30, 2025 4 - Beta pytest<9,>=8.2 + :pypi:`pytest-asyncio` Pytest support for asyncio Jul 16, 2025 5 - Production/Stable pytest<9,>=8.2 :pypi:`pytest-asyncio-concurrent` Pytest plugin to execute python async tests concurrently. May 17, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jun 24, 2025 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) @@ -151,7 +152,7 @@ This list contains 1671 plugins. :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) :pypi:`pytest-axe-playwright-snapshot` A pytest plugin that runs Axe-core on Playwright pages and takes snapshots of the results. Jul 25, 2023 N/A pytest :pypi:`pytest-azure` Pytest utilities and mocks for Azure Jan 18, 2023 3 - Alpha pytest - :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jun 20, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jul 16, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Oct 06, 2023 5 - Production/Stable pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bandit-xayon` A bandit plugin for pytest Oct 17, 2022 4 - Beta pytest (>=3.5.0) @@ -167,7 +168,7 @@ This list contains 1671 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jul 11, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jul 17, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -199,6 +200,7 @@ This list contains 1671 plugins. :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-breed-adapter` A simple plugin to connect with breed-server Nov 07, 2018 4 - Beta pytest (>=3.5.0) :pypi:`pytest-briefcase` A pytest plugin for running tests on a Briefcase project. Jun 14, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-brightest` Bright ideas for improving your pytest experience Jul 15, 2025 3 - Alpha pytest>=8.4.1 :pypi:`pytest-broadcaster` Pytest plugin to broadcast pytest output to various destinations Mar 02, 2025 3 - Alpha pytest :pypi:`pytest-browser` A pytest plugin for console based browser test selection just after the collection phase Dec 10, 2016 3 - Alpha N/A :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A @@ -395,7 +397,6 @@ This list contains 1671 plugins. :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) - :pypi:`pytest-dino-fm` Minimal package created automatically Jun 27, 2025 N/A N/A :pypi:`pytest-directives` Control your tests flow Jul 01, 2025 3 - Alpha N/A :pypi:`pytest-dir-equal` pytest-dir-equals is a pytest plugin providing helpers to assert directories equality allowing golden testing Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-dirty` Static import analysis for thrifty testing. Jun 08, 2025 3 - Alpha pytest>=8.2; extra == "dev" @@ -471,12 +472,13 @@ This list contains 1671 plugins. :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 - :pypi:`pytest-dsl` A DSL testing framework based on pytest Jul 03, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl` A DSL testing framework based on pytest Jul 15, 2025 N/A pytest>=7.0.0 :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jul 03, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 29, 2025 5 - Production/Stable pytest>=4.6 + :pypi:`pytest-dynamic-parameterize` A Python package for managing pytest plugins. Jul 14, 2025 N/A pytest :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Apr 04, 2025 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A @@ -540,7 +542,7 @@ This list contains 1671 plugins. :pypi:`pytest-exasol-itde` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-saas` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-slc` Feb 11, 2025 N/A pytest<9,>=7 - :pypi:`pytest-excel` pytest plugin for generating excel reports Jun 18, 2024 5 - Production/Stable pytest>3.6 + :pypi:`pytest-excel` pytest plugin for generating excel reports Jul 17, 2025 5 - Production/Stable pytest :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest :pypi:`pytest-executable` pytest plugin for testing executables Oct 07, 2023 N/A pytest <8,>=5 @@ -564,7 +566,7 @@ This list contains 1671 plugins. :pypi:`pytest_extra` Some helpers for writing tests with pytest. Aug 14, 2014 N/A N/A :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-extra-markers` Additional pytest markers to dynamically enable/disable tests viia CLI flags Mar 05, 2023 4 - Beta pytest - :pypi:`pytest-f3ts` Pytest Plugin for communicating test results and information to a FixturFab Test Runner GUI May 08, 2025 N/A pytest<8.0.0,>=7.2.1 + :pypi:`pytest-f3ts` Pytest Plugin for communicating test results and information to a FixturFab Test Runner GUI Jul 15, 2025 N/A pytest<8.0.0,>=7.2.1 :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) :pypi:`pytest-factoryboy` Factory Boy support for pytest. Jul 01, 2025 6 - Mature pytest>=7.0 @@ -593,7 +595,7 @@ This list contains 1671 plugins. :pypi:`pytest-file-watcher` Pytest-File-Watcher is a CLI tool that watches for changes in your code and runs pytest on the changed files. Mar 23, 2023 N/A pytest :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Mar 04, 2024 5 - Production/Stable pytest >=4.6 - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Mar 16, 2024 4 - Beta pytest >=4.3.0 + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Jul 16, 2025 5 - Production/Stable pytest>=6.2.4 :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` Feb 28, 2025 N/A N/A :pypi:`pytest-fixturecheck` A pytest plugin to check fixture validity before test execution Jun 02, 2025 3 - Alpha pytest>=6.0.0 @@ -658,7 +660,7 @@ This list contains 1671 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 09, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 16, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -673,7 +675,7 @@ This list contains 1671 plugins. :pypi:`pytest-gitlab-code-quality` Collects warnings while testing and generates a GitLab Code Quality Report. Sep 09, 2024 N/A pytest>=8.1.1 :pypi:`pytest-gitlab-fold` Folds output sections in GitLab CI build log Dec 31, 2023 4 - Beta pytest >=2.6.0 :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Apr 30, 2024 4 - Beta pytest<=8.2.0 + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 15, 2025 4 - Beta pytest<=8.2.1 :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-goldie` A plugin to support golden tests with pytest. May 23, 2023 4 - Beta pytest (>=3.5.0) @@ -689,8 +691,6 @@ This list contains 1671 plugins. :pypi:`pytest-grpc-aio` pytest plugin for grpc.aio Jul 02, 2025 N/A pytest>=3.6.0 :pypi:`pytest-grunnur` Py.Test plugin for Grunnur-based packages. Jul 26, 2024 N/A pytest>=6 :pypi:`pytest_gui_status` Show pytest status in gui Jan 23, 2016 N/A pytest - :pypi:`pytest-hammer-artifacts` Minimal package created automatically Jun 27, 2025 N/A N/A - :pypi:`pytest-hammer-cluster` Minimal package created automatically Jun 30, 2025 N/A N/A :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-hardware-test-report` A simple plugin to use with pytest Apr 01, 2024 4 - Beta pytest<9.0.0,>=8.0.0 :pypi:`pytest-harmony` Chain tests and data with pytest Jan 17, 2023 N/A pytest (>=7.2.1,<8.0.0) @@ -708,7 +708,7 @@ This list contains 1671 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 05, 2025 3 - Alpha pytest==8.4.0 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 15, 2025 3 - Alpha pytest==8.4.0 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -723,6 +723,7 @@ This list contains 1671 plugins. :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Jun 05, 2025 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 17, 2024 5 - Production/Stable N/A + :pypi:`pytest-html-plus` Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config. Jul 17, 2025 N/A N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-report` Enhanced HTML reporting for pytest with categories, specifications, and detailed logging Jun 24, 2025 4 - Beta pytest>=6.0 :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A @@ -750,7 +751,7 @@ This list contains 1671 plugins. :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 20, 2024 5 - Production/Stable pytest>=6.0 :pypi:`pytest-ignore-test-results` A pytest plugin to ignore test results. Feb 03, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-image-diff` Dec 31, 2024 3 - Alpha pytest - :pypi:`pytest-image-snapshot` A pytest plugin for image snapshot management and comparison. Jul 01, 2024 4 - Beta pytest>=3.5.0 + :pypi:`pytest-image-snapshot` A pytest plugin for image snapshot management and comparison. Jul 16, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. Jul 12, 2025 4 - Beta pytest>=8.0.0 :pypi:`pytest-import-check` pytest plugin to check whether Python modules can be imported Jul 19, 2024 3 - Alpha pytest>=8.1 :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A @@ -788,7 +789,7 @@ This list contains 1671 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest - :pypi:`pytest-ipywidgets` Jul 04, 2025 N/A pytest + :pypi:`pytest-ipywidgets` Jul 15, 2025 N/A pytest :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Jun 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 :pypi:`pytest-isort` py.test plugin to check import ordering using isort Mar 05, 2024 5 - Production/Stable pytest (>=5.0) @@ -847,7 +848,7 @@ This list contains 1671 plugins. :pypi:`pytest-launchable` Launchable Pytest Plugin Apr 05, 2023 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) - :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. Jul 12, 2025 N/A pytest>=7 + :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. Jul 17, 2025 N/A pytest>=7 :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest :pypi:`pytest-leak-finder` Find the test that's leaking before the one that fails Feb 15, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A @@ -923,7 +924,7 @@ This list contains 1671 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Jul 25, 2024 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Jul 08, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Jul 18, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -945,7 +946,6 @@ This list contains 1671 plugins. :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest May 26, 2025 5 - Production/Stable pytest>=6.2.5 - :pypi:`pytest-mock-2.0.0` Minimal package created automatically Jun 30, 2025 N/A N/A :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest @@ -956,7 +956,7 @@ This list contains 1671 plugins. :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest :pypi:`pytest-modalt` Massively distributed pytest runs using modal.com Feb 27, 2024 4 - Beta pytest >=6.2.0 - :pypi:`pytest-modern` A more modern pytest Jul 10, 2025 2 - Pre-Alpha pytest>=8 + :pypi:`pytest-modern` A more modern pytest Jul 18, 2025 4 - Beta pytest>=8 :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) @@ -964,7 +964,7 @@ This list contains 1671 plugins. :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Feb 28, 2025 5 - Production/Stable pytest>=6.2 :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures May 16, 2023 5 - Production/Stable N/A :pypi:`pytest-mongodb-nono` pytest plugin for MongoDB Jan 07, 2025 N/A N/A - :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jul 03, 2025 N/A N/A + :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jul 16, 2025 N/A N/A :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Jun 25, 2023 5 - Production/Stable pytest :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A @@ -1191,7 +1191,7 @@ This list contains 1671 plugins. :pypi:`pytest-pyvenv` A package for create venv in tests Feb 27, 2024 N/A pytest ; extra == 'test' :pypi:`pytest-pyvista` Pytest-pyvista package. Jul 07, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-qanova` A pytest plugin to collect test information Sep 05, 2024 3 - Alpha pytest - :pypi:`pytest-qaseio` Pytest plugin for Qase.io integration Mar 18, 2025 5 - Production/Stable pytest<9.0.0,>=7.2.2 + :pypi:`pytest-qaseio` Pytest plugin for Qase.io integration Jul 18, 2025 5 - Production/Stable pytest<9.0.0,>=7.2.2 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Feb 14, 2023 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 14, 2024 5 - Production/Stable pytest>=6.0 @@ -1248,7 +1248,7 @@ This list contains 1671 plugins. :pypi:`pytest-reporter` Generate Pytest reports with templates Feb 28, 2024 4 - Beta pytest :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest May 06, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A - :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jul 12, 2025 N/A N/A + :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jul 16, 2025 N/A N/A :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Jul 08, 2025 N/A pytest>=8.4.0 :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) @@ -1331,7 +1331,7 @@ This list contains 1671 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 15, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1343,7 +1343,7 @@ This list contains 1671 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 15, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1353,9 +1353,9 @@ This list contains 1671 plugins. :pypi:`pytest-server` test server exec cmd Sep 09, 2024 N/A N/A :pypi:`pytest-server-fixtures` Extensible server fixtures for py.test Nov 29, 2024 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Mar 12, 2025 3 - Alpha pytest>=6.2 + :pypi:`pytest-servers` pytest servers Jul 17, 2025 3 - Alpha pytest>=6.2 :pypi:`pytest-service` Aug 06, 2024 5 - Production/Stable pytest>=6.0.0 - :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A + :pypi:`pytest-services` Services plugin for pytest testing framework Jul 16, 2025 6 - Mature pytest :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A @@ -1460,6 +1460,7 @@ This list contains 1671 plugins. :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) :pypi:`pytest-subinterpreter` Run pytest in a subinterpreter Nov 25, 2023 N/A pytest>=7.0.0 + :pypi:`pytest-subket` Pytest Plugin to disable socket calls during tests Jul 17, 2025 4 - Beta N/A :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 04, 2025 5 - Production/Stable pytest>=4.0.0 :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jun 13, 2025 4 - Beta pytest>=7.4 @@ -1604,7 +1605,7 @@ This list contains 1671 plugins. :pypi:`pytest-unique` Pytest fixture to generate unique values. Jun 10, 2025 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unittest-id-runner` A pytest plugin to run tests using unittest-style test IDs Feb 09, 2025 N/A pytest>=6.0.0 - :pypi:`pytest-unmagic` Pytest fixtures with conventional import semantics Oct 22, 2024 5 - Production/Stable pytest + :pypi:`pytest-unmagic` Pytest fixtures with conventional import semantics Jul 14, 2025 5 - Production/Stable pytest :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A :pypi:`pytest-unordered` Test equality of unordered collections in pytest Jun 03, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Sep 27, 2022 4 - Beta N/A @@ -1680,7 +1681,7 @@ This list contains 1671 plugins. :pypi:`pytest-xvfb` A pytest plugin to run Xvfb (or Xephyr/Xvnc) for tests. Mar 12, 2025 4 - Beta pytest>=2.8.1 :pypi:`pytest-xvirt` A pytest plugin to virtualize test. For example to transparently running them on a remote box. Dec 15, 2024 4 - Beta pytest>=7.2.2 :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest - :pypi:`pytest-yaml-fei` a pytest yaml allure package Feb 09, 2025 N/A pytest + :pypi:`pytest-yaml-fei` a pytest yaml allure package Jul 19, 2025 N/A pytest :pypi:`pytest-yaml-sanmu` Pytest plugin for generating test cases with YAML. In test cases, you can use markers, fixtures, variables, and even call Python functions. Jan 03, 2025 N/A pytest>=8.2.2 :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A @@ -1690,7 +1691,6 @@ This list contains 1671 plugins. :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Apr 09, 2025 N/A pytest<9.0.0,>=8.3.3 :pypi:`pytest-youqu-playwright` pytest-youqu-playwright Jun 12, 2024 N/A pytest - :pypi:`pytest-yt-local` Minimal package created automatically Jun 30, 2025 N/A N/A :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0 :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A @@ -1983,6 +1983,13 @@ This list contains 1671 plugins. The pytest plugin aimed to display test coverage of the specs(requirements) in Allure + :pypi:`pytest-allure-step` + *last release*: Jul 13, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=6.0.0 + + Enhanced logging integration with Allure reports for pytest + :pypi:`pytest-alphamoon` *last release*: Dec 30, 2021, *status*: 5 - Production/Stable, @@ -2110,7 +2117,7 @@ This list contains 1671 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Jun 25, 2025, + *last release*: Jul 14, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2159,7 +2166,7 @@ This list contains 1671 plugins. A plugin to use approvaltests with pytest :pypi:`pytest-approvaltests-geo` - *last release*: Jun 28, 2025, + *last release*: Jul 14, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -2327,8 +2334,8 @@ This list contains 1671 plugins. Pytest fixtures for async generators :pypi:`pytest-asyncio` - *last release*: Jun 30, 2025, - *status*: 4 - Beta, + *last release*: Jul 16, 2025, + *status*: 5 - Production/Stable, *requires*: pytest<9,>=8.2 Pytest support for asyncio @@ -2530,9 +2537,9 @@ This list contains 1671 plugins. Pytest utilities and mocks for Azure :pypi:`pytest-azure-devops` - *last release*: Jun 20, 2022, + *last release*: Jul 16, 2025, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest>=3.5.0 Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. @@ -2642,7 +2649,7 @@ This list contains 1671 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Jul 11, 2025, + *last release*: Jul 17, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -2865,6 +2872,13 @@ This list contains 1671 plugins. A pytest plugin for running tests on a Briefcase project. + :pypi:`pytest-brightest` + *last release*: Jul 15, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=8.4.1 + + Bright ideas for improving your pytest experience + :pypi:`pytest-broadcaster` *last release*: Mar 02, 2025, *status*: 3 - Alpha, @@ -4237,13 +4251,6 @@ This list contains 1671 plugins. PyTest plugin for generating Difido reports - :pypi:`pytest-dino-fm` - *last release*: Jun 27, 2025, - *status*: N/A, - *requires*: N/A - - Minimal package created automatically - :pypi:`pytest-directives` *last release*: Jul 01, 2025, *status*: 3 - Alpha, @@ -4770,7 +4777,7 @@ This list contains 1671 plugins. A Pytest plugin to ignore tests during collection without reporting them in the test summary. :pypi:`pytest-dsl` - *last release*: Jul 03, 2025, + *last release*: Jul 15, 2025, *status*: N/A, *requires*: pytest>=7.0.0 @@ -4811,6 +4818,13 @@ This list contains 1671 plugins. Pytest plugin reporting fixtures and test functions execution time. + :pypi:`pytest-dynamic-parameterize` + *last release*: Jul 14, 2025, + *status*: N/A, + *requires*: pytest + + A Python package for managing pytest plugins. + :pypi:`pytest-dynamicrerun` *last release*: Aug 15, 2020, *status*: 4 - Beta, @@ -5253,9 +5267,9 @@ This list contains 1671 plugins. :pypi:`pytest-excel` - *last release*: Jun 18, 2024, + *last release*: Jul 17, 2025, *status*: 5 - Production/Stable, - *requires*: pytest>3.6 + *requires*: pytest pytest plugin for generating excel reports @@ -5421,7 +5435,7 @@ This list contains 1671 plugins. Additional pytest markers to dynamically enable/disable tests viia CLI flags :pypi:`pytest-f3ts` - *last release*: May 08, 2025, + *last release*: Jul 15, 2025, *status*: N/A, *requires*: pytest<8.0.0,>=7.2.1 @@ -5624,9 +5638,9 @@ This list contains 1671 plugins. Pytest plugin for filtering based on sub-packages :pypi:`pytest-find-dependencies` - *last release*: Mar 16, 2024, - *status*: 4 - Beta, - *requires*: pytest >=4.3.0 + *last release*: Jul 16, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=6.2.4 A pytest plugin to find dependencies between tests @@ -6079,7 +6093,7 @@ This list contains 1671 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Jul 09, 2025, + *last release*: Jul 16, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6184,9 +6198,9 @@ This list contains 1671 plugins. Utility to select tests that have had its dependencies modified (as identified by git diff) :pypi:`pytest-glamor-allure` - *last release*: Apr 30, 2024, + *last release*: Jul 15, 2025, *status*: 4 - Beta, - *requires*: pytest<=8.2.0 + *requires*: pytest<=8.2.1 Extends allure-pytest functionality @@ -6295,20 +6309,6 @@ This list contains 1671 plugins. Show pytest status in gui - :pypi:`pytest-hammer-artifacts` - *last release*: Jun 27, 2025, - *status*: N/A, - *requires*: N/A - - Minimal package created automatically - - :pypi:`pytest-hammer-cluster` - *last release*: Jun 30, 2025, - *status*: N/A, - *requires*: N/A - - Minimal package created automatically - :pypi:`pytest-hammertime` *last release*: Jul 28, 2018, *status*: N/A, @@ -6429,7 +6429,7 @@ This list contains 1671 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 05, 2025, + *last release*: Jul 15, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.0 @@ -6533,6 +6533,13 @@ This list contains 1671 plugins. Pytest report plugin for send HTML report on object-storage + :pypi:`pytest-html-plus` + *last release*: Jul 17, 2025, + *status*: N/A, + *requires*: N/A + + Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config. + :pypi:`pytest-html-profiling` *last release*: Feb 11, 2020, *status*: 5 - Production/Stable, @@ -6723,7 +6730,7 @@ This list contains 1671 plugins. :pypi:`pytest-image-snapshot` - *last release*: Jul 01, 2024, + *last release*: Jul 16, 2025, *status*: 4 - Beta, *requires*: pytest>=3.5.0 @@ -6989,7 +6996,7 @@ This list contains 1671 plugins. Pytest plugin to run tests in Jupyter Notebooks :pypi:`pytest-ipywidgets` - *last release*: Jul 04, 2025, + *last release*: Jul 15, 2025, *status*: N/A, *requires*: pytest @@ -7402,7 +7409,7 @@ This list contains 1671 plugins. It helps to use fixtures in pytest.mark.parametrize :pypi:`pytest-lazy-fixtures` - *last release*: Jul 12, 2025, + *last release*: Jul 17, 2025, *status*: N/A, *requires*: pytest>=7 @@ -7934,7 +7941,7 @@ This list contains 1671 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Jul 08, 2025, + *last release*: Jul 18, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8087,13 +8094,6 @@ This list contains 1671 plugins. Thin-wrapper around the mock package for easier use with pytest - :pypi:`pytest-mock-2.0.0` - *last release*: Jun 30, 2025, - *status*: N/A, - *requires*: N/A - - Minimal package created automatically - :pypi:`pytest-mock-api` *last release*: Feb 13, 2019, *status*: 1 - Planning, @@ -8165,8 +8165,8 @@ This list contains 1671 plugins. Massively distributed pytest runs using modal.com :pypi:`pytest-modern` - *last release*: Jul 10, 2025, - *status*: 2 - Pre-Alpha, + *last release*: Jul 18, 2025, + *status*: 4 - Beta, *requires*: pytest>=8 A more modern pytest @@ -8221,7 +8221,7 @@ This list contains 1671 plugins. pytest plugin for MongoDB :pypi:`pytest-mongodb-ry` - *last release*: Jul 03, 2025, + *last release*: Jul 16, 2025, *status*: N/A, *requires*: N/A @@ -9810,7 +9810,7 @@ This list contains 1671 plugins. A pytest plugin to collect test information :pypi:`pytest-qaseio` - *last release*: Mar 18, 2025, + *last release*: Jul 18, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9.0.0,>=7.2.2 @@ -10209,7 +10209,7 @@ This list contains 1671 plugins. A basic HTML report for pytest using Jinja2 template engine. :pypi:`pytest-reporter-plus` - *last release*: Jul 12, 2025, + *last release*: Jul 16, 2025, *status*: N/A, *requires*: N/A @@ -10790,7 +10790,7 @@ This list contains 1671 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Jul 11, 2025, + *last release*: Jul 15, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10874,7 +10874,7 @@ This list contains 1671 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Jul 11, 2025, + *last release*: Jul 15, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10944,7 +10944,7 @@ This list contains 1671 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Mar 12, 2025, + *last release*: Jul 17, 2025, *status*: 3 - Alpha, *requires*: pytest>=6.2 @@ -10958,9 +10958,9 @@ This list contains 1671 plugins. :pypi:`pytest-services` - *last release*: Oct 30, 2020, + *last release*: Jul 16, 2025, *status*: 6 - Mature, - *requires*: N/A + *requires*: pytest Services plugin for pytest testing framework @@ -11692,6 +11692,13 @@ This list contains 1671 plugins. Run pytest in a subinterpreter + :pypi:`pytest-subket` + *last release*: Jul 17, 2025, + *status*: 4 - Beta, + *requires*: N/A + + Pytest Plugin to disable socket calls during tests + :pypi:`pytest-subprocess` *last release*: Jan 04, 2025, *status*: 5 - Production/Stable, @@ -12701,7 +12708,7 @@ This list contains 1671 plugins. A pytest plugin to run tests using unittest-style test IDs :pypi:`pytest-unmagic` - *last release*: Oct 22, 2024, + *last release*: Jul 14, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -13233,7 +13240,7 @@ This list contains 1671 plugins. This plugin is used to load yaml output to your test using pytest framework. :pypi:`pytest-yaml-fei` - *last release*: Feb 09, 2025, + *last release*: Jul 19, 2025, *status*: N/A, *requires*: pytest @@ -13302,13 +13309,6 @@ This list contains 1671 plugins. pytest-youqu-playwright - :pypi:`pytest-yt-local` - *last release*: Jun 30, 2025, - *status*: N/A, - *requires*: N/A - - Minimal package created automatically - :pypi:`pytest-yuk` *last release*: Mar 26, 2021, *status*: N/A, From 748dae571d1c21c9aeb9f5199904a818d5e3a185 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 26 Jul 2025 01:29:19 +0000 Subject: [PATCH 052/270] [pre-commit.ci] pre-commit autoupdate (#13611) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.3 → v0.12.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.3...v0.12.4) - [github.com/pre-commit/mirrors-mypy: v1.16.1 → v1.17.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.16.1...v1.17.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6cd3799512..a63c4ec9cb1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.3" + rev: "v0.12.4" hooks: - id: ruff args: ["--fix"] @@ -32,7 +32,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.16.1 + rev: v1.17.0 hooks: - id: mypy files: ^(src/|testing/|scripts/) From 67738403d7e14e0284f6c9f737e68de823760c33 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 25 Jul 2025 22:33:09 -0300 Subject: [PATCH 053/270] Apply PEP 639 (#13014) * Apply PEP 639 * Update setuptools minimum to version supporting PEP 639 Prompted by this post https://bsky.app/profile/hynek.me/post/3lc5n7g6kr22f Ref: https://github.com/python-attrs/attrs/pull/1377 --------- Co-authored-by: Ran Benita --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 033567bcb50..c106dcc5901 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] build-backend = "setuptools.build_meta" requires = [ - "setuptools>=61", + "setuptools>=77", "setuptools-scm[toml]>=6.2.3", ] @@ -13,7 +13,8 @@ keywords = [ "test", "unittest", ] -license = { text = "MIT" } +license = "MIT" +license-files = [ "LICENSE" ] authors = [ { name = "Holger Krekel" }, { name = "Bruno Oliveira" }, @@ -27,7 +28,6 @@ requires-python = ">=3.9" classifiers = [ "Development Status :: 6 - Mature", "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", From 3b002340cdb626f7f8ff1b377855d5b107e72164 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 07:45:18 +0200 Subject: [PATCH 054/270] build(deps): Bump re-actors/alls-green (#13622) Bumps [re-actors/alls-green](https://github.com/re-actors/alls-green) from 223e4bb7a751b91f43eda76992bcfbf23b8b0302 to 2765efec08f0fd63e83ad900f5fd75646be69ff6. - [Release notes](https://github.com/re-actors/alls-green/releases) - [Commits](https://github.com/re-actors/alls-green/compare/223e4bb7a751b91f43eda76992bcfbf23b8b0302...2765efec08f0fd63e83ad900f5fd75646be69ff6) --- updated-dependencies: - dependency-name: re-actors/alls-green dependency-version: 2765efec08f0fd63e83ad900f5fd75646be69ff6 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e51b817b805..d9a26f256bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -335,6 +335,6 @@ jobs: steps: - name: Decide whether the needed jobs succeeded or failed - uses: re-actors/alls-green@223e4bb7a751b91f43eda76992bcfbf23b8b0302 + uses: re-actors/alls-green@2765efec08f0fd63e83ad900f5fd75646be69ff6 with: jobs: ${{ toJSON(needs) }} From 836cfbac1f49c069191b5859fbc1c1763e5077ea Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 28 Jul 2025 15:16:41 +0200 Subject: [PATCH 055/270] selftests: Set a timeout for lsof (#13621) In case of hanging filesystems (e.g. unreachable sshfs), `lsof` can hang for a long time (3 minutes in my case). Set a more reasonable timeout and skip the affected test (like already done with other problems regarding lsof) in such a case. --- changelog/13621.contrib.rst | 1 + testing/test_capture.py | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelog/13621.contrib.rst diff --git a/changelog/13621.contrib.rst b/changelog/13621.contrib.rst new file mode 100644 index 00000000000..c5e622b7619 --- /dev/null +++ b/changelog/13621.contrib.rst @@ -0,0 +1 @@ +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/testing/test_capture.py b/testing/test_capture.py index d9dacebd938..0f64e9c73d8 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -983,8 +983,13 @@ def tmpfile(pytester: Pytester) -> Generator[BinaryIO]: def lsof_check(): pid = os.getpid() try: - out = subprocess.check_output(("lsof", "-p", str(pid))).decode() - except (OSError, subprocess.CalledProcessError, UnicodeDecodeError) as exc: + out = subprocess.check_output(("lsof", "-p", str(pid)), timeout=10).decode() + except ( + OSError, + UnicodeDecodeError, + subprocess.CalledProcessError, + subprocess.TimeoutExpired, + ) as exc: # about UnicodeDecodeError, see note on pytester pytest.skip(f"could not run 'lsof' ({exc!r})") yield From cebf662286918966e9414e85e38d470705ac82f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 10:17:03 -0300 Subject: [PATCH 056/270] [automated] Update plugin list (#13620) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 168 ++++++++++++++++++++++--------- 1 file changed, 120 insertions(+), 48 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index f3adccd8131..b3cb17b389f 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =7.0.0 :pypi:`pytest-automock` Pytest plugin for automatical mocks creation May 16, 2023 N/A pytest ; extra == 'dev' :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A + :pypi:`pytest-autoprofile` \`line_profiler.autoprofile\`-ing your \`pytest\` test suite Jul 25, 2025 4 - Beta pytest>=7.0 :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest :pypi:`pytest-aviator` Aviator's Flakybot pytest plugin that automatically reruns flaky tests. Nov 04, 2022 4 - Beta pytest :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) @@ -221,6 +222,7 @@ This list contains 1671 plugins. :pypi:`pytest-call-checker` Small pytest utility to easily create test doubles Oct 16, 2022 4 - Beta pytest (>=7.1.3,<8.0.0) :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) + :pypi:`pytest-canvas` A minimal pytest plugin that streamlines testing for projects using the Canvas SDK. Jul 22, 2025 N/A pytest<9,>=8.4 :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capsqlalchemy` Pytest plugin to allow capturing SQLAlchemy queries. Mar 19, 2025 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A @@ -266,7 +268,7 @@ This list contains 1671 plugins. :pypi:`pytest-clean-database` A pytest plugin that cleans your database up after every test. Mar 14, 2025 3 - Alpha pytest<9,>=7.0 :pypi:`pytest-cleanslate` Collects and executes pytest tests separately Apr 10, 2025 N/A pytest :pypi:`pytest_cleanup` Automated, comprehensive and well-organised pytest test cases. Jan 28, 2020 N/A N/A - :pypi:`pytest-cleanuptotal` A cleanup plugin for pytest Nov 08, 2024 5 - Production/Stable N/A + :pypi:`pytest-cleanuptotal` A cleanup plugin for pytest Jul 22, 2025 5 - Production/Stable N/A :pypi:`pytest-clerk` A set of pytest fixtures to help with integration testing with Clerk. Jul 10, 2025 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-cli2-ansible` Mar 05, 2025 N/A N/A :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) @@ -472,7 +474,8 @@ This list contains 1671 plugins. :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 - :pypi:`pytest-dsl` A DSL testing framework based on pytest Jul 15, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl` A DSL testing framework based on pytest Jul 25, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl-ssh` SSH/SFTP关键字插件,为pytest-dsl提供SSH和SFTP操作能力 Jul 25, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jul 03, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A @@ -537,12 +540,12 @@ This list contains 1671 plugins. :pypi:`pytest_evm` The testing package containing tools to test Web3-based projects Sep 23, 2024 4 - Beta pytest<9.0.0,>=8.1.1 :pypi:`pytest_exact_fixtures` Parse queries in Lucene and Elasticsearch syntaxes Feb 04, 2019 N/A N/A :pypi:`pytest-examples` Pytest plugin for testing examples in docstrings and markdown files. May 06, 2025 N/A pytest>=7 - :pypi:`pytest-exasol-backend` Jul 02, 2025 N/A pytest<9,>=7 + :pypi:`pytest-exasol-backend` Jul 21, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-extension` Jun 13, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-itde` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-saas` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-slc` Feb 11, 2025 N/A pytest<9,>=7 - :pypi:`pytest-excel` pytest plugin for generating excel reports Jul 17, 2025 5 - Production/Stable pytest + :pypi:`pytest-excel` pytest plugin for generating excel reports Jul 22, 2025 5 - Production/Stable pytest :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest :pypi:`pytest-executable` pytest plugin for testing executables Oct 07, 2023 N/A pytest <8,>=5 @@ -600,6 +603,7 @@ This list contains 1671 plugins. :pypi:`pytest-firefox` Feb 28, 2025 N/A N/A :pypi:`pytest-fixturecheck` A pytest plugin to check fixture validity before test execution Jun 02, 2025 3 - Alpha pytest>=6.0.0 :pypi:`pytest-fixture-classes` Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers Sep 02, 2023 5 - Production/Stable pytest + :pypi:`pytest-fixture-collect` A utility to collect pytest fixture file paths. Jul 25, 2025 N/A pytest; extra == "test" :pypi:`pytest-fixturecollection` A pytest plugin to collect tests based on fixtures being used by tests Feb 22, 2024 4 - Beta pytest >=3.5.0 :pypi:`pytest-fixture-config` Fixture configuration utils for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-fixture-forms` A pytest plugin for creating fixtures that holds different forms between tests. Dec 06, 2024 N/A pytest<9.0.0,>=7.0.0 @@ -660,7 +664,7 @@ This list contains 1671 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 16, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 25, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -675,7 +679,7 @@ This list contains 1671 plugins. :pypi:`pytest-gitlab-code-quality` Collects warnings while testing and generates a GitLab Code Quality Report. Sep 09, 2024 N/A pytest>=8.1.1 :pypi:`pytest-gitlab-fold` Folds output sections in GitLab CI build log Dec 31, 2023 4 - Beta pytest >=2.6.0 :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 15, 2025 4 - Beta pytest<=8.2.1 + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 20, 2025 4 - Beta pytest<=8.4.1 :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-goldie` A plugin to support golden tests with pytest. May 23, 2023 4 - Beta pytest (>=3.5.0) @@ -708,7 +712,7 @@ This list contains 1671 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 15, 2025 3 - Alpha pytest==8.4.0 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 23, 2025 3 - Alpha pytest==8.4.0 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -731,7 +735,7 @@ This list contains 1671 plugins. :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A :pypi:`pytest-http` Fixture "http" for http requests Aug 22, 2024 N/A pytest :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Sep 18, 2024 5 - Production/Stable pytest; extra == "test" - :pypi:`pytest-httpdbg` A pytest plugin to record HTTP(S) requests with stack trace. May 08, 2025 4 - Beta pytest>=7.0.0 + :pypi:`pytest-httpdbg` A pytest plugin to record HTTP(S) requests with stack trace. Jul 25, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest_httpserver` pytest-httpserver is a httpserver for pytest Apr 10, 2025 3 - Alpha N/A @@ -742,7 +746,7 @@ This list contains 1671 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jul 09, 2025 4 - Beta pytest>=7.0.0 + :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jul 25, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Feb 06, 2025 4 - Beta pytest>=7.1 :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Dec 05, 2023 4 - Beta pytest :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A @@ -814,10 +818,10 @@ This list contains 1671 plugins. :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Mar 14, 2023 4 - Beta N/A :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) - :pypi:`pytest-json-report-wip` A pytest plugin to report test results as JSON files Oct 28, 2023 4 - Beta pytest >=3.8.0 + :pypi:`pytest-json-report-wip` A pytest plugin to report test results as JSON files Jul 23, 2025 4 - Beta pytest >=3.8.0 :pypi:`pytest-jsonschema` A pytest plugin to perform JSONSchema validations Apr 20, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-jtr` pytest plugin supporting json test report output Jul 21, 2024 N/A pytest<8.0.0,>=7.1.2 - :pypi:`pytest-jubilant` Add your description here Jul 07, 2025 N/A pytest>=8.3.5 + :pypi:`pytest-jubilant` Add your description here Jul 24, 2025 N/A pytest>=8.3.5 :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Apr 04, 2024 4 - Beta pytest>=7.0 :pypi:`pytest-jupyterhub` A reusable JupyterHub pytest plugin Apr 25, 2023 5 - Production/Stable pytest @@ -869,6 +873,7 @@ This list contains 1671 plugins. :pypi:`pytest-litter` Pytest plugin which verifies that tests do not modify file trees. Nov 23, 2023 4 - Beta pytest >=6.1 :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest :pypi:`pytest-llmeval` A pytest plugin to evaluate/benchmark LLM prompts Mar 19, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-lobster` Pytest to generate lobster tracing files Jul 26, 2025 N/A pytest>=7.0 :pypi:`pytest-local-badge` Generate local badges (shields) reporting your test suite status. Jan 15, 2023 N/A pytest (>=6.1.0) :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests May 19, 2024 5 - Production/Stable pytest :pypi:`pytest-localserver` pytest plugin to test server connections locally. Oct 06, 2024 4 - Beta N/A @@ -905,7 +910,7 @@ This list contains 1671 plugins. :pypi:`pytest-mark-no-py3` pytest plugin and bowler codemod to help migrate tests to Python 3 May 17, 2019 N/A pytest :pypi:`pytest-marks` UNKNOWN Nov 23, 2012 3 - Alpha N/A :pypi:`pytest-mask-secrets` Pytest plugin to hide sensitive data in test reports Jan 28, 2025 N/A N/A - :pypi:`pytest-matcher` Easy way to match captured \`pytest\` output against expectations stored in files Aug 01, 2024 5 - Production/Stable pytest + :pypi:`pytest-matcher` Easy way to match captured \`pytest\` output against expectations stored in files Jul 26, 2025 5 - Production/Stable pytest :pypi:`pytest-matchers` Matchers for pytest Feb 11, 2025 N/A pytest<9.0,>=7.0 :pypi:`pytest-match-skip` Skip matching marks. Matches partial marks using wildcards. May 15, 2019 4 - Beta pytest (>=4.4.1) :pypi:`pytest-mat-report` this is report Jan 20, 2021 N/A N/A @@ -924,7 +929,7 @@ This list contains 1671 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Jul 25, 2024 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Jul 18, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Jul 21, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -956,7 +961,7 @@ This list contains 1671 plugins. :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest :pypi:`pytest-modalt` Massively distributed pytest runs using modal.com Feb 27, 2024 4 - Beta pytest >=6.2.0 - :pypi:`pytest-modern` A more modern pytest Jul 18, 2025 4 - Beta pytest>=8 + :pypi:`pytest-modern` A more modern pytest Jul 24, 2025 4 - Beta pytest>=8 :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) @@ -991,6 +996,7 @@ This list contains 1671 plugins. :pypi:`pytest-mypy-runner` Run the mypy static type checker as a pytest test case Apr 23, 2024 N/A pytest>=8.0 :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Mar 04, 2024 N/A pytest>=7,<9 :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Dec 10, 2024 5 - Production/Stable pytest>=6.2 + :pypi:`pytest-nb` Seedable Jupyter Notebook testing tool Jul 26, 2025 N/A pytest==8.4.1 :pypi:`pytest-ndb` pytest notebook debugger Apr 28, 2024 N/A pytest :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) @@ -1042,7 +1048,7 @@ This list contains 1671 plugins. :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Mar 22, 2025 5 - Production/Stable pytest>=5.0 :pypi:`pytest-operator` Fixtures for Charmed Operators Sep 28, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A - :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Apr 15, 2025 4 - Beta pytest; extra == "dev" + :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 21, 2025 4 - Beta pytest; extra == "dev" :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A :pypi:`pytest-order` pytest plugin to run your tests in a specific order Aug 22, 2024 5 - Production/Stable pytest>=5.0; python_version < "3.10" :pypi:`pytest-ordered` Declare the order in which tests should run in your pytest.ini Oct 07, 2024 N/A pytest>=6.2.0 @@ -1084,7 +1090,7 @@ This list contains 1671 plugins. :pypi:`pytest-percents` Mar 16, 2024 N/A N/A :pypi:`pytest-perf` Run performance tests against the mainline code. May 20, 2024 5 - Production/Stable pytest!=8.1.*,>=6; extra == "testing" :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-performancetotal` A performance plugin for pytest Feb 01, 2025 5 - Production/Stable N/A + :pypi:`pytest-performancetotal` A performance plugin for pytest Jul 22, 2025 5 - Production/Stable N/A :pypi:`pytest-persistence` Pytest tool for persistent objects Aug 21, 2024 N/A N/A :pypi:`pytest-pexpect` Pytest pexpect plugin. Aug 13, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker May 18, 2025 5 - Production/Stable pytest>=7.4 @@ -1118,7 +1124,7 @@ This list contains 1671 plugins. :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Jun 28, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Jul 25, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1164,10 +1170,11 @@ This list contains 1671 plugins. :pypi:`pytest-pusher` pytest plugin for push report to minio Jan 06, 2023 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-py125` Dec 03, 2022 N/A N/A :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Oct 10, 2024 3 - Alpha pytest>=7.0 + :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Jul 20, 2025 3 - Alpha pytest>=7.0 :pypi:`pytest-pydantic-schema-sync` Pytest plugin to synchronise Pydantic model schemas with JSONSchema files Aug 29, 2024 N/A pytest>=6 :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Oct 09, 2024 3 - Alpha pytest>=7.0 + :pypi:`pytest-pylembic` This package provides pytest plugin for validating Alembic migrations using the pylembic package. Jul 22, 2025 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Oct 06, 2023 5 - Production/Stable pytest >=7.0 :pypi:`pytest-pylyzer` A pytest plugin for pylyzer Feb 15, 2025 4 - Beta N/A :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A @@ -1191,7 +1198,7 @@ This list contains 1671 plugins. :pypi:`pytest-pyvenv` A package for create venv in tests Feb 27, 2024 N/A pytest ; extra == 'test' :pypi:`pytest-pyvista` Pytest-pyvista package. Jul 07, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-qanova` A pytest plugin to collect test information Sep 05, 2024 3 - Alpha pytest - :pypi:`pytest-qaseio` Pytest plugin for Qase.io integration Jul 18, 2025 5 - Production/Stable pytest<9.0.0,>=7.2.2 + :pypi:`pytest-qaseio` Pytest plugin for Qase.io integration Jul 25, 2025 5 - Production/Stable pytest<9.0.0,>=7.2.2 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Feb 14, 2023 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 14, 2024 5 - Production/Stable pytest>=6.0 @@ -1216,10 +1223,11 @@ This list contains 1671 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Jun 22, 2025 5 - Production/Stable pytest :pypi:`pytest-ranking` A Pytest plugin for faster fault detection via regression test prioritization Apr 08, 2025 4 - Beta pytest>=7.4.3 + :pypi:`pytest-rca-report` Interactive RCA report generator for pytest runs, with AI-based analysis and visual dashboard Jul 24, 2025 N/A N/A :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. Sep 04, 2024 3 - Alpha N/A :pypi:`pytest-recap` Capture your test sessions. Recap the results. Jun 16, 2025 N/A pytest>=6.2.0 - :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Jun 27, 2025 N/A N/A + :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Jul 25, 2025 N/A N/A :pypi:`pytest-recording` A pytest plugin powered by VCR.py to record and replay HTTP traffic May 08, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-record-video` 用例执行过程中录制视频 Oct 31, 2024 N/A N/A @@ -1231,7 +1239,7 @@ This list contains 1671 plugins. :pypi:`pytest-regex` Select pytest tests with regular expressions May 29, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jul 04, 2025 5 - Production/Stable pytest>=6.2.0 - :pypi:`pytest-regtest` pytest plugin for snapshot regression testing Nov 12, 2024 N/A pytest>7.2 + :pypi:`pytest-regtest` pytest plugin for snapshot regression testing Jul 21, 2025 N/A pytest>7.2 :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relative-path` Handle relative path in pytest options or ini configs Aug 30, 2024 N/A pytest :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Mar 29, 2024 5 - Production/Stable pytest>=7 @@ -1314,7 +1322,7 @@ This list contains 1671 plugins. :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Jun 19, 2025 4 - Beta pytest>=5 :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Jun 10, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Jul 21, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 @@ -1547,6 +1555,7 @@ This list contains 1671 plugins. :pypi:`pytest-timer` A timer plugin for pytest Dec 26, 2023 N/A pytest :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Mar 27, 2024 N/A N/A :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Sep 11, 2023 N/A pytest (>=7.3,<8.0) + :pypi:`pytest-timing-plugin` pytest插件开发demo Jul 21, 2025 N/A N/A :pypi:`pytest-tiny-api-client` The companion pytest plugin for tiny-api-client Jan 04, 2024 5 - Production/Stable pytest :pypi:`pytest-tinybird` A pytest plugin to report test results to tinybird May 07, 2025 4 - Beta pytest>=3.8.0 :pypi:`pytest-tipsi-django` Better fixtures for django Feb 05, 2024 5 - Production/Stable pytest>=6.0.0 @@ -1681,7 +1690,7 @@ This list contains 1671 plugins. :pypi:`pytest-xvfb` A pytest plugin to run Xvfb (or Xephyr/Xvnc) for tests. Mar 12, 2025 4 - Beta pytest>=2.8.1 :pypi:`pytest-xvirt` A pytest plugin to virtualize test. For example to transparently running them on a remote box. Dec 15, 2024 4 - Beta pytest>=7.2.2 :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest - :pypi:`pytest-yaml-fei` a pytest yaml allure package Jul 19, 2025 N/A pytest + :pypi:`pytest-yaml-fei` a pytest yaml allure package Jul 23, 2025 N/A pytest :pypi:`pytest-yaml-sanmu` Pytest plugin for generating test cases with YAML. In test cases, you can use markers, fixtures, variables, and even call Python functions. Jan 03, 2025 N/A pytest>=8.2.2 :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A @@ -2459,6 +2468,13 @@ This list contains 1671 plugins. pytest plugin: avoid repeating arguments in parametrize + :pypi:`pytest-autoprofile` + *last release*: Jul 25, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0 + + \`line_profiler.autoprofile\`-ing your \`pytest\` test suite + :pypi:`pytest-autotest` *last release*: Aug 25, 2021, *status*: N/A, @@ -3019,6 +3035,13 @@ This list contains 1671 plugins. A plugin which allows to compare results with canonical results, based on previous runs + :pypi:`pytest-canvas` + *last release*: Jul 22, 2025, + *status*: N/A, + *requires*: pytest<9,>=8.4 + + A minimal pytest plugin that streamlines testing for projects using the Canvas SDK. + :pypi:`pytest-caprng` *last release*: May 02, 2018, *status*: 4 - Beta, @@ -3335,7 +3358,7 @@ This list contains 1671 plugins. Automated, comprehensive and well-organised pytest test cases. :pypi:`pytest-cleanuptotal` - *last release*: Nov 08, 2024, + *last release*: Jul 22, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -4777,12 +4800,19 @@ This list contains 1671 plugins. A Pytest plugin to ignore tests during collection without reporting them in the test summary. :pypi:`pytest-dsl` - *last release*: Jul 15, 2025, + *last release*: Jul 25, 2025, *status*: N/A, *requires*: pytest>=7.0.0 A DSL testing framework based on pytest + :pypi:`pytest-dsl-ssh` + *last release*: Jul 25, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0.0 + + SSH/SFTP关键字插件,为pytest-dsl提供SSH和SFTP操作能力 + :pypi:`pytest-dsl-ui` *last release*: Jul 03, 2025, *status*: N/A, @@ -5232,7 +5262,7 @@ This list contains 1671 plugins. Pytest plugin for testing examples in docstrings and markdown files. :pypi:`pytest-exasol-backend` - *last release*: Jul 02, 2025, + *last release*: Jul 21, 2025, *status*: N/A, *requires*: pytest<9,>=7 @@ -5267,7 +5297,7 @@ This list contains 1671 plugins. :pypi:`pytest-excel` - *last release*: Jul 17, 2025, + *last release*: Jul 22, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -5672,6 +5702,13 @@ This list contains 1671 plugins. Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers + :pypi:`pytest-fixture-collect` + *last release*: Jul 25, 2025, + *status*: N/A, + *requires*: pytest; extra == "test" + + A utility to collect pytest fixture file paths. + :pypi:`pytest-fixturecollection` *last release*: Feb 22, 2024, *status*: 4 - Beta, @@ -6093,7 +6130,7 @@ This list contains 1671 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Jul 16, 2025, + *last release*: Jul 25, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6198,9 +6235,9 @@ This list contains 1671 plugins. Utility to select tests that have had its dependencies modified (as identified by git diff) :pypi:`pytest-glamor-allure` - *last release*: Jul 15, 2025, + *last release*: Jul 20, 2025, *status*: 4 - Beta, - *requires*: pytest<=8.2.1 + *requires*: pytest<=8.4.1 Extends allure-pytest functionality @@ -6429,7 +6466,7 @@ This list contains 1671 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 15, 2025, + *last release*: Jul 23, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.0 @@ -6590,7 +6627,7 @@ This list contains 1671 plugins. Easily test your HTTP library against a local copy of httpbin :pypi:`pytest-httpdbg` - *last release*: May 08, 2025, + *last release*: Jul 25, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -6667,7 +6704,7 @@ This list contains 1671 plugins. help hypo module for pytest :pypi:`pytest-iam` - *last release*: Jul 09, 2025, + *last release*: Jul 25, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -7171,7 +7208,7 @@ This list contains 1671 plugins. A pytest plugin to report test results as JSON files :pypi:`pytest-json-report-wip` - *last release*: Oct 28, 2023, + *last release*: Jul 23, 2025, *status*: 4 - Beta, *requires*: pytest >=3.8.0 @@ -7192,7 +7229,7 @@ This list contains 1671 plugins. pytest plugin supporting json test report output :pypi:`pytest-jubilant` - *last release*: Jul 07, 2025, + *last release*: Jul 24, 2025, *status*: N/A, *requires*: pytest>=8.3.5 @@ -7555,6 +7592,13 @@ This list contains 1671 plugins. A pytest plugin to evaluate/benchmark LLM prompts + :pypi:`pytest-lobster` + *last release*: Jul 26, 2025, + *status*: N/A, + *requires*: pytest>=7.0 + + Pytest to generate lobster tracing files + :pypi:`pytest-local-badge` *last release*: Jan 15, 2023, *status*: N/A, @@ -7808,7 +7852,7 @@ This list contains 1671 plugins. Pytest plugin to hide sensitive data in test reports :pypi:`pytest-matcher` - *last release*: Aug 01, 2024, + *last release*: Jul 26, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -7941,7 +7985,7 @@ This list contains 1671 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Jul 18, 2025, + *last release*: Jul 21, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8165,7 +8209,7 @@ This list contains 1671 plugins. Massively distributed pytest runs using modal.com :pypi:`pytest-modern` - *last release*: Jul 18, 2025, + *last release*: Jul 24, 2025, *status*: 4 - Beta, *requires*: pytest>=8 @@ -8409,6 +8453,13 @@ This list contains 1671 plugins. MySQL process and client fixtures for pytest + :pypi:`pytest-nb` + *last release*: Jul 26, 2025, + *status*: N/A, + *requires*: pytest==8.4.1 + + Seedable Jupyter Notebook testing tool + :pypi:`pytest-ndb` *last release*: Apr 28, 2024, *status*: N/A, @@ -8767,7 +8818,7 @@ This list contains 1671 plugins. include/exclude values of fixtures in pytest :pypi:`pytest-optional-tests` - *last release*: Apr 15, 2025, + *last release*: Jul 21, 2025, *status*: 4 - Beta, *requires*: pytest; extra == "dev" @@ -9061,7 +9112,7 @@ This list contains 1671 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-performancetotal` - *last release*: Feb 01, 2025, + *last release*: Jul 22, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -9299,7 +9350,7 @@ This list contains 1671 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Jun 28, 2025, + *last release*: Jul 25, 2025, *status*: N/A, *requires*: pytest @@ -9621,7 +9672,7 @@ This list contains 1671 plugins. Plugin for py.test to enter PyCharm debugger on uncaught exceptions :pypi:`pytest-pycodestyle` - *last release*: Oct 10, 2024, + *last release*: Jul 20, 2025, *status*: 3 - Alpha, *requires*: pytest>=7.0 @@ -9648,6 +9699,13 @@ This list contains 1671 plugins. pytest plugin to run pydocstyle + :pypi:`pytest-pylembic` + *last release*: Jul 22, 2025, + *status*: 3 - Alpha, + *requires*: N/A + + This package provides pytest plugin for validating Alembic migrations using the pylembic package. + :pypi:`pytest-pylint` *last release*: Oct 06, 2023, *status*: 5 - Production/Stable, @@ -9810,7 +9868,7 @@ This list contains 1671 plugins. A pytest plugin to collect test information :pypi:`pytest-qaseio` - *last release*: Jul 18, 2025, + *last release*: Jul 25, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9.0.0,>=7.2.2 @@ -9984,6 +10042,13 @@ This list contains 1671 plugins. A Pytest plugin for faster fault detection via regression test prioritization + :pypi:`pytest-rca-report` + *last release*: Jul 24, 2025, + *status*: N/A, + *requires*: N/A + + Interactive RCA report generator for pytest runs, with AI-based analysis and visual dashboard + :pypi:`pytest-readme` *last release*: Sep 02, 2022, *status*: 5 - Production/Stable, @@ -10006,7 +10071,7 @@ This list contains 1671 plugins. Capture your test sessions. Recap the results. :pypi:`pytest-recorder` - *last release*: Jun 27, 2025, + *last release*: Jul 25, 2025, *status*: N/A, *requires*: N/A @@ -10090,7 +10155,7 @@ This list contains 1671 plugins. Easy to use fixtures to write regression tests. :pypi:`pytest-regtest` - *last release*: Nov 12, 2024, + *last release*: Jul 21, 2025, *status*: N/A, *requires*: pytest>7.2 @@ -10671,7 +10736,7 @@ This list contains 1671 plugins. implement a --failed option for pytest :pypi:`pytest-run-parallel` - *last release*: Jun 10, 2025, + *last release*: Jul 21, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 @@ -12301,6 +12366,13 @@ This list contains 1671 plugins. A simple plugin to view timestamps for each test + :pypi:`pytest-timing-plugin` + *last release*: Jul 21, 2025, + *status*: N/A, + *requires*: N/A + + pytest插件开发demo + :pypi:`pytest-tiny-api-client` *last release*: Jan 04, 2024, *status*: 5 - Production/Stable, @@ -13240,7 +13312,7 @@ This list contains 1671 plugins. This plugin is used to load yaml output to your test using pytest framework. :pypi:`pytest-yaml-fei` - *last release*: Jul 19, 2025, + *last release*: Jul 23, 2025, *status*: N/A, *requires*: pytest From 1b1375ff57b8c2f1d666306fee1fa81747156218 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:55:54 +0000 Subject: [PATCH 057/270] [pre-commit.ci] pre-commit autoupdate (#13624) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.4 → v0.12.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.4...v0.12.5) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a63c4ec9cb1..9b128e6ce52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.4" + rev: "v0.12.5" hooks: - id: ruff args: ["--fix"] From f3da9187d0b7c2b0a1131ba4002cc55fda34bd5c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 3 Aug 2025 05:01:14 +0000 Subject: [PATCH 058/270] [automated] Update plugin list (#13630) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 156 +++++++++++++++++++------------ 1 file changed, 98 insertions(+), 58 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index b3cb17b389f..7ceb657f704 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =8.3 :pypi:`logassert` Simple but powerful assertion and verification of logged lines Jul 12, 2025 5 - Production/Stable pytest; extra == "dev" - :pypi:`logot` Test whether your code is logging correctly 🪵 May 05, 2025 5 - Production/Stable pytest; extra == "pytest" + :pypi:`logot` Test whether your code is logging correctly 🪵 Jul 28, 2025 5 - Production/Stable pytest; extra == "pytest" :pypi:`nuts` Network Unit Testing System May 10, 2025 N/A pytest<8,>=7 :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Apr 07, 2023 N/A N/A :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A @@ -92,7 +92,7 @@ This list contains 1680 plugins. :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Jul 14, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Aug 01, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -102,7 +102,7 @@ This list contains 1680 plugins. :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Jul 14, 2025 5 - Production/Stable pytest :pypi:`pytest-archon` Rule your architecture like a real developer Dec 18, 2023 5 - Production/Stable pytest >=7.2 :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) - :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Jun 12, 2025 4 - Beta pytest>=3.0; extra == "dev" + :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Aug 01, 2025 4 - Beta pytest>=3.0; extra == "dev" :pypi:`pytest-argus-server` A plugin that provides a running Argus API server for tests Mar 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Nov 27, 2023 4 - Beta pytest >=4.6 :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) @@ -141,7 +141,7 @@ This list contains 1680 plugins. :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. Apr 24, 2024 N/A pytest>=7.0.0 :pypi:`pytest-automock` Pytest plugin for automatical mocks creation May 16, 2023 N/A pytest ; extra == 'dev' :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A - :pypi:`pytest-autoprofile` \`line_profiler.autoprofile\`-ing your \`pytest\` test suite Jul 25, 2025 4 - Beta pytest>=7.0 + :pypi:`pytest-autoprofile` \`line_profiler.autoprofile\`-ing your \`pytest\` test suite Aug 01, 2025 4 - Beta pytest>=7.0 :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest :pypi:`pytest-aviator` Aviator's Flakybot pytest plugin that automatically reruns flaky tests. Nov 04, 2022 4 - Beta pytest :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) @@ -169,7 +169,7 @@ This list contains 1680 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jul 17, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jul 30, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -233,7 +233,7 @@ This list contains 1680 plugins. :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A :pypi:`pytest-cdist` A pytest plugin to split your test suite into multiple parts Jan 30, 2025 N/A pytest>=7 - :pypi:`pytest-celery` Pytest plugin for Celery Feb 21, 2025 5 - Production/Stable N/A + :pypi:`pytest-celery` Pytest plugin for Celery Jul 30, 2025 5 - Production/Stable N/A :pypi:`pytest-celery-py37` Pytest plugin for Celery (compatible with python 3.7) May 23, 2025 5 - Production/Stable N/A :pypi:`pytest-cfg-fetcher` Pass config options to your unit tests. Feb 26, 2024 N/A N/A :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A @@ -302,6 +302,7 @@ This list contains 1680 plugins. :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Jun 12, 2024 N/A pytest<9,>=3.6 :pypi:`pytest-compare` pytest plugin for comparing call arguments. Jun 22, 2023 5 - Production/Stable N/A :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-conductor` Pytest plugin for coordinating the order in which marked tests run. Jul 30, 2025 N/A pytest<8.4; python_version == "3.8" :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts May 31, 2023 4 - Beta pytest (>=4.0.0) @@ -352,7 +353,7 @@ This list contains 1680 plugins. :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A :pypi:`pytest-databases` Reusable database fixtures for any and all databases. Jun 14, 2025 4 - Beta pytest :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest - :pypi:`pytest-datadir` pytest plugin for test data directories and files Jun 06, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-datadir` pytest plugin for test data directories and files Jul 30, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Apr 06, 2023 5 - Production/Stable pytest (>=7.1) :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest :pypi:`pytest-datadir-nng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Nov 09, 2022 5 - Production/Stable pytest (>=7.0.0,<8.0.0) @@ -457,6 +458,7 @@ This list contains 1680 plugins. :pypi:`pytest-doctest-ellipsis-markers` Setup additional values for ELLIPSIS_MARKER for doctests Jan 12, 2018 4 - Beta N/A :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) :pypi:`pytest-doctest-mkdocstrings` Run pytest --doctest-modules with markdown docstrings in code blocks (\`\`\`) Mar 02, 2024 N/A pytest + :pypi:`pytest-doctest-only` A plugin to run only doctest Jul 30, 2025 4 - Beta pytest>=8.3.0 :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Jan 25, 2025 5 - Production/Stable pytest>=4.6 :pypi:`pytest-documentary` A simple pytest plugin to generate test documentation Jul 11, 2024 N/A pytest :pypi:`pytest-dogu-report` pytest plugin for dogu report Jul 07, 2023 N/A N/A @@ -474,9 +476,9 @@ This list contains 1680 plugins. :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 - :pypi:`pytest-dsl` A DSL testing framework based on pytest Jul 25, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-dsl` A DSL testing framework based on pytest Jul 30, 2025 N/A pytest>=7.0.0 :pypi:`pytest-dsl-ssh` SSH/SFTP关键字插件,为pytest-dsl提供SSH和SFTP操作能力 Jul 25, 2025 4 - Beta pytest>=7.0.0 - :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Jul 03, 2025 N/A pytest>=7.0.0; extra == "dev" + :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Aug 01, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A @@ -664,7 +666,7 @@ This list contains 1680 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 25, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 01, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -712,7 +714,7 @@ This list contains 1680 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 23, 2025 3 - Alpha pytest==8.4.0 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 01, 2025 3 - Alpha pytest==8.4.1 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -722,12 +724,13 @@ This list contains 1680 plugins. :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 27, 2023 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Feb 28, 2023 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Nov 07, 2023 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-html5` the best report for pytest Jul 28, 2025 N/A N/A :pypi:`pytest-html-cn` pytest plugin for generating HTML reports Aug 19, 2024 5 - Production/Stable pytest!=6.0.0,>=5.0 :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Jun 05, 2025 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 17, 2024 5 - Production/Stable N/A - :pypi:`pytest-html-plus` Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config. Jul 17, 2025 N/A N/A + :pypi:`pytest-html-plus` Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config. Jul 27, 2025 N/A N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-report` Enhanced HTML reporting for pytest with categories, specifications, and detailed logging Jun 24, 2025 4 - Beta pytest>=6.0 :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A @@ -756,7 +759,7 @@ This list contains 1680 plugins. :pypi:`pytest-ignore-test-results` A pytest plugin to ignore test results. Feb 03, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-image-diff` Dec 31, 2024 3 - Alpha pytest :pypi:`pytest-image-snapshot` A pytest plugin for image snapshot management and comparison. Jul 16, 2025 4 - Beta pytest>=3.5.0 - :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. Jul 12, 2025 4 - Beta pytest>=8.0.0 + :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. Aug 02, 2025 4 - Beta pytest>=8.0.0 :pypi:`pytest-import-check` pytest plugin to check whether Python modules can be imported Jul 19, 2024 3 - Alpha pytest>=8.1 :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-infinity` Jun 09, 2024 N/A pytest<9.0.0,>=8.0.0 @@ -821,7 +824,7 @@ This list contains 1680 plugins. :pypi:`pytest-json-report-wip` A pytest plugin to report test results as JSON files Jul 23, 2025 4 - Beta pytest >=3.8.0 :pypi:`pytest-jsonschema` A pytest plugin to perform JSONSchema validations Apr 20, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-jtr` pytest plugin supporting json test report output Jul 21, 2024 N/A pytest<8.0.0,>=7.1.2 - :pypi:`pytest-jubilant` Add your description here Jul 24, 2025 N/A pytest>=8.3.5 + :pypi:`pytest-jubilant` Add your description here Jul 28, 2025 N/A pytest>=8.3.5 :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Apr 04, 2024 4 - Beta pytest>=7.0 :pypi:`pytest-jupyterhub` A reusable JupyterHub pytest plugin Apr 25, 2023 5 - Production/Stable pytest @@ -929,7 +932,7 @@ This list contains 1680 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Jul 25, 2024 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Jul 21, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Aug 01, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -944,6 +947,7 @@ This list contains 1680 plugins. :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) :pypi:`pytest-mini` A plugin to test mp Feb 06, 2023 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-minio-mock` A pytest plugin for mocking Minio S3 interactions Jun 12, 2025 N/A pytest>=5.0.0 + :pypi:`pytest-mirror` A pluggy-based pytest plugin and CLI tool for ensuring your test suite mirrors your source code structure Jul 30, 2025 4 - Beta N/A :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-missing-modules` Pytest plugin to easily fake missing modules Sep 03, 2024 N/A pytest>=8.3.2 :pypi:`pytest-mitmproxy` pytest plugin for mitmproxy tests Nov 13, 2024 N/A pytest>=7.0 @@ -966,7 +970,7 @@ This list contains 1680 plugins. :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) :pypi:`pytest-molecule-JC` PyTest Molecule Plugin :: discover and run molecule tests Jul 18, 2023 5 - Production/Stable pytest (>=7.0.0) - :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Feb 28, 2025 5 - Production/Stable pytest>=6.2 + :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Aug 01, 2025 5 - Production/Stable pytest>=6.2 :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures May 16, 2023 5 - Production/Stable N/A :pypi:`pytest-mongodb-nono` pytest plugin for MongoDB Jan 07, 2025 N/A N/A :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jul 16, 2025 N/A N/A @@ -1124,7 +1128,7 @@ This list contains 1680 plugins. :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Jul 25, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 02, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1187,6 +1191,7 @@ This list contains 1680 plugins. :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-pyreport` PyReport is a lightweight reporting plugin for Pytest that provides concise HTML report May 05, 2024 N/A pytest :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Jan 26, 2024 4 - Beta pytest >=7.0.0 + :pypi:`pytest-pyspark-plugin` Pytest pyspark plugin (p3) Jul 28, 2025 4 - Beta pytest>=8.0.0 :pypi:`pytest-pyspec` A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". Aug 17, 2024 N/A pytest<9.0.0,>=8.3.2 :pypi:`pytest-pystack` Plugin to run pystack after a timeout for a test suite. Nov 16, 2024 N/A pytest>=3.5.0 :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) @@ -1223,8 +1228,8 @@ This list contains 1680 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Jun 22, 2025 5 - Production/Stable pytest :pypi:`pytest-ranking` A Pytest plugin for faster fault detection via regression test prioritization Apr 08, 2025 4 - Beta pytest>=7.4.3 - :pypi:`pytest-rca-report` Interactive RCA report generator for pytest runs, with AI-based analysis and visual dashboard Jul 24, 2025 N/A N/A - :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-rca-report` Interactive RCA report generator for pytest runs, with AI-based analysis and visual dashboard Jul 27, 2025 N/A N/A + :pypi:`pytest-readme` Test your README.md file Aug 01, 2025 5 - Production/Stable pytest :pypi:`pytest-reana` Pytest fixtures for REANA. Sep 04, 2024 3 - Alpha N/A :pypi:`pytest-recap` Capture your test sessions. Recap the results. Jun 16, 2025 N/A pytest>=6.2.0 :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Jul 25, 2025 N/A N/A @@ -1276,12 +1281,12 @@ This list contains 1680 plugins. :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) - :pypi:`pytest-rerun-all` Rerun testsuite for a certain time or iterations Nov 16, 2023 3 - Alpha pytest (>=7.0.0) + :pypi:`pytest-rerun-all` Rerun testsuite for a certain time or iterations Jul 30, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-rerunclassfailures` pytest rerun class failures plugin Apr 24, 2024 5 - Production/Stable pytest>=7.2 :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures May 08, 2025 5 - Production/Stable pytest!=8.2.2,>=7.4 :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Dec 22, 2024 4 - Beta pytest - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Jun 11, 2025 N/A pytest~=7.0 + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Jul 29, 2025 N/A pytest~=7.0 :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 15, 2025 5 - Production/Stable pytest>=3.5.0 :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 @@ -1322,7 +1327,7 @@ This list contains 1680 plugins. :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Jun 19, 2025 4 - Beta pytest>=5 :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Jul 21, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Aug 01, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 @@ -1339,7 +1344,7 @@ This list contains 1680 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 15, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 02, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1351,7 +1356,7 @@ This list contains 1680 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 15, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 02, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1459,7 +1464,7 @@ This list contains 1680 plugins. :pypi:`pytest-stf` pytest plugin for openSTF Sep 24, 2024 N/A pytest>=5.0 :pypi:`pytest-stochastics` pytest plugin that allows selectively running tests several times and accepting \*some\* failures. Dec 01, 2024 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A - :pypi:`pytest-store` Pytest plugin to store values from test runs Sep 04, 2024 3 - Alpha pytest>=7.0.0 + :pypi:`pytest-store` Pytest plugin to store values from test runs Jul 30, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-streaming` Plugin for testing pubsub, pulsar, and kafka systems with pytest locally and in ci/cd May 28, 2025 5 - Production/Stable pytest>=8.3.5 :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-structlog` Structured logging assertions Jul 25, 2024 N/A pytest @@ -1468,7 +1473,7 @@ This list contains 1680 plugins. :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) :pypi:`pytest-subinterpreter` Run pytest in a subinterpreter Nov 25, 2023 N/A pytest>=7.0.0 - :pypi:`pytest-subket` Pytest Plugin to disable socket calls during tests Jul 17, 2025 4 - Beta N/A + :pypi:`pytest-subket` Pytest Plugin to disable socket calls during tests Jul 31, 2025 4 - Beta N/A :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 04, 2025 5 - Production/Stable pytest>=4.0.0 :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jun 13, 2025 4 - Beta pytest>=7.4 @@ -1690,7 +1695,7 @@ This list contains 1680 plugins. :pypi:`pytest-xvfb` A pytest plugin to run Xvfb (or Xephyr/Xvnc) for tests. Mar 12, 2025 4 - Beta pytest>=2.8.1 :pypi:`pytest-xvirt` A pytest plugin to virtualize test. For example to transparently running them on a remote box. Dec 15, 2024 4 - Beta pytest>=7.2.2 :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest - :pypi:`pytest-yaml-fei` a pytest yaml allure package Jul 23, 2025 N/A pytest + :pypi:`pytest-yaml-fei` a pytest yaml allure package Aug 02, 2025 N/A pytest :pypi:`pytest-yaml-sanmu` Pytest plugin for generating test cases with YAML. In test cases, you can use markers, fixtures, variables, and even call Python functions. Jan 03, 2025 N/A pytest>=8.2.2 :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A @@ -1734,7 +1739,7 @@ This list contains 1680 plugins. Simple but powerful assertion and verification of logged lines :pypi:`logot` - *last release*: May 05, 2025, + *last release*: Jul 28, 2025, *status*: 5 - Production/Stable, *requires*: pytest; extra == "pytest" @@ -2126,7 +2131,7 @@ This list contains 1680 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Jul 14, 2025, + *last release*: Aug 01, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2196,7 +2201,7 @@ This list contains 1680 plugins. pyest results colection plugin :pypi:`pytest-argus-reporter` - *last release*: Jun 12, 2025, + *last release*: Aug 01, 2025, *status*: 4 - Beta, *requires*: pytest>=3.0; extra == "dev" @@ -2469,7 +2474,7 @@ This list contains 1680 plugins. pytest plugin: avoid repeating arguments in parametrize :pypi:`pytest-autoprofile` - *last release*: Jul 25, 2025, + *last release*: Aug 01, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0 @@ -2665,7 +2670,7 @@ This list contains 1680 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Jul 17, 2025, + *last release*: Jul 30, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -3113,7 +3118,7 @@ This list contains 1680 plugins. A pytest plugin to split your test suite into multiple parts :pypi:`pytest-celery` - *last release*: Feb 21, 2025, + *last release*: Jul 30, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -3595,6 +3600,13 @@ This list contains 1680 plugins. Concurrently execute test cases with multithread, multiprocess and gevent + :pypi:`pytest-conductor` + *last release*: Jul 30, 2025, + *status*: N/A, + *requires*: pytest<8.4; python_version == "3.8" + + Pytest plugin for coordinating the order in which marked tests run. + :pypi:`pytest-config` *last release*: Nov 07, 2014, *status*: 5 - Production/Stable, @@ -3946,7 +3958,7 @@ This list contains 1680 plugins. Pytest plugin for remote Databricks notebooks testing :pypi:`pytest-datadir` - *last release*: Jun 06, 2025, + *last release*: Jul 30, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 @@ -4680,6 +4692,13 @@ This list contains 1680 plugins. Run pytest --doctest-modules with markdown docstrings in code blocks (\`\`\`) + :pypi:`pytest-doctest-only` + *last release*: Jul 30, 2025, + *status*: 4 - Beta, + *requires*: pytest>=8.3.0 + + A plugin to run only doctest + :pypi:`pytest-doctestplus` *last release*: Jan 25, 2025, *status*: 5 - Production/Stable, @@ -4800,7 +4819,7 @@ This list contains 1680 plugins. A Pytest plugin to ignore tests during collection without reporting them in the test summary. :pypi:`pytest-dsl` - *last release*: Jul 25, 2025, + *last release*: Jul 30, 2025, *status*: N/A, *requires*: pytest>=7.0.0 @@ -4814,7 +4833,7 @@ This list contains 1680 plugins. SSH/SFTP关键字插件,为pytest-dsl提供SSH和SFTP操作能力 :pypi:`pytest-dsl-ui` - *last release*: Jul 03, 2025, + *last release*: Aug 01, 2025, *status*: N/A, *requires*: pytest>=7.0.0; extra == "dev" @@ -6130,7 +6149,7 @@ This list contains 1680 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Jul 25, 2025, + *last release*: Aug 01, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6466,9 +6485,9 @@ This list contains 1680 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 23, 2025, + *last release*: Aug 01, 2025, *status*: 3 - Alpha, - *requires*: pytest==8.4.0 + *requires*: pytest==8.4.1 Experimental package to automatically extract test plugins for Home Assistant custom components @@ -6535,6 +6554,13 @@ This list contains 1680 plugins. pytest plugin for generating HTML reports + :pypi:`pytest-html5` + *last release*: Jul 28, 2025, + *status*: N/A, + *requires*: N/A + + the best report for pytest + :pypi:`pytest-html-cn` *last release*: Aug 19, 2024, *status*: 5 - Production/Stable, @@ -6571,7 +6597,7 @@ This list contains 1680 plugins. Pytest report plugin for send HTML report on object-storage :pypi:`pytest-html-plus` - *last release*: Jul 17, 2025, + *last release*: Jul 27, 2025, *status*: N/A, *requires*: N/A @@ -6774,7 +6800,7 @@ This list contains 1680 plugins. A pytest plugin for image snapshot management and comparison. :pypi:`pytest-impacted` - *last release*: Jul 12, 2025, + *last release*: Aug 02, 2025, *status*: 4 - Beta, *requires*: pytest>=8.0.0 @@ -7229,7 +7255,7 @@ This list contains 1680 plugins. pytest plugin supporting json test report output :pypi:`pytest-jubilant` - *last release*: Jul 24, 2025, + *last release*: Jul 28, 2025, *status*: N/A, *requires*: pytest>=8.3.5 @@ -7985,7 +8011,7 @@ This list contains 1680 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Jul 21, 2025, + *last release*: Aug 01, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8089,6 +8115,13 @@ This list contains 1680 plugins. A pytest plugin for mocking Minio S3 interactions + :pypi:`pytest-mirror` + *last release*: Jul 30, 2025, + *status*: 4 - Beta, + *requires*: N/A + + A pluggy-based pytest plugin and CLI tool for ensuring your test suite mirrors your source code structure + :pypi:`pytest-missing-fixtures` *last release*: Oct 14, 2020, *status*: 4 - Beta, @@ -8244,7 +8277,7 @@ This list contains 1680 plugins. PyTest Molecule Plugin :: discover and run molecule tests :pypi:`pytest-mongo` - *last release*: Feb 28, 2025, + *last release*: Aug 01, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6.2 @@ -9350,7 +9383,7 @@ This list contains 1680 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Jul 25, 2025, + *last release*: Aug 02, 2025, *status*: N/A, *requires*: pytest @@ -9790,6 +9823,13 @@ This list contains 1680 plugins. Pytest plugin for type checking code with Pyright + :pypi:`pytest-pyspark-plugin` + *last release*: Jul 28, 2025, + *status*: 4 - Beta, + *requires*: pytest>=8.0.0 + + Pytest pyspark plugin (p3) + :pypi:`pytest-pyspec` *last release*: Aug 17, 2024, *status*: N/A, @@ -10043,16 +10083,16 @@ This list contains 1680 plugins. A Pytest plugin for faster fault detection via regression test prioritization :pypi:`pytest-rca-report` - *last release*: Jul 24, 2025, + *last release*: Jul 27, 2025, *status*: N/A, *requires*: N/A Interactive RCA report generator for pytest runs, with AI-based analysis and visual dashboard :pypi:`pytest-readme` - *last release*: Sep 02, 2022, + *last release*: Aug 01, 2025, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest Test your README.md file @@ -10414,9 +10454,9 @@ This list contains 1680 plugins. Re-run only changed files in specified branch :pypi:`pytest-rerun-all` - *last release*: Nov 16, 2023, + *last release*: Jul 30, 2025, *status*: 3 - Alpha, - *requires*: pytest (>=7.0.0) + *requires*: pytest>=7.0.0 Rerun testsuite for a certain time or iterations @@ -10449,7 +10489,7 @@ This list contains 1680 plugins. Pytest fixture for recording and replaying serial port traffic. :pypi:`pytest-resilient-circuits` - *last release*: Jun 11, 2025, + *last release*: Jul 29, 2025, *status*: N/A, *requires*: pytest~=7.0 @@ -10736,7 +10776,7 @@ This list contains 1680 plugins. implement a --failed option for pytest :pypi:`pytest-run-parallel` - *last release*: Jul 21, 2025, + *last release*: Aug 01, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 @@ -10855,7 +10895,7 @@ This list contains 1680 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Jul 15, 2025, + *last release*: Aug 02, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10939,7 +10979,7 @@ This list contains 1680 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Jul 15, 2025, + *last release*: Aug 02, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11695,7 +11735,7 @@ This list contains 1680 plugins. A plugin to pytest stoq :pypi:`pytest-store` - *last release*: Sep 04, 2024, + *last release*: Jul 30, 2025, *status*: 3 - Alpha, *requires*: pytest>=7.0.0 @@ -11758,7 +11798,7 @@ This list contains 1680 plugins. Run pytest in a subinterpreter :pypi:`pytest-subket` - *last release*: Jul 17, 2025, + *last release*: Jul 31, 2025, *status*: 4 - Beta, *requires*: N/A @@ -13312,7 +13352,7 @@ This list contains 1680 plugins. This plugin is used to load yaml output to your test using pytest framework. :pypi:`pytest-yaml-fei` - *last release*: Jul 23, 2025, + *last release*: Aug 02, 2025, *status*: N/A, *requires*: pytest From 5989efe3efec31a9d14f550d89903b6311dfc828 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 06:36:19 +0200 Subject: [PATCH 059/270] [pre-commit.ci] pre-commit autoupdate (#13633) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.5 → v0.12.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.5...v0.12.7) - [github.com/pre-commit/mirrors-mypy: v1.17.0 → v1.17.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.17.0...v1.17.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9b128e6ce52..3b8d58d20be 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.5" + rev: "v0.12.7" hooks: - id: ruff args: ["--fix"] @@ -32,7 +32,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.17.0 + rev: v1.17.1 hooks: - id: mypy files: ^(src/|testing/|scripts/) From 03db745771b5304b45512bf41667adfab1fe8f7a Mon Sep 17 00:00:00 2001 From: John Litborn <11260241+jakkdl@users.noreply.github.com> Date: Fri, 8 Aug 2025 19:40:57 +0200 Subject: [PATCH 060/270] add missing colon (#13640) --- src/_pytest/raises.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/raises.py b/src/_pytest/raises.py index 480ae33647f..5a82f58e656 100644 --- a/src/_pytest/raises.py +++ b/src/_pytest/raises.py @@ -559,7 +559,7 @@ class RaisesExc(AbstractRaises[BaseExcT_co_default]): The type is checked with :func:`isinstance`, and does not need to be an exact match. If that is wanted you can use the ``check`` parameter. - :kwparam str | Pattern[str] match + :kwparam str | Pattern[str] match: A regex to match. :kwparam Callable[[BaseException], bool] check: From babe85ebd14fab8b55d74f053546c63e53e271fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 10 Aug 2025 08:08:12 +0200 Subject: [PATCH 061/270] [automated] Update plugin list (#13642) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 158 +++++++++++++++++-------------- 1 file changed, 87 insertions(+), 71 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 7ceb657f704..7b46652a035 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,20 +27,20 @@ please refer to `the update script =8.3 + :pypi:`databricks-labs-pytester` Python Testing for Databricks Aug 07, 2025 4 - Beta pytest>=8.3 :pypi:`logassert` Simple but powerful assertion and verification of logged lines Jul 12, 2025 5 - Production/Stable pytest; extra == "dev" :pypi:`logot` Test whether your code is logging correctly 🪵 Jul 28, 2025 5 - Production/Stable pytest; extra == "pytest" :pypi:`nuts` Network Unit Testing System May 10, 2025 N/A pytest<8,>=7 :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Apr 07, 2023 N/A N/A :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A - :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 08, 2024 N/A pytest>=7 + :pypi:`pytest-accept` Aug 05, 2025 N/A pytest>=7 :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Oct 13, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-adaptavist-fixed` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jan 17, 2025 N/A pytest>=5.4.0 :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) @@ -92,7 +92,7 @@ This list contains 1685 plugins. :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Aug 01, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Aug 04, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -141,11 +141,11 @@ This list contains 1685 plugins. :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. Apr 24, 2024 N/A pytest>=7.0.0 :pypi:`pytest-automock` Pytest plugin for automatical mocks creation May 16, 2023 N/A pytest ; extra == 'dev' :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A - :pypi:`pytest-autoprofile` \`line_profiler.autoprofile\`-ing your \`pytest\` test suite Aug 01, 2025 4 - Beta pytest>=7.0 + :pypi:`pytest-autoprofile` \`line_profiler.autoprofile\`-ing your \`pytest\` test suite Aug 06, 2025 4 - Beta pytest>=7.0 :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest :pypi:`pytest-aviator` Aviator's Flakybot pytest plugin that automatically reruns flaky tests. Nov 04, 2022 4 - Beta pytest :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-awaiting-fix` A simple plugin to use with pytest for traceability across Jira and disabled automated tests Jul 01, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-awaiting-fix` A simple plugin to use with pytest for traceability across Jira and disabled automated tests Aug 09, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-apigateway` pytest plugin for AWS ApiGateway May 24, 2024 4 - Beta pytest :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A @@ -392,7 +392,7 @@ This list contains 1685 plugins. :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest :pypi:`pytest-deselect-if` A plugin to deselect pytests tests rather than using skipif Dec 26, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-devpi-server` DevPI server fixture for py.test Oct 17, 2024 5 - Production/Stable pytest - :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Jun 05, 2025 N/A pytest + :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Aug 08, 2025 N/A pytest :pypi:`pytest-dhos` Common fixtures for pytest in DHOS services and libraries Sep 07, 2022 N/A N/A :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest @@ -400,7 +400,7 @@ This list contains 1685 plugins. :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) - :pypi:`pytest-directives` Control your tests flow Jul 01, 2025 3 - Alpha N/A + :pypi:`pytest-directives` Control your tests flow Aug 09, 2025 3 - Alpha N/A :pypi:`pytest-dir-equal` pytest-dir-equals is a pytest plugin providing helpers to assert directories equality allowing golden testing Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-dirty` Static import analysis for thrifty testing. Jun 08, 2025 3 - Alpha pytest>=8.2; extra == "dev" :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A @@ -501,15 +501,15 @@ This list contains 1685 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Jun 19, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Jun 19, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Jun 19, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Jun 19, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Jun 19, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Jun 19, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Jun 19, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Jun 19, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Aug 07, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Aug 07, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Aug 07, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Aug 07, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Aug 07, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Aug 07, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Aug 07, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Aug 07, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Aug 07, 2025 5 - Production/Stable N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 09, 2023 4 - Beta pytest (==7.0.1) @@ -546,7 +546,7 @@ This list contains 1685 plugins. :pypi:`pytest-exasol-extension` Jun 13, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-itde` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-saas` Nov 22, 2024 N/A pytest<9,>=7 - :pypi:`pytest-exasol-slc` Feb 11, 2025 N/A pytest<9,>=7 + :pypi:`pytest-exasol-slc` Aug 03, 2025 N/A pytest<9,>=7 :pypi:`pytest-excel` pytest plugin for generating excel reports Jul 22, 2025 5 - Production/Stable pytest :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest @@ -666,7 +666,7 @@ This list contains 1685 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 01, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 08, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -714,7 +714,7 @@ This list contains 1685 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 01, 2025 3 - Alpha pytest==8.4.1 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 07, 2025 3 - Alpha pytest==8.4.1 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -736,6 +736,7 @@ This list contains 1685 plugins. :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A :pypi:`pytest-html-report-merger` May 22, 2024 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A + :pypi:`pytest-htmlx` Custom HTML report plugin for Pytest with charts and tables Aug 07, 2025 4 - Beta pytest :pypi:`pytest-http` Fixture "http" for http requests Aug 22, 2024 N/A pytest :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Sep 18, 2024 5 - Production/Stable pytest; extra == "test" :pypi:`pytest-httpdbg` A pytest plugin to record HTTP(S) requests with stack trace. Jul 25, 2025 4 - Beta pytest>=7.0.0 @@ -796,7 +797,7 @@ This list contains 1685 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest - :pypi:`pytest-ipywidgets` Jul 15, 2025 N/A pytest + :pypi:`pytest-ipywidgets` Aug 05, 2025 N/A pytest :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Jun 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 :pypi:`pytest-isort` py.test plugin to check import ordering using isort Mar 05, 2024 5 - Production/Stable pytest (>=5.0) @@ -864,7 +865,7 @@ This list contains 1685 plugins. :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-lf-skip` A pytest plugin which makes \`--last-failed\` skip instead of deselect tests. May 26, 2025 4 - Beta pytest>=8.3.5 :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest Apr 12, 2024 4 - Beta pytest>=3.0.0 - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Oct 01, 2024 4 - Beta N/A + :pypi:`pytest-libiio` A pytest plugin for testing libiio based devices Aug 08, 2025 N/A pytest>=3.5.0 :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest @@ -913,7 +914,7 @@ This list contains 1685 plugins. :pypi:`pytest-mark-no-py3` pytest plugin and bowler codemod to help migrate tests to Python 3 May 17, 2019 N/A pytest :pypi:`pytest-marks` UNKNOWN Nov 23, 2012 3 - Alpha N/A :pypi:`pytest-mask-secrets` Pytest plugin to hide sensitive data in test reports Jan 28, 2025 N/A N/A - :pypi:`pytest-matcher` Easy way to match captured \`pytest\` output against expectations stored in files Jul 26, 2025 5 - Production/Stable pytest + :pypi:`pytest-matcher` Easy way to match captured \`pytest\` output against expectations stored in files Aug 07, 2025 5 - Production/Stable pytest :pypi:`pytest-matchers` Matchers for pytest Feb 11, 2025 N/A pytest<9.0,>=7.0 :pypi:`pytest-match-skip` Skip matching marks. Matches partial marks using wildcards. May 15, 2019 4 - Beta pytest (>=4.4.1) :pypi:`pytest-mat-report` this is report Jan 20, 2021 N/A N/A @@ -932,7 +933,7 @@ This list contains 1685 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Jul 25, 2024 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Aug 01, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Aug 05, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -946,7 +947,7 @@ This list contains 1685 plugins. :pypi:`pytest-mimic` Easily record function calls while testing Apr 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) :pypi:`pytest-mini` A plugin to test mp Feb 06, 2023 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-minio-mock` A pytest plugin for mocking Minio S3 interactions Jun 12, 2025 N/A pytest>=5.0.0 + :pypi:`pytest-minio-mock` A pytest plugin for mocking Minio S3 interactions Aug 06, 2025 N/A pytest>=5.0.0 :pypi:`pytest-mirror` A pluggy-based pytest plugin and CLI tool for ensuring your test suite mirrors your source code structure Jul 30, 2025 4 - Beta N/A :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-missing-modules` Pytest plugin to easily fake missing modules Sep 03, 2024 N/A pytest>=8.3.2 @@ -1014,7 +1015,7 @@ This list contains 1685 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Apr 01, 2025 N/A pytest<9.0.0,>=8.2.0 + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 08, 2025 N/A pytest<9.0.0,>=8.2.0 :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest_nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Aug 05, 2024 N/A N/A @@ -1094,7 +1095,7 @@ This list contains 1685 plugins. :pypi:`pytest-percents` Mar 16, 2024 N/A N/A :pypi:`pytest-perf` Run performance tests against the mainline code. May 20, 2024 5 - Production/Stable pytest!=8.1.*,>=6; extra == "testing" :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-performancetotal` A performance plugin for pytest Jul 22, 2025 5 - Production/Stable N/A + :pypi:`pytest-performancetotal` A performance plugin for pytest Aug 05, 2025 5 - Production/Stable N/A :pypi:`pytest-persistence` Pytest tool for persistent objects Aug 21, 2024 N/A N/A :pypi:`pytest-pexpect` Pytest pexpect plugin. Aug 13, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker May 18, 2025 5 - Production/Stable pytest>=7.4 @@ -1128,7 +1129,7 @@ This list contains 1685 plugins. :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 02, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 08, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1228,7 +1229,7 @@ This list contains 1685 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Jun 22, 2025 5 - Production/Stable pytest :pypi:`pytest-ranking` A Pytest plugin for faster fault detection via regression test prioritization Apr 08, 2025 4 - Beta pytest>=7.4.3 - :pypi:`pytest-rca-report` Interactive RCA report generator for pytest runs, with AI-based analysis and visual dashboard Jul 27, 2025 N/A N/A + :pypi:`pytest-rca-report` Interactive RCA report generator for pytest runs, with AI-based analysis and visual dashboard Aug 04, 2025 N/A N/A :pypi:`pytest-readme` Test your README.md file Aug 01, 2025 5 - Production/Stable pytest :pypi:`pytest-reana` Pytest fixtures for REANA. Sep 04, 2024 3 - Alpha N/A :pypi:`pytest-recap` Capture your test sessions. Recap the results. Jun 16, 2025 N/A pytest>=6.2.0 @@ -1262,7 +1263,7 @@ This list contains 1685 plugins. :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest May 06, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jul 16, 2025 N/A N/A - :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Jul 08, 2025 N/A pytest>=8.4.0 + :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Aug 08, 2025 N/A pytest>=8.4.0 :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility May 22, 2023 3 - Alpha pytest @@ -1290,6 +1291,7 @@ This list contains 1685 plugins. :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 15, 2025 5 - Production/Stable pytest>=3.5.0 :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-respect` Pytest plugin to load resource files relative to test code and to expect values to match them. Aug 06, 2025 5 - Production/Stable pytest>=8.0.0 :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) @@ -1344,7 +1346,7 @@ This list contains 1685 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 02, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 04, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1356,7 +1358,7 @@ This list contains 1685 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 02, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 04, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1366,7 +1368,7 @@ This list contains 1685 plugins. :pypi:`pytest-server` test server exec cmd Sep 09, 2024 N/A N/A :pypi:`pytest-server-fixtures` Extensible server fixtures for py.test Nov 29, 2024 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Jul 17, 2025 3 - Alpha pytest>=6.2 + :pypi:`pytest-servers` pytest servers Aug 04, 2025 3 - Alpha pytest>=6.2 :pypi:`pytest-service` Aug 06, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-services` Services plugin for pytest testing framework Jul 16, 2025 6 - Mature pytest :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest @@ -1695,7 +1697,7 @@ This list contains 1685 plugins. :pypi:`pytest-xvfb` A pytest plugin to run Xvfb (or Xephyr/Xvnc) for tests. Mar 12, 2025 4 - Beta pytest>=2.8.1 :pypi:`pytest-xvirt` A pytest plugin to virtualize test. For example to transparently running them on a remote box. Dec 15, 2024 4 - Beta pytest>=7.2.2 :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest - :pypi:`pytest-yaml-fei` a pytest yaml allure package Aug 02, 2025 N/A pytest + :pypi:`pytest-yaml-fei` a pytest yaml allure package Aug 03, 2025 N/A pytest :pypi:`pytest-yaml-sanmu` Pytest plugin for generating test cases with YAML. In test cases, you can use markers, fixtures, variables, and even call Python functions. Jan 03, 2025 N/A pytest>=8.2.2 :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A @@ -1725,7 +1727,7 @@ This list contains 1685 plugins. :pypi:`databricks-labs-pytester` - *last release*: May 13, 2025, + *last release*: Aug 07, 2025, *status*: 4 - Beta, *requires*: pytest>=8.3 @@ -1767,11 +1769,11 @@ This list contains 1685 plugins. A contextmanager pytest fixture for handling multiple mock abstracts :pypi:`pytest-accept` - *last release*: Dec 08, 2024, + *last release*: Aug 05, 2025, *status*: N/A, *requires*: pytest>=7 - A pytest-plugin for updating doctest outputs + :pypi:`pytest-adaptavist` *last release*: Oct 13, 2022, @@ -2131,7 +2133,7 @@ This list contains 1685 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Aug 01, 2025, + *last release*: Aug 04, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2474,7 +2476,7 @@ This list contains 1685 plugins. pytest plugin: avoid repeating arguments in parametrize :pypi:`pytest-autoprofile` - *last release*: Aug 01, 2025, + *last release*: Aug 06, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0 @@ -2502,7 +2504,7 @@ This list contains 1685 plugins. Makes pytest skip tests that don not need rerunning :pypi:`pytest-awaiting-fix` - *last release*: Jul 01, 2025, + *last release*: Aug 09, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 @@ -4231,7 +4233,7 @@ This list contains 1685 plugins. DevPI server fixture for py.test :pypi:`pytest-dfm` - *last release*: Jun 05, 2025, + *last release*: Aug 08, 2025, *status*: N/A, *requires*: pytest @@ -4287,7 +4289,7 @@ This list contains 1685 plugins. PyTest plugin for generating Difido reports :pypi:`pytest-directives` - *last release*: Jul 01, 2025, + *last release*: Aug 09, 2025, *status*: 3 - Alpha, *requires*: N/A @@ -4994,63 +4996,63 @@ This list contains 1685 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-idf` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: Jun 19, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -5309,7 +5311,7 @@ This list contains 1685 plugins. :pypi:`pytest-exasol-slc` - *last release*: Feb 11, 2025, + *last release*: Aug 03, 2025, *status*: N/A, *requires*: pytest<9,>=7 @@ -6149,7 +6151,7 @@ This list contains 1685 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Aug 01, 2025, + *last release*: Aug 08, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6485,7 +6487,7 @@ This list contains 1685 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 01, 2025, + *last release*: Aug 07, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.1 @@ -6638,6 +6640,13 @@ This list contains 1685 plugins. pytest plugin for generating HTML reports + :pypi:`pytest-htmlx` + *last release*: Aug 07, 2025, + *status*: 4 - Beta, + *requires*: pytest + + Custom HTML report plugin for Pytest with charts and tables + :pypi:`pytest-http` *last release*: Aug 22, 2024, *status*: N/A, @@ -7059,7 +7068,7 @@ This list contains 1685 plugins. Pytest plugin to run tests in Jupyter Notebooks :pypi:`pytest-ipywidgets` - *last release*: Jul 15, 2025, + *last release*: Aug 05, 2025, *status*: N/A, *requires*: pytest @@ -7535,11 +7544,11 @@ This list contains 1685 plugins. A python-libfaketime plugin for pytest :pypi:`pytest-libiio` - *last release*: Oct 01, 2024, - *status*: 4 - Beta, - *requires*: N/A + *last release*: Aug 08, 2025, + *status*: N/A, + *requires*: pytest>=3.5.0 - A pytest plugin to manage interfacing with libiio contexts + A pytest plugin for testing libiio based devices :pypi:`pytest-libnotify` *last release*: Apr 02, 2021, @@ -7878,7 +7887,7 @@ This list contains 1685 plugins. Pytest plugin to hide sensitive data in test reports :pypi:`pytest-matcher` - *last release*: Jul 26, 2025, + *last release*: Aug 07, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -8011,7 +8020,7 @@ This list contains 1685 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Aug 01, 2025, + *last release*: Aug 05, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8109,7 +8118,7 @@ This list contains 1685 plugins. A plugin to test mp :pypi:`pytest-minio-mock` - *last release*: Jun 12, 2025, + *last release*: Aug 06, 2025, *status*: N/A, *requires*: pytest>=5.0.0 @@ -8585,7 +8594,7 @@ This list contains 1685 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Apr 01, 2025, + *last release*: Aug 08, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.2.0 @@ -9145,7 +9154,7 @@ This list contains 1685 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-performancetotal` - *last release*: Jul 22, 2025, + *last release*: Aug 05, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -9383,7 +9392,7 @@ This list contains 1685 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Aug 02, 2025, + *last release*: Aug 08, 2025, *status*: N/A, *requires*: pytest @@ -10083,7 +10092,7 @@ This list contains 1685 plugins. A Pytest plugin for faster fault detection via regression test prioritization :pypi:`pytest-rca-report` - *last release*: Jul 27, 2025, + *last release*: Aug 04, 2025, *status*: N/A, *requires*: N/A @@ -10321,7 +10330,7 @@ This list contains 1685 plugins. Lightweight enhanced HTML reporter for Pytest :pypi:`pytest-report-extras` - *last release*: Jul 08, 2025, + *last release*: Aug 08, 2025, *status*: N/A, *requires*: pytest>=8.4.0 @@ -10516,6 +10525,13 @@ This list contains 1685 plugins. Pytest plugin for reporting running time and peak memory usage + :pypi:`pytest-respect` + *last release*: Aug 06, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=8.0.0 + + Pytest plugin to load resource files relative to test code and to expect values to match them. + :pypi:`pytest-responsemock` *last release*: Mar 10, 2022, *status*: 5 - Production/Stable, @@ -10895,7 +10911,7 @@ This list contains 1685 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Aug 02, 2025, + *last release*: Aug 04, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10979,7 +10995,7 @@ This list contains 1685 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Aug 02, 2025, + *last release*: Aug 04, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11049,7 +11065,7 @@ This list contains 1685 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 17, 2025, + *last release*: Aug 04, 2025, *status*: 3 - Alpha, *requires*: pytest>=6.2 @@ -13352,7 +13368,7 @@ This list contains 1685 plugins. This plugin is used to load yaml output to your test using pytest framework. :pypi:`pytest-yaml-fei` - *last release*: Aug 02, 2025, + *last release*: Aug 03, 2025, *status*: N/A, *requires*: pytest From 107f2c65efcf6731294057200d2b1dd59372e39c Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 15 Jul 2025 15:48:20 +0300 Subject: [PATCH 062/270] main: use a better windows short-path comparison method The previous check does not account for multiple levels of symlinks: given a -> b -> c, a would match b. --- changelog/13598.bugfix.rst | 1 + src/_pytest/main.py | 13 +++++-------- src/_pytest/pathlib.py | 8 ++++++++ testing/test_collection.py | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 changelog/13598.bugfix.rst diff --git a/changelog/13598.bugfix.rst b/changelog/13598.bugfix.rst new file mode 100644 index 00000000000..dd195112eb8 --- /dev/null +++ b/changelog/13598.bugfix.rst @@ -0,0 +1 @@ +Fixed possible collection confusion on Windows when short paths and symlinks are involved. diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 77d8b52ca46..6e35c887814 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -39,6 +39,7 @@ from _pytest.pathlib import bestrelpath from _pytest.pathlib import fnmatch_ex from _pytest.pathlib import safe_exists +from _pytest.pathlib import samefile_nofollow from _pytest.pathlib import scandir from _pytest.reports import CollectReport from _pytest.reports import TestReport @@ -935,14 +936,10 @@ def collect(self) -> Iterator[nodes.Item | nodes.Collector]: is_match = node.path == matchparts[0] if sys.platform == "win32" and not is_match: # In case the file paths do not match, fallback to samefile() to - # account for short-paths on Windows (#11895). - same_file = os.path.samefile(node.path, matchparts[0]) - # We don't want to match links to the current node, - # otherwise we would match the same file more than once (#12039). - is_match = same_file and ( - os.path.islink(node.path) - == os.path.islink(matchparts[0]) - ) + # account for short-paths on Windows (#11895). But use a version + # which doesn't resolve symlinks, otherwise we might match the + # same file more than once (#12039). + is_match = samefile_nofollow(node.path, matchparts[0]) # Name part e.g. `TestIt` in `/a/b/test_file.py::TestIt::test_it`. else: diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index b69e85404e7..d6b90687a6f 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -1053,3 +1053,11 @@ def safe_exists(p: Path) -> bool: # ValueError: stat: path too long for Windows # OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect return False + + +def samefile_nofollow(p1: Path, p2: Path) -> bool: + """Test whether two paths reference the same actual file or directory. + + Unlike Path.samefile(), does not resolve symlinks. + """ + return os.path.samestat(p1.lstat(), p2.lstat()) diff --git a/testing/test_collection.py b/testing/test_collection.py index 76091744dc6..2214c130a05 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1780,6 +1780,41 @@ def test_collect_short_file_windows(pytester: Pytester) -> None: assert result.parseoutcomes() == {"passed": 1} +def test_collect_short_file_windows_multi_level_symlink( + pytester: Pytester, + request: FixtureRequest, +) -> None: + """Regression test for multi-level Windows short-path comparison with + symlinks. + + Previously, when matching collection arguments against collected nodes on + Windows, the short path fallback resolved symlinks. With a chain a -> b -> + target, comparing 'a' against 'b' would incorrectly succeed because both + resolved to 'target', which could cause incorrect matching or duplicate + collection. + """ + # Prepare target directory with a test file. + short_path = Path(tempfile.mkdtemp()) + request.addfinalizer(lambda: shutil.rmtree(short_path, ignore_errors=True)) + target = short_path / "target" + target.mkdir() + (target / "test_chain.py").write_text("def test_chain(): pass", encoding="UTF-8") + + # Create multi-level symlink chain: a -> b -> target. + b = short_path / "b" + a = short_path / "a" + symlink_or_skip(target, b, target_is_directory=True) + symlink_or_skip(b, a, target_is_directory=True) + + # Collect via the first symlink; should find exactly one test. + result = pytester.runpytest(a) + result.assert_outcomes(passed=1) + + # Collect via the intermediate symlink; also exactly one test. + result = pytester.runpytest(b) + result.assert_outcomes(passed=1) + + def test_pyargs_collection_tree(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: """When using `--pyargs`, the collection tree of a pyargs collection argument should only include parents in the import path, not up to confcutdir. From f62cabf1182f543859b0fcb466f7f18c26ade49b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 07:23:36 +0200 Subject: [PATCH 063/270] build(deps): Bump anyio[trio] in /testing/plugins_integration (#13643) Bumps [anyio[trio]](https://github.com/agronholm/anyio) from 4.9.0 to 4.10.0. - [Release notes](https://github.com/agronholm/anyio/releases) - [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst) - [Commits](https://github.com/agronholm/anyio/compare/4.9.0...4.10) --- updated-dependencies: - dependency-name: anyio[trio] dependency-version: 4.10.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 1bc4ffe6dbe..8af9c490f86 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,4 +1,4 @@ -anyio[trio]==4.9.0 +anyio[trio]==4.10.0 django==5.2.1 pytest-asyncio==1.1.0 pytest-bdd==8.1.0 From abb61df22c33c74cced8ef7c41a414576fd6e6e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 08:04:49 +0200 Subject: [PATCH 064/270] build(deps): Bump actions/download-artifact from 4 to 5 (#13644) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6acfddcf912..9149aeebc16 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -50,7 +50,7 @@ jobs: persist-credentials: true - name: Download Package - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: Packages path: dist @@ -86,7 +86,7 @@ jobs: persist-credentials: false - name: Download Package - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: Packages path: dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d9a26f256bb..c75b34c2e71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -286,7 +286,7 @@ jobs: persist-credentials: false - name: Download Package - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: Packages path: dist From ebe6bba439f53631d57bfc946c1b4efa77057b8e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 08:21:29 +0200 Subject: [PATCH 065/270] [pre-commit.ci] pre-commit autoupdate (#13645) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.7 → v0.12.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.7...v0.12.8) - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b8d58d20be..4e1193aaf35 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.7" + rev: "v0.12.8" hooks: - id: ruff args: ["--fix"] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer From c10e9f62fc6f44e2e69a8a2272697fb1af24e1f3 Mon Sep 17 00:00:00 2001 From: Praise Tompane Date: Sat, 16 Aug 2025 08:44:37 +0200 Subject: [PATCH 066/270] docs(pythonpath): address minor typo (#13653) --- doc/en/explanation/pythonpath.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/pythonpath.rst b/doc/en/explanation/pythonpath.rst index e68f455cedf..9015d71c397 100644 --- a/doc/en/explanation/pythonpath.rst +++ b/doc/en/explanation/pythonpath.rst @@ -64,7 +64,7 @@ these values: * Test modules can't import each other. * Testing utility modules in the tests directories (for example a ``tests.helpers`` module containing test-related functions/classes) - are not importable. The recommendation in this case it to place testing utility modules together with the application/library + are not importable. The recommendation in this case is to place testing utility modules together with the application/library code, for example ``app.testing.helpers``. Important: by "test utility modules", we mean functions/classes which are imported by From 81bbec98087a84fcf42ad19572220ddcfa0f2687 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 07:17:16 +0200 Subject: [PATCH 067/270] build(deps): Bump actions/checkout from 4 to 5 (#13656) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy.yml | 6 +++--- .github/workflows/prepare-release-pr.yml | 2 +- .github/workflows/test.yml | 4 ++-- .github/workflows/update-plugin-list.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9149aeebc16..3cc17319a1e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,7 +25,7 @@ jobs: attestations: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 persist-credentials: false @@ -45,7 +45,7 @@ jobs: id-token: write contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: persist-credentials: true @@ -80,7 +80,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 persist-credentials: false diff --git a/.github/workflows/prepare-release-pr.yml b/.github/workflows/prepare-release-pr.yml index b21ca70cb46..ff8dc008f06 100644 --- a/.github/workflows/prepare-release-pr.yml +++ b/.github/workflows/prepare-release-pr.yml @@ -27,7 +27,7 @@ jobs: pull-requests: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 # persist-credentials is needed in order for us to push the release branch. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c75b34c2e71..23a4a602161 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: package: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 persist-credentials: false @@ -280,7 +280,7 @@ jobs: }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 persist-credentials: false diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index c10aefa3a55..e8119acecdc 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 persist-credentials: false From a72660795b630d0705d42065b6ce24925bf4f4b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 05:21:19 +0000 Subject: [PATCH 068/270] build(deps): Bump pytest-sugar in /testing/plugins_integration (#13657) Bumps [pytest-sugar](https://github.com/Teemu/pytest-sugar) from 1.0.0 to 1.1.0. - [Release notes](https://github.com/Teemu/pytest-sugar/releases) - [Changelog](https://github.com/Teemu/pytest-sugar/blob/main/CHANGES.rst) - [Commits](https://github.com/Teemu/pytest-sugar/compare/v1.0.0...v1.1.0) --- updated-dependencies: - dependency-name: pytest-sugar dependency-version: 1.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 8af9c490f86..59bd43e95f8 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -8,7 +8,7 @@ pytest-flakes==4.0.5 pytest-html==4.1.1 pytest-mock==3.14.1 pytest-rerunfailures==15.1 -pytest-sugar==1.0.0 +pytest-sugar==1.1.0 pytest-trio==0.8.0 pytest-twisted==1.14.3 twisted==25.5.0 From d1e931a9dac3c14833d62a6263478a64ea0c634c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 21:36:45 +0000 Subject: [PATCH 069/270] [pre-commit.ci] pre-commit autoupdate (#13659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.8 → v0.12.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.8...v0.12.9) - [github.com/woodruffw/zizmor-pre-commit: v1.11.0 → v1.12.1](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.11.0...v1.12.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e1193aaf35..67d605849fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.8" + rev: "v0.12.9" hooks: - id: ruff args: ["--fix"] @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.11.0 + rev: v1.12.1 hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs From 0354e9045b4eace8e9050f529581fcfb772a18ec Mon Sep 17 00:00:00 2001 From: Ali Nazzal <89179776+ali90h@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:34:34 +0300 Subject: [PATCH 070/270] docs(cacheprovider): add missing docstrings (#13665) Closes #13625 --------- Co-authored-by: Bruno Oliveira --- changelog/13625.doc.rst | 1 + src/_pytest/cacheprovider.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 changelog/13625.doc.rst diff --git a/changelog/13625.doc.rst b/changelog/13625.doc.rst new file mode 100644 index 00000000000..850c81583b6 --- /dev/null +++ b/changelog/13625.doc.rst @@ -0,0 +1 @@ +Added missing docstrings to ``pytest_addoption()``, ``pytest_configure()``, and ``cacheshow()`` functions in ``cacheprovider.py``. diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index dea60109b51..7f30e72007e 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -476,6 +476,10 @@ def pytest_sessionfinish(self) -> None: def pytest_addoption(parser: Parser) -> None: + """Add command-line options for cache functionality. + + :param parser: Parser object to add command-line options to. + """ group = parser.getgroup("general") group.addoption( "--lf", @@ -546,6 +550,13 @@ def pytest_cmdline_main(config: Config) -> int | ExitCode | None: @hookimpl(tryfirst=True) def pytest_configure(config: Config) -> None: + """Configure cache system and register related plugins. + + Creates the Cache instance and registers the last-failed (LFPlugin) + and new-first (NFPlugin) plugins with the plugin manager. + + :param config: pytest configuration object. + """ config.cache = Cache.for_config(config, _ispytest=True) config.pluginmanager.register(LFPlugin(config), "lfplugin") config.pluginmanager.register(NFPlugin(config), "nfplugin") @@ -584,6 +595,16 @@ def pytest_report_header(config: Config) -> str | None: def cacheshow(config: Config, session: Session) -> int: + """Display cache contents when --cache-show is used. + + Shows cached values and directories matching the specified glob pattern + (default: '*'). Displays cache location, cached test results, and + any cached directories created by plugins. + + :param config: pytest configuration object. + :param session: pytest session object. + :returns: Exit code (0 for success). + """ from pprint import pformat assert config.cache is not None From d3853375fd6ee0aecfdb943aeb3ffb41808ca715 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 23 Aug 2025 15:30:18 +0000 Subject: [PATCH 071/270] [automated] Update plugin list (#13654) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 188 ++++++++++++++++++++++--------- 1 file changed, 134 insertions(+), 54 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 7b46652a035..db8b169161c 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =8.3 - :pypi:`logassert` Simple but powerful assertion and verification of logged lines Jul 12, 2025 5 - Production/Stable pytest; extra == "dev" + :pypi:`logassert` Simple but powerful assertion and verification of logged lines Aug 14, 2025 5 - Production/Stable pytest; extra == "dev" :pypi:`logot` Test whether your code is logging correctly 🪵 Jul 28, 2025 5 - Production/Stable pytest; extra == "pytest" :pypi:`nuts` Network Unit Testing System May 10, 2025 N/A pytest<8,>=7 :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Apr 07, 2023 N/A N/A :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A - :pypi:`pytest-accept` Aug 05, 2025 N/A pytest>=7 + :pypi:`pytest-accept` Aug 13, 2025 N/A pytest>=7 :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Oct 13, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-adaptavist-fixed` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jan 17, 2025 N/A pytest>=5.4.0 :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) @@ -277,7 +277,7 @@ This list contains 1687 plugins. :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cloudist` Distribute tests to cloud machines without fuss Sep 02, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-cmake` Provide CMake module for Pytest Feb 17, 2025 N/A pytest<9,>=4 + :pypi:`pytest-cmake` Provide CMake module for Pytest Aug 14, 2025 N/A pytest<9,>=4 :pypi:`pytest-cmake-presets` Execute CMake Presets via pytest Dec 26, 2022 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-cmdline-add-args` Pytest plugin for custom argument handling and Allure reporting. This plugin allows you to add arguments before running a test. Sep 01, 2024 N/A N/A :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) @@ -400,7 +400,7 @@ This list contains 1687 plugins. :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) - :pypi:`pytest-directives` Control your tests flow Aug 09, 2025 3 - Alpha N/A + :pypi:`pytest-directives` Control your tests flow Aug 11, 2025 3 - Alpha pytest :pypi:`pytest-dir-equal` pytest-dir-equals is a pytest plugin providing helpers to assert directories equality allowing golden testing Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-dirty` Static import analysis for thrifty testing. Jun 08, 2025 3 - Alpha pytest>=8.2; extra == "dev" :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A @@ -501,15 +501,15 @@ This list contains 1687 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Aug 07, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Aug 07, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Aug 07, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Aug 07, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Aug 07, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Aug 07, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Aug 07, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Aug 07, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Aug 07, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Aug 11, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Aug 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Aug 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Aug 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Aug 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Aug 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Aug 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Aug 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Aug 11, 2025 5 - Production/Stable N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 09, 2023 4 - Beta pytest (==7.0.1) @@ -666,7 +666,7 @@ This list contains 1687 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 08, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 15, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -714,7 +714,7 @@ This list contains 1687 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 07, 2025 3 - Alpha pytest==8.4.1 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 16, 2025 3 - Alpha pytest==8.4.1 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -730,7 +730,7 @@ This list contains 1687 plugins. :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Jun 05, 2025 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 17, 2024 5 - Production/Stable N/A - :pypi:`pytest-html-plus` Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config. Jul 27, 2025 N/A N/A + :pypi:`pytest-html-plus` Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config. Aug 15, 2025 N/A N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-report` Enhanced HTML reporting for pytest with categories, specifications, and detailed logging Jun 24, 2025 4 - Beta pytest>=6.0 :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A @@ -739,6 +739,12 @@ This list contains 1687 plugins. :pypi:`pytest-htmlx` Custom HTML report plugin for Pytest with charts and tables Aug 07, 2025 4 - Beta pytest :pypi:`pytest-http` Fixture "http" for http requests Aug 22, 2024 N/A pytest :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Sep 18, 2024 5 - Production/Stable pytest; extra == "test" + :pypi:`pytest-httpchain` pytest plugin for HTTP testing using JSON files Aug 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-httpchain-jsonref` JSON reference ($ref) support for pytest-httpchain Aug 16, 2025 N/A N/A + :pypi:`pytest-httpchain-mcp` MCP server for pytest-httpchain Aug 16, 2025 N/A N/A + :pypi:`pytest-httpchain-models` Pydantic models for pytest-httpchain Aug 16, 2025 N/A N/A + :pypi:`pytest-httpchain-templates` Templating support for pytest-httpchain Aug 16, 2025 N/A N/A + :pypi:`pytest-httpchain-userfunc` User functions support for pytest-httpchain Aug 16, 2025 N/A N/A :pypi:`pytest-httpdbg` A pytest plugin to record HTTP(S) requests with stack trace. Jul 25, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A @@ -865,7 +871,7 @@ This list contains 1687 plugins. :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-lf-skip` A pytest plugin which makes \`--last-failed\` skip instead of deselect tests. May 26, 2025 4 - Beta pytest>=8.3.5 :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest Apr 12, 2024 4 - Beta pytest>=3.0.0 - :pypi:`pytest-libiio` A pytest plugin for testing libiio based devices Aug 08, 2025 N/A pytest>=3.5.0 + :pypi:`pytest-libiio` A pytest plugin for testing libiio based devices Aug 15, 2025 N/A pytest>=3.5.0 :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest @@ -893,7 +899,7 @@ This list contains 1687 plugins. :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-logging-strict` pytest fixture logging configured from packaged YAML May 20, 2025 3 - Alpha pytest - :pypi:`pytest-logikal` Common testing environment Jun 27, 2025 5 - Production/Stable pytest==8.3.5 + :pypi:`pytest-logikal` Common testing environment Aug 14, 2025 5 - Production/Stable pytest==8.4.1 :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-logscanner` Pytest plugin for logscanner (A logger for python logging outputting to easily viewable (and filterable) html files. Good for people not grep savey, and color higlighting and quickly changing filters might even bye useful for commandline wizards.) Sep 30, 2024 4 - Beta pytest>=8.2.2 :pypi:`pytest-loguru` Pytest Loguru Mar 20, 2024 5 - Production/Stable pytest; extra == "test" @@ -1015,7 +1021,7 @@ This list contains 1687 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 08, 2025 N/A pytest<9.0.0,>=8.2.0 + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 11, 2025 N/A pytest<9.0.0,>=8.2.0 :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest_nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Aug 05, 2024 N/A N/A @@ -1126,10 +1132,11 @@ This list contains 1687 plugins. :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Jul 02, 2025 N/A N/A + :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Aug 10, 2025 3 - Alpha pytest :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 08, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 10, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1244,7 +1251,7 @@ This list contains 1687 plugins. :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A :pypi:`pytest-regex` Select pytest tests with regular expressions May 29, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jul 04, 2025 5 - Production/Stable pytest>=6.2.0 + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Aug 13, 2025 5 - Production/Stable pytest>=6.2.0 :pypi:`pytest-regtest` pytest plugin for snapshot regression testing Jul 21, 2025 N/A pytest>7.2 :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relative-path` Handle relative path in pytest options or ini configs Aug 30, 2024 N/A pytest @@ -1280,6 +1287,7 @@ This list contains 1687 plugins. :pypi:`pytest-requests-futures` Pytest Plugin to Mock Requests Futures Jul 06, 2022 5 - Production/Stable pytest :pypi:`pytest-requirements` pytest plugin for using custom markers to relate tests to requirements and usecases Feb 28, 2025 N/A pytest :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-reqyaml` This is a plugin where generate requests test cases from yaml. Aug 16, 2025 N/A pytest>=8.4.1 :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerun-all` Rerun testsuite for a certain time or iterations Jul 30, 2025 3 - Alpha pytest>=7.0.0 @@ -1329,7 +1337,7 @@ This list contains 1687 plugins. :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Jun 19, 2025 4 - Beta pytest>=5 :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Aug 01, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Aug 13, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 @@ -1346,7 +1354,7 @@ This list contains 1687 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 04, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 14, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1358,7 +1366,7 @@ This list contains 1687 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 04, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 14, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1462,6 +1470,7 @@ This list contains 1687 plugins. :pypi:`pytest-status` Add status mark for tests Aug 22, 2024 N/A pytest :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A + :pypi:`pytest-stepthrough` Pause and wait for Enter after each test with --step Aug 14, 2025 N/A N/A :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A :pypi:`pytest-stf` pytest plugin for openSTF Sep 24, 2024 N/A pytest>=5.0 :pypi:`pytest-stochastics` pytest plugin that allows selectively running tests several times and accepting \*some\* failures. Dec 01, 2024 N/A pytest<9.0.0,>=8.0.0 @@ -1480,7 +1489,7 @@ This list contains 1687 plugins. :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jun 13, 2025 4 - Beta pytest>=7.4 :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Sep 17, 2023 N/A pytest (>=2.3) - :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Feb 01, 2024 4 - Beta pytest >=6.2.0 + :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Aug 16, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-suitemanager` A simple plugin to use with pytest Apr 28, 2023 4 - Beta N/A :pypi:`pytest-suite-timeout` A pytest plugin for ensuring max suite time Jan 26, 2024 N/A pytest>=7.0.0 :pypi:`pytest-supercov` Pytest plugin for measuring explicit test-file to source-file coverage Jul 02, 2023 N/A N/A @@ -1682,6 +1691,7 @@ This list contains 1687 plugins. :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xflaky` A simple plugin to use with pytest Oct 14, 2024 4 - Beta pytest>=8.2.1 + :pypi:`pytest-xhtml` pytest plugin for generating HTML reports Aug 14, 2025 5 - Production/Stable pytest>=7 :pypi:`pytest-xiuyu` This is a pytest plugin Jul 25, 2023 5 - Production/Stable N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Aug 07, 2024 N/A pytest~=8.2.2 @@ -1734,7 +1744,7 @@ This list contains 1687 plugins. Python Testing for Databricks :pypi:`logassert` - *last release*: Jul 12, 2025, + *last release*: Aug 14, 2025, *status*: 5 - Production/Stable, *requires*: pytest; extra == "dev" @@ -1769,7 +1779,7 @@ This list contains 1687 plugins. A contextmanager pytest fixture for handling multiple mock abstracts :pypi:`pytest-accept` - *last release*: Aug 05, 2025, + *last release*: Aug 13, 2025, *status*: N/A, *requires*: pytest>=7 @@ -3428,7 +3438,7 @@ This list contains 1687 plugins. Distribute tests to cloud machines without fuss :pypi:`pytest-cmake` - *last release*: Feb 17, 2025, + *last release*: Aug 14, 2025, *status*: N/A, *requires*: pytest<9,>=4 @@ -4289,9 +4299,9 @@ This list contains 1687 plugins. PyTest plugin for generating Difido reports :pypi:`pytest-directives` - *last release*: Aug 09, 2025, + *last release*: Aug 11, 2025, *status*: 3 - Alpha, - *requires*: N/A + *requires*: pytest Control your tests flow @@ -4996,63 +5006,63 @@ This list contains 1687 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-idf` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: Aug 07, 2025, + *last release*: Aug 11, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -6151,7 +6161,7 @@ This list contains 1687 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Aug 08, 2025, + *last release*: Aug 15, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6487,7 +6497,7 @@ This list contains 1687 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 07, 2025, + *last release*: Aug 16, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.1 @@ -6599,7 +6609,7 @@ This list contains 1687 plugins. Pytest report plugin for send HTML report on object-storage :pypi:`pytest-html-plus` - *last release*: Jul 27, 2025, + *last release*: Aug 15, 2025, *status*: N/A, *requires*: N/A @@ -6661,6 +6671,48 @@ This list contains 1687 plugins. Easily test your HTTP library against a local copy of httpbin + :pypi:`pytest-httpchain` + *last release*: Aug 16, 2025, + *status*: 5 - Production/Stable, + *requires*: N/A + + pytest plugin for HTTP testing using JSON files + + :pypi:`pytest-httpchain-jsonref` + *last release*: Aug 16, 2025, + *status*: N/A, + *requires*: N/A + + JSON reference ($ref) support for pytest-httpchain + + :pypi:`pytest-httpchain-mcp` + *last release*: Aug 16, 2025, + *status*: N/A, + *requires*: N/A + + MCP server for pytest-httpchain + + :pypi:`pytest-httpchain-models` + *last release*: Aug 16, 2025, + *status*: N/A, + *requires*: N/A + + Pydantic models for pytest-httpchain + + :pypi:`pytest-httpchain-templates` + *last release*: Aug 16, 2025, + *status*: N/A, + *requires*: N/A + + Templating support for pytest-httpchain + + :pypi:`pytest-httpchain-userfunc` + *last release*: Aug 16, 2025, + *status*: N/A, + *requires*: N/A + + User functions support for pytest-httpchain + :pypi:`pytest-httpdbg` *last release*: Jul 25, 2025, *status*: 4 - Beta, @@ -7544,7 +7596,7 @@ This list contains 1687 plugins. A python-libfaketime plugin for pytest :pypi:`pytest-libiio` - *last release*: Aug 08, 2025, + *last release*: Aug 15, 2025, *status*: N/A, *requires*: pytest>=3.5.0 @@ -7740,9 +7792,9 @@ This list contains 1687 plugins. pytest fixture logging configured from packaged YAML :pypi:`pytest-logikal` - *last release*: Jun 27, 2025, + *last release*: Aug 14, 2025, *status*: 5 - Production/Stable, - *requires*: pytest==8.3.5 + *requires*: pytest==8.4.1 Common testing environment @@ -8594,7 +8646,7 @@ This list contains 1687 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Aug 08, 2025, + *last release*: Aug 11, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.2.0 @@ -9370,6 +9422,13 @@ This list contains 1687 plugins. Easy pytest visual regression testing using playwright + :pypi:`pytest-pl-grader` + *last release*: Aug 10, 2025, + *status*: 3 - Alpha, + *requires*: pytest + + A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. + :pypi:`pytest-plone` *last release*: Jun 11, 2025, *status*: 3 - Alpha, @@ -9392,7 +9451,7 @@ This list contains 1687 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Aug 08, 2025, + *last release*: Aug 10, 2025, *status*: N/A, *requires*: pytest @@ -10197,7 +10256,7 @@ This list contains 1687 plugins. Management of Pytest dependencies via regex patterns :pypi:`pytest-regressions` - *last release*: Jul 04, 2025, + *last release*: Aug 13, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6.2.0 @@ -10448,6 +10507,13 @@ This list contains 1687 plugins. A pytest plugin to elegantly skip tests with optional requirements + :pypi:`pytest-reqyaml` + *last release*: Aug 16, 2025, + *status*: N/A, + *requires*: pytest>=8.4.1 + + This is a plugin where generate requests test cases from yaml. + :pypi:`pytest-reraise` *last release*: Sep 20, 2022, *status*: 5 - Production/Stable, @@ -10792,7 +10858,7 @@ This list contains 1687 plugins. implement a --failed option for pytest :pypi:`pytest-run-parallel` - *last release*: Aug 01, 2025, + *last release*: Aug 13, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 @@ -10911,7 +10977,7 @@ This list contains 1687 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Aug 04, 2025, + *last release*: Aug 14, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -10995,7 +11061,7 @@ This list contains 1687 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Aug 04, 2025, + *last release*: Aug 14, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11722,6 +11788,13 @@ This list contains 1687 plugins. Create step-wise / incremental tests in pytest. + :pypi:`pytest-stepthrough` + *last release*: Aug 14, 2025, + *status*: N/A, + *requires*: N/A + + Pause and wait for Enter after each test with --step + :pypi:`pytest-stepwise` *last release*: Dec 01, 2015, *status*: 4 - Beta, @@ -11849,9 +11922,9 @@ This list contains 1687 plugins. pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. :pypi:`pytest-sugar` - *last release*: Feb 01, 2024, + *last release*: Aug 16, 2025, *status*: 4 - Beta, - *requires*: pytest >=6.2.0 + *requires*: pytest>=6.2.0 pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). @@ -13262,6 +13335,13 @@ This list contains 1687 plugins. A simple plugin to use with pytest + :pypi:`pytest-xhtml` + *last release*: Aug 14, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=7 + + pytest plugin for generating HTML reports + :pypi:`pytest-xiuyu` *last release*: Jul 25, 2023, *status*: 5 - Production/Stable, From 2f4f14854359a94538bbab6817f2c9db1831708b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 06:02:51 +0000 Subject: [PATCH 072/270] [automated] Update plugin list (#13668) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 146 ++++++++++++++++++++----------- 1 file changed, 93 insertions(+), 53 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index db8b169161c..a065a51eddb 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =7 :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Apr 07, 2023 N/A N/A :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A - :pypi:`pytest-accept` Aug 13, 2025 N/A pytest>=7 + :pypi:`pytest-accept` Aug 19, 2025 N/A pytest>=7 :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Oct 13, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-adaptavist-fixed` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jan 17, 2025 N/A pytest>=5.4.0 :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) @@ -81,7 +81,7 @@ This list contains 1697 plugins. :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jul 31, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) :pypi:`pytest-annotated` Pytest plugin to allow use of Annotated in tests to resolve fixtures Sep 30, 2024 N/A pytest>=8.3.3 - :pypi:`pytest-ansible` Plugin for pytest to simplify calling ansible modules from tests or fixtures Jul 07, 2025 5 - Production/Stable pytest>=6 + :pypi:`pytest-ansible` Plugin for pytest to simplify calling ansible modules from tests or fixtures Aug 21, 2025 5 - Production/Stable pytest>=6 :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A @@ -105,6 +105,7 @@ This list contains 1697 plugins. :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Aug 01, 2025 4 - Beta pytest>=3.0; extra == "dev" :pypi:`pytest-argus-server` A plugin that provides a running Argus API server for tests Mar 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Nov 27, 2023 4 - Beta pytest >=4.6 + :pypi:`pytest-asdf-plugin` Pytest plugin for testing ASDF schemas Aug 18, 2025 5 - Production/Stable pytest>=7 :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) :pypi:`pytest-aspec` A rspec format reporter for pytest Dec 20, 2023 4 - Beta N/A :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A @@ -163,13 +164,13 @@ This list contains 1697 plugins. :pypi:`pytest-bdd` BDD for pytest Dec 05, 2024 6 - Mature pytest>=7.0.0 :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Nov 22, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) :pypi:`pytest-bdd-ng` BDD for pytest Nov 26, 2024 4 - Beta pytest>=5.2 - :pypi:`pytest-bdd-report` A pytest-bdd plugin for generating useful and informative BDD test reports Nov 27, 2024 N/A pytest>=7.1.3 + :pypi:`pytest-bdd-report` A pytest-bdd plugin for generating useful and informative BDD test reports Aug 19, 2025 N/A pytest>=7.1.3 :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jul 30, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Aug 22, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -392,7 +393,7 @@ This list contains 1697 plugins. :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest :pypi:`pytest-deselect-if` A plugin to deselect pytests tests rather than using skipif Dec 26, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-devpi-server` DevPI server fixture for py.test Oct 17, 2024 5 - Production/Stable pytest - :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Aug 08, 2025 N/A pytest + :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Aug 20, 2025 N/A pytest :pypi:`pytest-dhos` Common fixtures for pytest in DHOS services and libraries Sep 07, 2022 N/A N/A :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest @@ -478,7 +479,7 @@ This list contains 1697 plugins. :pypi:`pytest-dryrun` A Pytest plugin to ignore tests during collection without reporting them in the test summary. Jan 19, 2025 5 - Production/Stable pytest<9,>=7.40 :pypi:`pytest-dsl` A DSL testing framework based on pytest Jul 30, 2025 N/A pytest>=7.0.0 :pypi:`pytest-dsl-ssh` SSH/SFTP关键字插件,为pytest-dsl提供SSH和SFTP操作能力 Jul 25, 2025 4 - Beta pytest>=7.0.0 - :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Aug 01, 2025 N/A pytest>=7.0.0; extra == "dev" + :pypi:`pytest-dsl-ui` Playwright-based UI automation keywords for pytest-dsl framework Aug 21, 2025 N/A pytest>=7.0.0; extra == "dev" :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A @@ -666,7 +667,7 @@ This list contains 1697 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 15, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 22, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -680,6 +681,7 @@ This list contains 1697 plugins. :pypi:`pytest-gitlabci-parallelized` Parallelize pytest across GitLab CI workers. Mar 08, 2023 N/A N/A :pypi:`pytest-gitlab-code-quality` Collects warnings while testing and generates a GitLab Code Quality Report. Sep 09, 2024 N/A pytest>=8.1.1 :pypi:`pytest-gitlab-fold` Folds output sections in GitLab CI build log Dec 31, 2023 4 - Beta pytest >=2.6.0 + :pypi:`pytest-gitscope` A pragmatic pytest plugin that runs only the tests that matter, and ship faster Aug 21, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 20, 2025 4 - Beta pytest<=8.4.1 :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest @@ -687,10 +689,11 @@ This list contains 1697 plugins. :pypi:`pytest-goldie` A plugin to support golden tests with pytest. May 23, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest :pypi:`pytest-google-cloud-storage` Pytest custom features, e.g. fixtures and various tests. Aimed to emulate Google Cloud Storage service May 22, 2025 N/A pytest==8.3.5 + :pypi:`pytest-grader` Pytest extension for scoring programming assignments. Aug 19, 2025 N/A pytest>=8 :pypi:`pytest-gradescope` A pytest plugin for Gradescope integration Apr 29, 2025 N/A N/A :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A - :pypi:`pytest-greener` pytest plugin for Greener Jun 10, 2025 N/A N/A + :pypi:`pytest-greener` Pytest plugin for Greener Aug 23, 2025 N/A pytest<9.0.0,>=8.3.3 :pypi:`pytest-group-by-class` A Pytest plugin for running a subset of your tests by splitting them in to groups of classes. Jun 27, 2023 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) @@ -714,7 +717,7 @@ This list contains 1697 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 16, 2025 3 - Alpha pytest==8.4.1 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 22, 2025 3 - Alpha pytest==8.4.1 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -730,7 +733,7 @@ This list contains 1697 plugins. :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Jun 05, 2025 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 17, 2024 5 - Production/Stable N/A - :pypi:`pytest-html-plus` Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config. Aug 15, 2025 N/A N/A + :pypi:`pytest-html-plus` Plugin for Auto-generated pytest single file HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config even with xdist Aug 23, 2025 N/A N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-report` Enhanced HTML reporting for pytest with categories, specifications, and detailed logging Jun 24, 2025 4 - Beta pytest>=6.0 :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A @@ -775,7 +778,7 @@ This list contains 1697 plugins. :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A :pypi:`pytest-info-plugin` Get executed interface information in pytest interface automation framework Sep 14, 2023 N/A N/A :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A - :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Jun 21, 2025 4 - Beta pytest~=8.3 + :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Aug 21, 2025 4 - Beta pytest~=8.3 :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-initry` Plugin for sending automation test data from Pytest to the initry Apr 30, 2024 N/A pytest<9.0.0,>=8.1.1 @@ -803,7 +806,7 @@ This list contains 1697 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest - :pypi:`pytest-ipywidgets` Aug 05, 2025 N/A pytest + :pypi:`pytest-ipywidgets` Aug 20, 2025 N/A pytest :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Jun 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 :pypi:`pytest-isort` py.test plugin to check import ordering using isort Mar 05, 2024 5 - Production/Stable pytest (>=5.0) @@ -862,7 +865,7 @@ This list contains 1697 plugins. :pypi:`pytest-launchable` Launchable Pytest Plugin Apr 05, 2023 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) - :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. Jul 17, 2025 N/A pytest>=7 + :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. Aug 19, 2025 N/A pytest>=7 :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest :pypi:`pytest-leak-finder` Find the test that's leaking before the one that fails Feb 15, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A @@ -936,10 +939,10 @@ This list contains 1697 plugins. :pypi:`pytest-meilisearch` Pytest helpers for testing projects using Meilisearch Oct 08, 2024 N/A pytest>=7.4.3 :pypi:`pytest-memlog` Log memory usage during tests May 03, 2023 N/A pytest (>=7.3.0,<8.0.0) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest Jul 25, 2024 N/A pytest>=7.2 + :pypi:`pytest-memray` A simple plugin to use with pytest Aug 18, 2025 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Aug 05, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Aug 20, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -972,7 +975,7 @@ This list contains 1697 plugins. :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest :pypi:`pytest-modalt` Massively distributed pytest runs using modal.com Feb 27, 2024 4 - Beta pytest >=6.2.0 - :pypi:`pytest-modern` A more modern pytest Jul 24, 2025 4 - Beta pytest>=8 + :pypi:`pytest-modern` A more modern pytest Aug 19, 2025 4 - Beta pytest>=8 :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) @@ -1136,7 +1139,7 @@ This list contains 1697 plugins. :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 10, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 21, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1299,7 +1302,7 @@ This list contains 1697 plugins. :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 15, 2025 5 - Production/Stable pytest>=3.5.0 :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 - :pypi:`pytest-respect` Pytest plugin to load resource files relative to test code and to expect values to match them. Aug 06, 2025 5 - Production/Stable pytest>=8.0.0 + :pypi:`pytest-respect` Pytest plugin to load resource files relative to test code and to expect values to match them. Aug 18, 2025 5 - Production/Stable pytest>=8.0.0 :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) @@ -1325,9 +1328,10 @@ This list contains 1697 plugins. :pypi:`pytest-richtrace` A pytest plugin that displays the names and information of the pytest hook functions as they are executed. Jun 20, 2023 N/A N/A :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A :pypi:`pytest-rmsis` Sycronise pytest results to Jira RMsis Aug 10, 2022 N/A pytest (>=5.3.5) + :pypi:`pytest-rmysql` This is a plugin which is able to connet MySQL easyly. Aug 17, 2025 N/A pytest>=8.4.1 :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Nov 09, 2022 5 - Production/Stable pytest - :pypi:`pytest_robotframework` a pytest plugin that can run both python and robotframework tests while generating robot reports for them Apr 13, 2025 N/A pytest<9,>=7 + :pypi:`pytest-robotframework` a pytest plugin that can run both python and robotframework tests while generating robot reports for them Aug 17, 2025 N/A pytest<9,>=7 :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) @@ -1354,7 +1358,7 @@ This list contains 1697 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 14, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 17, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1366,7 +1370,7 @@ This list contains 1697 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 14, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 17, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1386,7 +1390,7 @@ This list contains 1697 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shard-fork` Shard tests to support parallelism across multiple machines Jun 13, 2025 4 - Beta pytest - :pypi:`pytest-shared-session-scope` Pytest session-scoped fixture that works with xdist Sep 22, 2024 N/A pytest>=7.0.0 + :pypi:`pytest-shared-session-scope` Pytest session-scoped fixture that works with xdist Aug 17, 2025 N/A pytest>=7.0.0 :pypi:`pytest-share-hdf` Plugin to save test data in HDF files and retrieve them for comparison Sep 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-sharkreport` this is pytest report plugin. Jul 11, 2022 N/A pytest (>=3.5) :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A @@ -1420,6 +1424,7 @@ This list contains 1697 plugins. :pypi:`pytest-smtpd` An SMTP server for testing built on aiosmtpd May 15, 2023 N/A pytest :pypi:`pytest-smtp-test-server` pytest plugin for using \`smtp-test-server\` as a fixture Dec 03, 2023 2 - Pre-Alpha pytest (>=7.4.3,<8.0.0) :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) + :pypi:`pytest-snap` A text-based snapshot testing library implemented as a pytest plugin Aug 21, 2025 N/A pytest>=8.0.0 :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A :pypi:`pytest-snapmock` Snapshots for your mocks. Nov 15, 2024 N/A N/A :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) @@ -1450,7 +1455,7 @@ This list contains 1697 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 14, 2025 N/A pytest<8,>5.4.0 + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 19, 2025 N/A pytest<8,>5.4.0 :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Jun 11, 2025 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -1489,7 +1494,7 @@ This list contains 1697 plugins. :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jun 13, 2025 4 - Beta pytest>=7.4 :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Sep 17, 2023 N/A pytest (>=2.3) - :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Aug 16, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Aug 23, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-suitemanager` A simple plugin to use with pytest Apr 28, 2023 4 - Beta N/A :pypi:`pytest-suite-timeout` A pytest plugin for ensuring max suite time Jan 26, 2024 N/A pytest>=7.0.0 :pypi:`pytest-supercov` Pytest plugin for measuring explicit test-file to source-file coverage Jul 02, 2023 N/A N/A @@ -1779,7 +1784,7 @@ This list contains 1697 plugins. A contextmanager pytest fixture for handling multiple mock abstracts :pypi:`pytest-accept` - *last release*: Aug 13, 2025, + *last release*: Aug 19, 2025, *status*: N/A, *requires*: pytest>=7 @@ -2066,7 +2071,7 @@ This list contains 1697 plugins. Pytest plugin to allow use of Annotated in tests to resolve fixtures :pypi:`pytest-ansible` - *last release*: Jul 07, 2025, + *last release*: Aug 21, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6 @@ -2233,6 +2238,13 @@ This list contains 1697 plugins. pytest plugin to help with comparing array output from tests + :pypi:`pytest-asdf-plugin` + *last release*: Aug 18, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=7 + + Pytest plugin for testing ASDF schemas + :pypi:`pytest-asgi-server` *last release*: Dec 12, 2020, *status*: N/A, @@ -2640,7 +2652,7 @@ This list contains 1697 plugins. BDD for pytest :pypi:`pytest-bdd-report` - *last release*: Nov 27, 2024, + *last release*: Aug 19, 2025, *status*: N/A, *requires*: pytest>=7.1.3 @@ -2682,7 +2694,7 @@ This list contains 1697 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Jul 30, 2025, + *last release*: Aug 22, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -4243,7 +4255,7 @@ This list contains 1697 plugins. DevPI server fixture for py.test :pypi:`pytest-dfm` - *last release*: Aug 08, 2025, + *last release*: Aug 20, 2025, *status*: N/A, *requires*: pytest @@ -4845,7 +4857,7 @@ This list contains 1697 plugins. SSH/SFTP关键字插件,为pytest-dsl提供SSH和SFTP操作能力 :pypi:`pytest-dsl-ui` - *last release*: Aug 01, 2025, + *last release*: Aug 21, 2025, *status*: N/A, *requires*: pytest>=7.0.0; extra == "dev" @@ -6161,7 +6173,7 @@ This list contains 1697 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Aug 15, 2025, + *last release*: Aug 22, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6258,6 +6270,13 @@ This list contains 1697 plugins. Folds output sections in GitLab CI build log + :pypi:`pytest-gitscope` + *last release*: Aug 21, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=7.0.0 + + A pragmatic pytest plugin that runs only the tests that matter, and ship faster + :pypi:`pytest-git-selector` *last release*: Nov 17, 2022, *status*: N/A, @@ -6307,6 +6326,13 @@ This list contains 1697 plugins. Pytest custom features, e.g. fixtures and various tests. Aimed to emulate Google Cloud Storage service + :pypi:`pytest-grader` + *last release*: Aug 19, 2025, + *status*: N/A, + *requires*: pytest>=8 + + Pytest extension for scoring programming assignments. + :pypi:`pytest-gradescope` *last release*: Apr 29, 2025, *status*: N/A, @@ -6329,11 +6355,11 @@ This list contains 1697 plugins. Green progress dots :pypi:`pytest-greener` - *last release*: Jun 10, 2025, + *last release*: Aug 23, 2025, *status*: N/A, - *requires*: N/A + *requires*: pytest<9.0.0,>=8.3.3 - pytest plugin for Greener + Pytest plugin for Greener :pypi:`pytest-group-by-class` *last release*: Jun 27, 2023, @@ -6497,7 +6523,7 @@ This list contains 1697 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 16, 2025, + *last release*: Aug 22, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.1 @@ -6609,11 +6635,11 @@ This list contains 1697 plugins. Pytest report plugin for send HTML report on object-storage :pypi:`pytest-html-plus` - *last release*: Aug 15, 2025, + *last release*: Aug 23, 2025, *status*: N/A, *requires*: N/A - Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config. + Plugin for Auto-generated pytest single file HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config even with xdist :pypi:`pytest-html-profiling` *last release*: Feb 11, 2020, @@ -6924,7 +6950,7 @@ This list contains 1697 plugins. display more node ininformation. :pypi:`pytest-infrahouse` - *last release*: Jun 21, 2025, + *last release*: Aug 21, 2025, *status*: 4 - Beta, *requires*: pytest~=8.3 @@ -7120,7 +7146,7 @@ This list contains 1697 plugins. Pytest plugin to run tests in Jupyter Notebooks :pypi:`pytest-ipywidgets` - *last release*: Aug 05, 2025, + *last release*: Aug 20, 2025, *status*: N/A, *requires*: pytest @@ -7533,7 +7559,7 @@ This list contains 1697 plugins. It helps to use fixtures in pytest.mark.parametrize :pypi:`pytest-lazy-fixtures` - *last release*: Jul 17, 2025, + *last release*: Aug 19, 2025, *status*: N/A, *requires*: pytest>=7 @@ -8051,7 +8077,7 @@ This list contains 1697 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: Jul 25, 2024, + *last release*: Aug 18, 2025, *status*: N/A, *requires*: pytest>=7.2 @@ -8072,7 +8098,7 @@ This list contains 1697 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Aug 05, 2025, + *last release*: Aug 20, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8303,7 +8329,7 @@ This list contains 1697 plugins. Massively distributed pytest runs using modal.com :pypi:`pytest-modern` - *last release*: Jul 24, 2025, + *last release*: Aug 19, 2025, *status*: 4 - Beta, *requires*: pytest>=8 @@ -9451,7 +9477,7 @@ This list contains 1697 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Aug 10, 2025, + *last release*: Aug 21, 2025, *status*: N/A, *requires*: pytest @@ -10592,7 +10618,7 @@ This list contains 1697 plugins. Pytest plugin for reporting running time and peak memory usage :pypi:`pytest-respect` - *last release*: Aug 06, 2025, + *last release*: Aug 18, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=8.0.0 @@ -10773,6 +10799,13 @@ This list contains 1697 plugins. Sycronise pytest results to Jira RMsis + :pypi:`pytest-rmysql` + *last release*: Aug 17, 2025, + *status*: N/A, + *requires*: pytest>=8.4.1 + + This is a plugin which is able to connet MySQL easyly. + :pypi:`pytest-rng` *last release*: Aug 08, 2019, *status*: 5 - Production/Stable, @@ -10787,8 +10820,8 @@ This list contains 1697 plugins. pytest plugin for ROAST configuration override and fixtures - :pypi:`pytest_robotframework` - *last release*: Apr 13, 2025, + :pypi:`pytest-robotframework` + *last release*: Aug 17, 2025, *status*: N/A, *requires*: pytest<9,>=7 @@ -10977,7 +11010,7 @@ This list contains 1697 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Aug 14, 2025, + *last release*: Aug 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11061,7 +11094,7 @@ This list contains 1697 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Aug 14, 2025, + *last release*: Aug 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11201,7 +11234,7 @@ This list contains 1697 plugins. Shard tests to support parallelism across multiple machines :pypi:`pytest-shared-session-scope` - *last release*: Sep 22, 2024, + *last release*: Aug 17, 2025, *status*: N/A, *requires*: pytest>=7.0.0 @@ -11438,6 +11471,13 @@ This list contains 1697 plugins. Plugin for adding a marker to slow running tests. 🐌 + :pypi:`pytest-snap` + *last release*: Aug 21, 2025, + *status*: N/A, + *requires*: pytest>=8.0.0 + + A text-based snapshot testing library implemented as a pytest plugin + :pypi:`pytest-snapci` *last release*: Nov 12, 2015, *status*: N/A, @@ -11649,7 +11689,7 @@ This list contains 1697 plugins. :pypi:`pytest-splunk-addon` - *last release*: May 14, 2025, + *last release*: Aug 19, 2025, *status*: N/A, *requires*: pytest<8,>5.4.0 @@ -11922,7 +11962,7 @@ This list contains 1697 plugins. pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. :pypi:`pytest-sugar` - *last release*: Aug 16, 2025, + *last release*: Aug 23, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 From 26a229067a72ab7e56093d2da85de960c42f7983 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 04:46:25 +0000 Subject: [PATCH 073/270] build(deps): Bump pytest-sugar in /testing/plugins_integration (#13671) Bumps [pytest-sugar](https://github.com/Teemu/pytest-sugar) from 1.1.0 to 1.1.1. - [Release notes](https://github.com/Teemu/pytest-sugar/releases) - [Changelog](https://github.com/Teemu/pytest-sugar/blob/main/CHANGES.rst) - [Commits](https://github.com/Teemu/pytest-sugar/compare/v1.1.0...v1.1.1) --- updated-dependencies: - dependency-name: pytest-sugar dependency-version: 1.1.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 59bd43e95f8..9ad038ba752 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -8,7 +8,7 @@ pytest-flakes==4.0.5 pytest-html==4.1.1 pytest-mock==3.14.1 pytest-rerunfailures==15.1 -pytest-sugar==1.1.0 +pytest-sugar==1.1.1 pytest-trio==0.8.0 pytest-twisted==1.14.3 twisted==25.5.0 From 55466e6822ce9341d20f86ac9d656644c3c7fab9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 09:28:28 +0200 Subject: [PATCH 074/270] build(deps): Bump codecov/codecov-action from 5.4.3 to 5.5.0 (#13672) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.3 to 5.5.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/18283e04ce6e62d37312384ff67231eb8fd56d24...fdcc8476540edceab3de004e990f80d881c6cc00) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.5.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23a4a602161..2cf6a6dfbd5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -319,7 +319,7 @@ jobs: - name: Upload coverage to Codecov if: "matrix.use_coverage" - uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 + uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 with: fail_ci_if_error: false files: ./coverage.xml From 3ce3fceea2161c8991ef5e72232d7a7a42102565 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 19:06:30 -0300 Subject: [PATCH 075/270] [pre-commit.ci] pre-commit autoupdate (#13673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.9 → v0.12.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.9...v0.12.10) - [github.com/RobertCraigie/pyright-python: v1.1.403 → v1.1.404](https://github.com/RobertCraigie/pyright-python/compare/v1.1.403...v1.1.404) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 67d605849fd..00b94f1c8b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.9" + rev: "v0.12.10" hooks: - id: ruff args: ["--fix"] @@ -48,7 +48,7 @@ repos: # on <3.11 - exceptiongroup>=1.0.0rc8 - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.403 + rev: v1.1.404 hooks: - id: pyright files: ^(src/|scripts/) From 3d58e8d6d35017aa118952c5265860c5ed23aa4d Mon Sep 17 00:00:00 2001 From: popododo0720 <78542988+popododo0720@users.noreply.github.com> Date: Wed, 27 Aug 2025 19:19:40 +0900 Subject: [PATCH 076/270] Fix gh pr new command (#13639) Closes #13638 --- AUTHORS | 1 + changelog/13638.contrib.rst | 2 ++ scripts/prepare-release-pr.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/13638.contrib.rst diff --git a/AUTHORS b/AUTHORS index 76099413072..d09c4dc98b4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -251,6 +251,7 @@ Kevin Hierro Carrasco Kevin J. Foley Kian Eliasi Kian-Meng Ang +Kim Soo Kodi B. Arfer Kojo Idrissa Kostis Anagnostopoulos diff --git a/changelog/13638.contrib.rst b/changelog/13638.contrib.rst new file mode 100644 index 00000000000..8eb06298c77 --- /dev/null +++ b/changelog/13638.contrib.rst @@ -0,0 +1,2 @@ +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/scripts/prepare-release-pr.py b/scripts/prepare-release-pr.py index b288e3b3982..eb4f19f8386 100644 --- a/scripts/prepare-release-pr.py +++ b/scripts/prepare-release-pr.py @@ -130,7 +130,7 @@ def prepare_release_pr(base_branch: str, is_major: bool, prerelease: str) -> Non [ "gh", "pr", - "new", + "create", f"--base={base_branch}", f"--head={release_branch}", f"--title=Release {version}", From 11255fbc2e19c30f2b648e057122fbbd9a2cf45b Mon Sep 17 00:00:00 2001 From: vyuroshchin Date: Thu, 28 Aug 2025 02:28:51 +0300 Subject: [PATCH 077/270] fix: change Exeption to Exception in raises.py --- src/_pytest/raises.py | 2 +- testing/python/raises_group.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/raises.py b/src/_pytest/raises.py index 5a82f58e656..78fae6ddcde 100644 --- a/src/_pytest/raises.py +++ b/src/_pytest/raises.py @@ -457,7 +457,7 @@ def _parse_exc( return cast(type[BaseExcT_1], origin_exc) else: raise ValueError( - f"Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseExeption]` " + f"Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseException]` " f"are accepted as generic types but got `{exc}`. " f"As `raises` will catch all instances of the specified group regardless of the " f"generic argument specific nested exceptions has to be checked " diff --git a/testing/python/raises_group.py b/testing/python/raises_group.py index 04979c32e98..386e127a13d 100644 --- a/testing/python/raises_group.py +++ b/testing/python/raises_group.py @@ -1304,7 +1304,7 @@ def test_parametrizing_conditional_raisesgroup( def test_annotated_group() -> None: # repr depends on if exceptiongroup backport is being used or not t = repr(ExceptionGroup[ValueError]) - msg = "Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseExeption]` are accepted as generic types but got `{}`. As `raises` will catch all instances of the specified group regardless of the generic argument specific nested exceptions has to be checked with `RaisesGroup`." + msg = "Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseException]` are accepted as generic types but got `{}`. As `raises` will catch all instances of the specified group regardless of the generic argument specific nested exceptions has to be checked with `RaisesGroup`." fail_msg = wrap_escape(msg.format(t)) with pytest.raises(ValueError, match=fail_msg): From 49cad00609d829a68f527ed761ebe9b1f821a2d4 Mon Sep 17 00:00:00 2001 From: CoretexShadow Date: Thu, 28 Aug 2025 19:50:25 +0330 Subject: [PATCH 078/270] Docs+Tests: clarify special discovery of pytest_generate_tests - Document that pytest_generate_tests is also discovered in test modules/classes. - Clarify other hooks must live in conftest.py or plugins; add cross-links. - Add a tiny pytester test demonstrating the behavior. - Pure docs/tests; no behavior change. --- doc/en/how-to/parametrize.rst | 7 +++++++ doc/en/how-to/writing_hook_functions.rst | 6 ++++++ testing/test_pytest_generate_tests_discovery.py | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 testing/test_pytest_generate_tests_discovery.py diff --git a/doc/en/how-to/parametrize.rst b/doc/en/how-to/parametrize.rst index d7c12c1a1f4..fe186146434 100644 --- a/doc/en/how-to/parametrize.rst +++ b/doc/en/how-to/parametrize.rst @@ -240,6 +240,13 @@ command line option and the parametrization of our test function: if "stringinput" in metafunc.fixturenames: metafunc.parametrize("stringinput", metafunc.config.getoption("stringinput")) +.. note:: + + The :hook:`pytest_generate_tests` hook can also be implemented directly in a test + module or inside a test class; unlike other hooks, pytest will discover it there + as well. Other hooks must live in a :ref:`conftest.py ` or a plugin. + See :ref:`writinghooks`. + If we now pass two stringinput values, our test will run twice: .. code-block:: pytest diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index f4c00d04fda..cd18301ce84 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -235,6 +235,12 @@ Example: """ print(config.hook) +.. note:: + + Unlike other hooks, the :hook:`pytest_generate_tests` hook is also discovered when + defined inside a test module or test class. Other hooks must live in + :ref:`conftest.py plugins ` or external plugins. + See :ref:`parametrize-basics` and the :ref:`hook-reference`. .. _`addoptionhooks`: diff --git a/testing/test_pytest_generate_tests_discovery.py b/testing/test_pytest_generate_tests_discovery.py new file mode 100644 index 00000000000..756cd8b2a31 --- /dev/null +++ b/testing/test_pytest_generate_tests_discovery.py @@ -0,0 +1,16 @@ +def test_generate_tests_discovery_in_test_module_and_not_other_hooks(pytester): + pytester.makepyfile( + """ + def pytest_generate_tests(metafunc): + if "x" in metafunc.fixturenames: + metafunc.parametrize("x", [1, 2]) + + def pytest_terminal_summary(terminalreporter): + raise AssertionError("should not be called") + + def test_x(x): + assert x in (1, 2) + """ + ) + result = pytester.runpytest() + result.assert_outcomes(passed=2) From 9d3077e94ddd4d36f4f97dfdda1aed28964a4f0a Mon Sep 17 00:00:00 2001 From: CoretexShadow Date: Thu, 28 Aug 2025 21:09:58 +0330 Subject: [PATCH 079/270] Fix: add type annotations in test to satisfy mypy --- testing/test_pytest_generate_tests_discovery.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testing/test_pytest_generate_tests_discovery.py b/testing/test_pytest_generate_tests_discovery.py index 756cd8b2a31..918d4822f6c 100644 --- a/testing/test_pytest_generate_tests_discovery.py +++ b/testing/test_pytest_generate_tests_discovery.py @@ -1,4 +1,11 @@ -def test_generate_tests_discovery_in_test_module_and_not_other_hooks(pytester): +from __future__ import annotations + +from _pytest.pytester import Pytester + + +def test_generate_tests_discovery_in_test_module_and_not_other_hooks( + pytester: Pytester, +) -> None: pytester.makepyfile( """ def pytest_generate_tests(metafunc): From 10196492e6a6445912a84fef745064d357d98e93 Mon Sep 17 00:00:00 2001 From: CoretexShadow Date: Thu, 28 Aug 2025 21:10:27 +0330 Subject: [PATCH 080/270] chore: add PR body --- PR_BODY.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 PR_BODY.md diff --git a/PR_BODY.md b/PR_BODY.md new file mode 100644 index 00000000000..653be0cfa6c --- /dev/null +++ b/PR_BODY.md @@ -0,0 +1,24 @@ +Summary +Clarifies that `pytest_generate_tests` is uniquely discovered when defined in test modules and classes, while other hooks must reside in `conftest.py` or plugins. Adds brief cross-links for readers and a tiny self-test to demonstrate the behavior. + +Motivation +Users can be confused by hook discovery. This highlights the only exception to the “hooks live in conftest/plugins” rule and points to the relevant sections, reducing friction and support questions. + +Changes +- `doc/en/how-to/writing_hook_functions.rst`: Add short note about `pytest_generate_tests` special discovery; link to parametrization docs and hook reference. +- `doc/en/how-to/parametrize.rst`: Add short note in the `pytest_generate_tests` section reinforcing the special discovery. +- `testing/test_pytest_generate_tests_discovery.py`: New pytester-based test showing `pytest_generate_tests` in a test module works, while `pytest_terminal_summary` in a test module is not executed. + +Tests +- Verifies `pytest_generate_tests` in a test module parametrizes a test (2 passed). +- Verifies another hook (`pytest_terminal_summary`) in a test module is not executed. + +Docs +Minimal “Note:” additions with cross-links, kept focused for easy review. + +Notes +No behavior change; documentation and a small test only. +Local pre-commit and tests pass; docs build succeeds. + +Related Issue +Closes #13577 From e47ddf1634c98836a873ff2ac19f8dbbc31f6419 Mon Sep 17 00:00:00 2001 From: CoretexShadow Date: Thu, 28 Aug 2025 21:40:50 +0330 Subject: [PATCH 081/270] chore: add changelog entry for #13577 and remove PR_BODY.md --- PR_BODY.md | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 PR_BODY.md diff --git a/PR_BODY.md b/PR_BODY.md deleted file mode 100644 index 653be0cfa6c..00000000000 --- a/PR_BODY.md +++ /dev/null @@ -1,24 +0,0 @@ -Summary -Clarifies that `pytest_generate_tests` is uniquely discovered when defined in test modules and classes, while other hooks must reside in `conftest.py` or plugins. Adds brief cross-links for readers and a tiny self-test to demonstrate the behavior. - -Motivation -Users can be confused by hook discovery. This highlights the only exception to the “hooks live in conftest/plugins” rule and points to the relevant sections, reducing friction and support questions. - -Changes -- `doc/en/how-to/writing_hook_functions.rst`: Add short note about `pytest_generate_tests` special discovery; link to parametrization docs and hook reference. -- `doc/en/how-to/parametrize.rst`: Add short note in the `pytest_generate_tests` section reinforcing the special discovery. -- `testing/test_pytest_generate_tests_discovery.py`: New pytester-based test showing `pytest_generate_tests` in a test module works, while `pytest_terminal_summary` in a test module is not executed. - -Tests -- Verifies `pytest_generate_tests` in a test module parametrizes a test (2 passed). -- Verifies another hook (`pytest_terminal_summary`) in a test module is not executed. - -Docs -Minimal “Note:” additions with cross-links, kept focused for easy review. - -Notes -No behavior change; documentation and a small test only. -Local pre-commit and tests pass; docs build succeeds. - -Related Issue -Closes #13577 From 91ac2ce9e6ceebb8240e2e4791cb6094fd3ac1e0 Mon Sep 17 00:00:00 2001 From: CoretexShadow Date: Thu, 28 Aug 2025 21:46:17 +0330 Subject: [PATCH 082/270] chore: fix changelog fragment type for #13577 --- changelog/13577.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/13577.doc.rst diff --git a/changelog/13577.doc.rst b/changelog/13577.doc.rst new file mode 100644 index 00000000000..8d6db9ea983 --- /dev/null +++ b/changelog/13577.doc.rst @@ -0,0 +1 @@ +Clarify that ``pytest_generate_tests`` is discovered in test modules/classes; other hooks must be in ``conftest.py`` or plugins. From 3c297e9feff660e236101d40ab30ea2a52daa61a Mon Sep 17 00:00:00 2001 From: CoretexShadow Date: Fri, 29 Aug 2025 18:21:19 +0330 Subject: [PATCH 083/270] Address review: delete redundant test; keep docs-only adjustments for pytest_generate_tests --- .../test_pytest_generate_tests_discovery.py | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 testing/test_pytest_generate_tests_discovery.py diff --git a/testing/test_pytest_generate_tests_discovery.py b/testing/test_pytest_generate_tests_discovery.py deleted file mode 100644 index 918d4822f6c..00000000000 --- a/testing/test_pytest_generate_tests_discovery.py +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import annotations - -from _pytest.pytester import Pytester - - -def test_generate_tests_discovery_in_test_module_and_not_other_hooks( - pytester: Pytester, -) -> None: - pytester.makepyfile( - """ - def pytest_generate_tests(metafunc): - if "x" in metafunc.fixturenames: - metafunc.parametrize("x", [1, 2]) - - def pytest_terminal_summary(terminalreporter): - raise AssertionError("should not be called") - - def test_x(x): - assert x in (1, 2) - """ - ) - result = pytester.runpytest() - result.assert_outcomes(passed=2) From e866958b434512e1591049ab7ff24aef2177f1b9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 31 Aug 2025 04:36:12 +0000 Subject: [PATCH 084/270] [automated] Update plugin list (#13689) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 98 +++++++++++++++++++------------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index a065a51eddb..e5fcefcb42c 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =7.1.1,<8.0.0) + :pypi:`pytest-api-cov` Api Coverage Report Pytest Plugin Aug 26, 2025 N/A pytest>=8.4.1 :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Aug 04, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Aug 28, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -170,7 +171,7 @@ This list contains 1702 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Aug 22, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Aug 26, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -270,7 +271,7 @@ This list contains 1702 plugins. :pypi:`pytest-cleanslate` Collects and executes pytest tests separately Apr 10, 2025 N/A pytest :pypi:`pytest_cleanup` Automated, comprehensive and well-organised pytest test cases. Jan 28, 2020 N/A N/A :pypi:`pytest-cleanuptotal` A cleanup plugin for pytest Jul 22, 2025 5 - Production/Stable N/A - :pypi:`pytest-clerk` A set of pytest fixtures to help with integration testing with Clerk. Jul 10, 2025 N/A pytest<9.0.0,>=8.0.0 + :pypi:`pytest-clerk` A set of pytest fixtures to help with integration testing with Clerk. Aug 30, 2025 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-cli2-ansible` Mar 05, 2025 N/A N/A :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-cli-fixtures` Automatically register fixtures for custom CLI arguments Jul 28, 2022 N/A pytest (~=7.0) @@ -384,6 +385,7 @@ This list contains 1702 plugins. :pypi:`pytest-deduplicate` Identifies duplicate unit tests Aug 12, 2023 4 - Beta pytest :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A :pypi:`pytest_defer` A 'defer' fixture for pytest Nov 13, 2024 N/A pytest>=8.3 + :pypi:`pytest-delta` Run only tests impacted by your code changes (delta-based selection) for pytest. Aug 29, 2025 N/A pytest>=7.0 :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A :pypi:`pytest-dependency` Manage dependencies of tests Dec 31, 2023 4 - Beta N/A :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) @@ -413,7 +415,7 @@ This list contains 1702 plugins. :pypi:`pytest-ditto-pyarrow` pytest-ditto plugin for pyarrow tables. Jun 09, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-django` A Django plugin for pytest. Apr 03, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Jul 12, 2025 5 - Production/Stable pytest + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Aug 30, 2025 5 - Production/Stable pytest :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A :pypi:`pytest-django-class` A pytest plugin for running django in class-scoped fixtures Aug 08, 2023 4 - Beta N/A @@ -483,8 +485,8 @@ This list contains 1702 plugins. :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A - :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 29, 2025 5 - Production/Stable pytest>=4.6 - :pypi:`pytest-dynamic-parameterize` A Python package for managing pytest plugins. Jul 14, 2025 N/A pytest + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Aug 29, 2025 5 - Production/Stable pytest>=4.6 + :pypi:`pytest-dynamic-parameterize` A Python package for managing pytest plugins. Aug 27, 2025 N/A pytest :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Apr 04, 2025 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A @@ -689,7 +691,7 @@ This list contains 1702 plugins. :pypi:`pytest-goldie` A plugin to support golden tests with pytest. May 23, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest :pypi:`pytest-google-cloud-storage` Pytest custom features, e.g. fixtures and various tests. Aimed to emulate Google Cloud Storage service May 22, 2025 N/A pytest==8.3.5 - :pypi:`pytest-grader` Pytest extension for scoring programming assignments. Aug 19, 2025 N/A pytest>=8 + :pypi:`pytest-grader` Pytest extension for scoring programming assignments. Aug 25, 2025 N/A pytest>=8 :pypi:`pytest-gradescope` A pytest plugin for Gradescope integration Apr 29, 2025 N/A N/A :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A @@ -717,7 +719,7 @@ This list contains 1702 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 22, 2025 3 - Alpha pytest==8.4.1 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 30, 2025 3 - Alpha pytest==8.4.1 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -785,7 +787,7 @@ This list contains 1702 plugins. :pypi:`pytest-inline` A pytest plugin for writing inline tests Oct 24, 2024 4 - Beta pytest<9.0,>=7.0 :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Apr 09, 2025 5 - Production/Stable pytest :pypi:`pytest-inmanta-extensions` Inmanta tests package Jul 04, 2025 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 19, 2025 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Aug 26, 2025 5 - Production/Stable N/A :pypi:`pytest-inmanta-srlinux` Pytest library to facilitate end to end testing of inmanta projects Apr 22, 2025 3 - Alpha N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Feb 22, 2024 4 - Beta pytest :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A @@ -833,6 +835,7 @@ This list contains 1702 plugins. :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-json-report-wip` A pytest plugin to report test results as JSON files Jul 23, 2025 4 - Beta pytest >=3.8.0 :pypi:`pytest-jsonschema` A pytest plugin to perform JSONSchema validations Apr 20, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-jsonschema-snapshot` Pytest plugin for automatic JSON Schema generation and validation from examples Aug 26, 2025 N/A pytest :pypi:`pytest-jtr` pytest plugin supporting json test report output Jul 21, 2024 N/A pytest<8.0.0,>=7.1.2 :pypi:`pytest-jubilant` Add your description here Jul 28, 2025 N/A pytest>=8.3.5 :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest @@ -1295,14 +1298,14 @@ This list contains 1702 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerun-all` Rerun testsuite for a certain time or iterations Jul 30, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-rerunclassfailures` pytest rerun class failures plugin Apr 24, 2024 5 - Production/Stable pytest>=7.2 - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures May 08, 2025 5 - Production/Stable pytest!=8.2.2,>=7.4 + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Aug 29, 2025 5 - Production/Stable pytest!=8.2.2,>=7.4 :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Dec 22, 2024 4 - Beta pytest :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Jul 29, 2025 N/A pytest~=7.0 :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 15, 2025 5 - Production/Stable pytest>=3.5.0 :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 - :pypi:`pytest-respect` Pytest plugin to load resource files relative to test code and to expect values to match them. Aug 18, 2025 5 - Production/Stable pytest>=8.0.0 + :pypi:`pytest-respect` Pytest plugin to load resource files relative to test code and to expect values to match them. Aug 25, 2025 5 - Production/Stable pytest>=8.0.0 :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) @@ -1358,7 +1361,7 @@ This list contains 1702 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 29, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1370,7 +1373,7 @@ This list contains 1702 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 29, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1390,7 +1393,7 @@ This list contains 1702 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shard-fork` Shard tests to support parallelism across multiple machines Jun 13, 2025 4 - Beta pytest - :pypi:`pytest-shared-session-scope` Pytest session-scoped fixture that works with xdist Aug 17, 2025 N/A pytest>=7.0.0 + :pypi:`pytest-shared-session-scope` Pytest session-scoped fixture that works with xdist Aug 27, 2025 N/A pytest>=7.0.0 :pypi:`pytest-share-hdf` Plugin to save test data in HDF files and retrieve them for comparison Sep 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-sharkreport` this is pytest report plugin. Jul 11, 2022 N/A pytest (>=3.5) :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A @@ -1424,7 +1427,7 @@ This list contains 1702 plugins. :pypi:`pytest-smtpd` An SMTP server for testing built on aiosmtpd May 15, 2023 N/A pytest :pypi:`pytest-smtp-test-server` pytest plugin for using \`smtp-test-server\` as a fixture Dec 03, 2023 2 - Pre-Alpha pytest (>=7.4.3,<8.0.0) :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) - :pypi:`pytest-snap` A text-based snapshot testing library implemented as a pytest plugin Aug 21, 2025 N/A pytest>=8.0.0 + :pypi:`pytest-snap` A text-based snapshot testing library implemented as a pytest plugin Aug 25, 2025 N/A pytest>=8.0.0 :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A :pypi:`pytest-snapmock` Snapshots for your mocks. Nov 15, 2024 N/A N/A :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) @@ -1456,7 +1459,7 @@ This list contains 1702 plugins. :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 19, 2025 N/A pytest<8,>5.4.0 - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Jun 11, 2025 N/A N/A + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Aug 28, 2025 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Apr 19, 2025 3 - Alpha pytest>=8.0 @@ -1689,7 +1692,6 @@ This list contains 1702 plugins. :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-gnumake` A small example package Jun 22, 2025 N/A pytest - :pypi:`pytest-xdist-lock` Extension for pytest-xdist adding test and resource group locks for local and distributed runs Apr 26, 2025 N/A pytest>=6.0 :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) :pypi:`pytest-xdist-worker-stats` A pytest plugin to list worker statistics after a xdist run. Mar 15, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-xdocker` Pytest fixture to run docker across test runs. Jun 10, 2025 N/A pytest<9.0.0,>=8.0.0 @@ -2140,6 +2142,13 @@ This list contains 1702 plugins. An ASGI middleware to populate OpenAPI Specification examples from pytest functions + :pypi:`pytest-api-cov` + *last release*: Aug 26, 2025, + *status*: N/A, + *requires*: pytest>=8.4.1 + + Api Coverage Report Pytest Plugin + :pypi:`pytest-api-framework` *last release*: Jun 22, 2025, *status*: N/A, @@ -2148,7 +2157,7 @@ This list contains 1702 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Aug 04, 2025, + *last release*: Aug 28, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2694,7 +2703,7 @@ This list contains 1702 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Aug 22, 2025, + *last release*: Aug 26, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -3394,7 +3403,7 @@ This list contains 1702 plugins. A cleanup plugin for pytest :pypi:`pytest-clerk` - *last release*: Jul 10, 2025, + *last release*: Aug 30, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.0.0 @@ -4191,6 +4200,13 @@ This list contains 1702 plugins. A 'defer' fixture for pytest + :pypi:`pytest-delta` + *last release*: Aug 29, 2025, + *status*: N/A, + *requires*: pytest>=7.0 + + Run only tests impacted by your code changes (delta-based selection) for pytest. + :pypi:`pytest-demo-plugin` *last release*: May 15, 2021, *status*: N/A, @@ -4395,7 +4411,7 @@ This list contains 1702 plugins. A Django plugin for pytest. :pypi:`pytest-djangoapp` - *last release*: Jul 12, 2025, + *last release*: Aug 30, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -4885,14 +4901,14 @@ This list contains 1702 plugins. :pypi:`pytest-durations` - *last release*: Apr 29, 2025, + *last release*: Aug 29, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=4.6 Pytest plugin reporting fixtures and test functions execution time. :pypi:`pytest-dynamic-parameterize` - *last release*: Jul 14, 2025, + *last release*: Aug 27, 2025, *status*: N/A, *requires*: pytest @@ -6327,7 +6343,7 @@ This list contains 1702 plugins. Pytest custom features, e.g. fixtures and various tests. Aimed to emulate Google Cloud Storage service :pypi:`pytest-grader` - *last release*: Aug 19, 2025, + *last release*: Aug 25, 2025, *status*: N/A, *requires*: pytest>=8 @@ -6523,7 +6539,7 @@ This list contains 1702 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 22, 2025, + *last release*: Aug 30, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.1 @@ -6999,7 +7015,7 @@ This list contains 1702 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Jun 19, 2025, + *last release*: Aug 26, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -7334,6 +7350,13 @@ This list contains 1702 plugins. A pytest plugin to perform JSONSchema validations + :pypi:`pytest-jsonschema-snapshot` + *last release*: Aug 26, 2025, + *status*: N/A, + *requires*: pytest + + Pytest plugin for automatic JSON Schema generation and validation from examples + :pypi:`pytest-jtr` *last release*: Jul 21, 2024, *status*: N/A, @@ -10569,7 +10592,7 @@ This list contains 1702 plugins. pytest rerun class failures plugin :pypi:`pytest-rerunfailures` - *last release*: May 08, 2025, + *last release*: Aug 29, 2025, *status*: 5 - Production/Stable, *requires*: pytest!=8.2.2,>=7.4 @@ -10618,7 +10641,7 @@ This list contains 1702 plugins. Pytest plugin for reporting running time and peak memory usage :pypi:`pytest-respect` - *last release*: Aug 18, 2025, + *last release*: Aug 25, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=8.0.0 @@ -11010,7 +11033,7 @@ This list contains 1702 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Aug 17, 2025, + *last release*: Aug 29, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11094,7 +11117,7 @@ This list contains 1702 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Aug 17, 2025, + *last release*: Aug 29, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11234,7 +11257,7 @@ This list contains 1702 plugins. Shard tests to support parallelism across multiple machines :pypi:`pytest-shared-session-scope` - *last release*: Aug 17, 2025, + *last release*: Aug 27, 2025, *status*: N/A, *requires*: pytest>=7.0.0 @@ -11472,7 +11495,7 @@ This list contains 1702 plugins. Plugin for adding a marker to slow running tests. 🐌 :pypi:`pytest-snap` - *last release*: Aug 21, 2025, + *last release*: Aug 25, 2025, *status*: N/A, *requires*: pytest>=8.0.0 @@ -11696,7 +11719,7 @@ This list contains 1702 plugins. A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Jun 11, 2025, + *last release*: Aug 28, 2025, *status*: N/A, *requires*: N/A @@ -13326,13 +13349,6 @@ This list contains 1702 plugins. A small example package - :pypi:`pytest-xdist-lock` - *last release*: Apr 26, 2025, - *status*: N/A, - *requires*: pytest>=6.0 - - Extension for pytest-xdist adding test and resource group locks for local and distributed runs - :pypi:`pytest-xdist-tracker` *last release*: Nov 18, 2021, *status*: 3 - Alpha, From c69156e4a1206b974cbda95798ef445039824a99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 09:18:00 +0200 Subject: [PATCH 085/270] build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#13691) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 15.1 to 16.0. - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/15.1...16.0) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-version: '16.0' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 9ad038ba752..00eff273457 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -7,7 +7,7 @@ pytest-django==4.11.1 pytest-flakes==4.0.5 pytest-html==4.1.1 pytest-mock==3.14.1 -pytest-rerunfailures==15.1 +pytest-rerunfailures==16.0 pytest-sugar==1.1.1 pytest-trio==0.8.0 pytest-twisted==1.14.3 From 806a670486108f2485fe046abffb22af8bca42e8 Mon Sep 17 00:00:00 2001 From: Marcos Boger <50413997+marcosboger@users.noreply.github.com> Date: Mon, 1 Sep 2025 08:58:02 -0300 Subject: [PATCH 086/270] Run Link Checks via scheduled workflow (#13682) Fixes #12474 --- .github/workflows/doc-check-links.yml | 37 +++++++++++++++++++++++++++ AUTHORS | 1 + changelog/12474.contrib.rst | 1 + 3 files changed, 39 insertions(+) create mode 100644 .github/workflows/doc-check-links.yml create mode 100644 changelog/12474.contrib.rst diff --git a/.github/workflows/doc-check-links.yml b/.github/workflows/doc-check-links.yml new file mode 100644 index 00000000000..fd324618d08 --- /dev/null +++ b/.github/workflows/doc-check-links.yml @@ -0,0 +1,37 @@ +name: Doc Check Links + +on: + schedule: + # At 00:00 on Sunday. + # https://crontab.guru + - cron: '0 0 * * 0' + workflow_dispatch: + +# Set permissions at the job level. +permissions: {} + +jobs: + doc-check-links: + if: github.repository_owner == 'pytest-dev' + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: pip + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + + - name: Run sphinx linkcheck via tox + run: tox -e docs-checklinks diff --git a/AUTHORS b/AUTHORS index d09c4dc98b4..f93de06c10d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -282,6 +282,7 @@ Marcin Augustynów Marcin Bachry Marc Bresson Marco Gorelli +Marcos Boger Mark Abramowitz Mark Dickinson Mark Vong diff --git a/changelog/12474.contrib.rst b/changelog/12474.contrib.rst new file mode 100644 index 00000000000..bb668fd66c5 --- /dev/null +++ b/changelog/12474.contrib.rst @@ -0,0 +1 @@ +Added scheduled GitHub Action Workflow to run Sphinx linkchecks in repo documentation. From 57c15f758a67d5e4e79886d42cc58158c6a6345e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:14:48 +0200 Subject: [PATCH 087/270] [pre-commit.ci] pre-commit autoupdate (#13692) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.10 → v0.12.11](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.10...v0.12.11) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00b94f1c8b4..c8fcdd9180b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.10" + rev: "v0.12.11" hooks: - id: ruff args: ["--fix"] From bf92debb4fd874289f6aed29c6947b611b1de0ae Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Tue, 2 Sep 2025 21:39:38 +0200 Subject: [PATCH 088/270] Fix passenv CI in tox ini and make tests insensitive to the presence of the CI env variable (#13684) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed in https://github.com/pytest-dev/pytest/pull/13684#:~:text=See%3A%20%23-,13679%20(comment),-ogrisel%20added%204. --------- Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- changelog/13684.contrib.rst | 1 + pyproject.toml | 3 +++ testing/conftest.py | 12 ++++++++++++ testing/python/approx.py | 4 ++-- testing/test_faulthandler.py | 1 + tox.ini | 1 + 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 changelog/13684.contrib.rst diff --git a/changelog/13684.contrib.rst b/changelog/13684.contrib.rst new file mode 100644 index 00000000000..bb2f87f1710 --- /dev/null +++ b/changelog/13684.contrib.rst @@ -0,0 +1 @@ +Make pytest's own testsuite insensitive to the presence of the ``CI`` environment variable -- by :user:`ogrisel`. diff --git a/pyproject.toml b/pyproject.toml index c106dcc5901..a277961ccb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -428,6 +428,9 @@ markers = [ "slow", # experimental mark for all tests using pexpect "uses_pexpect", + # Disables the `remove_ci_env_var` autouse fixture on a given test that + # actually inspects whether the CI environment variable is set. + "keep_ci_var", ] [tool.towncrier] diff --git a/testing/conftest.py b/testing/conftest.py index 251b430e9cd..25abce913ea 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -237,3 +237,15 @@ def mock_timing(monkeypatch: MonkeyPatch): result = MockTiming() result.patch(monkeypatch) return result + + +@pytest.fixture(autouse=True) +def remove_ci_env_var(monkeypatch: MonkeyPatch, request: pytest.FixtureRequest) -> None: + """Make the test insensitive if it is running in CI or not. + + Use `@pytest.mark.keep_ci_var` in a test to avoid applying this fixture, letting the test + see the real `CI` variable (if present). + """ + has_keep_ci_mark = request.node.get_closest_marker("keep_ci_var") is not None + if not has_keep_ci_mark: + monkeypatch.delenv("CI", raising=False) diff --git a/testing/python/approx.py b/testing/python/approx.py index 2ca7ee70945..06633b544ec 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -1085,10 +1085,10 @@ def test_map_over_nested_lists(self): ] def test_map_over_mixed_sequence(self): - assert _recursive_sequence_map(sqrt, [4, (25, 64), [(49)]]) == [ + assert _recursive_sequence_map(sqrt, [4, (25, 64), [49]]) == [ 2, (5, 8), - [(7)], + [7], ] def test_map_over_sequence_like(self): diff --git a/testing/test_faulthandler.py b/testing/test_faulthandler.py index c416e81d2d9..d89cb274b78 100644 --- a/testing/test_faulthandler.py +++ b/testing/test_faulthandler.py @@ -71,6 +71,7 @@ def test_disabled(): assert result.ret == 0 +@pytest.mark.keep_ci_var @pytest.mark.parametrize( "enabled", [ diff --git a/tox.ini b/tox.ini index f1283aa8260..3fe7865a289 100644 --- a/tox.ini +++ b/tox.ini @@ -52,6 +52,7 @@ passenv = PYTEST_ADDOPTS TERM SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST + CI setenv = _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} {env:_PYTEST_FILES:} From 45b35ebc26d82e9bd3890430376e47884cc20062 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 4 Sep 2025 11:43:22 -0300 Subject: [PATCH 089/270] Merge pull request #13696 from pytest-dev/release-8.4.2 (#13698) Release 8.4.2 (cherry picked from commit fa4b09167487c101623d2ebee7608a302e1a6ff4) --- changelog/13478.bugfix.rst | 1 - changelog/13480.contrib.rst | 1 - changelog/13530.bugfix.rst | 1 - changelog/13547.contrib.rst | 1 - changelog/13549.bugfix.rst | 3 -- changelog/13559.bugfix.rst | 1 - changelog/13563.bugfix.rst | 1 - changelog/13577.doc.rst | 1 - changelog/13684.contrib.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-8.4.2.rst | 27 ++++++++++++++++++ doc/en/builtin.rst | 2 +- doc/en/changelog.rst | 43 +++++++++++++++++++++++++++++ doc/en/example/parametrize.rst | 6 ++-- doc/en/example/pythoncollection.rst | 4 +-- doc/en/getting-started.rst | 2 +- doc/en/how-to/fixtures.rst | 2 +- 17 files changed, 79 insertions(+), 19 deletions(-) delete mode 100644 changelog/13478.bugfix.rst delete mode 100644 changelog/13480.contrib.rst delete mode 100644 changelog/13530.bugfix.rst delete mode 100644 changelog/13547.contrib.rst delete mode 100644 changelog/13549.bugfix.rst delete mode 100644 changelog/13559.bugfix.rst delete mode 100644 changelog/13563.bugfix.rst delete mode 100644 changelog/13577.doc.rst delete mode 100644 changelog/13684.contrib.rst create mode 100644 doc/en/announce/release-8.4.2.rst diff --git a/changelog/13478.bugfix.rst b/changelog/13478.bugfix.rst deleted file mode 100644 index 1147ee54c9e..00000000000 --- a/changelog/13478.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a crash when using :confval:`console_output_style` with ``times`` and a module is skipped. diff --git a/changelog/13480.contrib.rst b/changelog/13480.contrib.rst deleted file mode 100644 index 9079c6f6b5a..00000000000 --- a/changelog/13480.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Self-testing: fixed a few test failures when run with ``-Wdefault`` or a similar override. diff --git a/changelog/13530.bugfix.rst b/changelog/13530.bugfix.rst deleted file mode 100644 index 1a5ab365f12..00000000000 --- a/changelog/13530.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a crash when using :func:`pytest.approx` and :class:`decimal.Decimal` instances with the :class:`decimal.FloatOperation` trap set. diff --git a/changelog/13547.contrib.rst b/changelog/13547.contrib.rst deleted file mode 100644 index d8a240c0506..00000000000 --- a/changelog/13547.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Self-testing: corrected expected message for ``test_doctest_unexpected_exception`` in Python ``3.14``. diff --git a/changelog/13549.bugfix.rst b/changelog/13549.bugfix.rst deleted file mode 100644 index e69f6a4d6cf..00000000000 --- a/changelog/13549.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -No longer evaluate type annotations in Python ``3.14`` when inspecting function signatures. - -This prevents crashes during module collection when modules do not explicitly use ``from __future__ import annotations`` and import types for annotations within a ``if TYPE_CHECKING:`` block. diff --git a/changelog/13559.bugfix.rst b/changelog/13559.bugfix.rst deleted file mode 100644 index 69036f784ac..00000000000 --- a/changelog/13559.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Added missing `int` and `float` variants to the `Literal` type annotation of the `type` parameter in :meth:`pytest.Parser.addini`. diff --git a/changelog/13563.bugfix.rst b/changelog/13563.bugfix.rst deleted file mode 100644 index 543552e20cf..00000000000 --- a/changelog/13563.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -:func:`pytest.approx` now only imports ``numpy`` if NumPy is already in ``sys.modules``. This fixes unconditional import behavior introduced in `8.4.0`. diff --git a/changelog/13577.doc.rst b/changelog/13577.doc.rst deleted file mode 100644 index 8d6db9ea983..00000000000 --- a/changelog/13577.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Clarify that ``pytest_generate_tests`` is discovered in test modules/classes; other hooks must be in ``conftest.py`` or plugins. diff --git a/changelog/13684.contrib.rst b/changelog/13684.contrib.rst deleted file mode 100644 index bb2f87f1710..00000000000 --- a/changelog/13684.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Make pytest's own testsuite insensitive to the presence of the ``CI`` environment variable -- by :user:`ogrisel`. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 2ed23eb1fbb..1cc8fbaf7c0 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-8.4.2 release-8.4.1 release-8.4.0 release-8.3.5 diff --git a/doc/en/announce/release-8.4.2.rst b/doc/en/announce/release-8.4.2.rst new file mode 100644 index 00000000000..58a842c4d4b --- /dev/null +++ b/doc/en/announce/release-8.4.2.rst @@ -0,0 +1,27 @@ +pytest-8.4.2 +======================================= + +pytest 8.4.2 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* AD +* Aditi De +* Bruno Oliveira +* Florian Bruhin +* John Litborn +* Liam DeVoe +* Marc Mueller +* NayeemJohn +* Olivier Grisel +* Ran Benita +* bengartner +* 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 31c2fa9df06..ca350c5f3dd 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -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:1424 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1425 Session-scoped fixture that returns the session's :class:`pytest.Config` object. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 63623de8aad..89f1c4e61b3 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -31,6 +31,49 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 8.4.2 (2025-09-03) +========================= + +Bug fixes +--------- + +- `#13478 `_: Fixed a crash when using :confval:`console_output_style` with ``times`` and a module is skipped. + + +- `#13530 `_: Fixed a crash when using :func:`pytest.approx` and :class:`decimal.Decimal` instances with the :class:`decimal.FloatOperation` trap set. + + +- `#13549 `_: No longer evaluate type annotations in Python ``3.14`` when inspecting function signatures. + + This prevents crashes during module collection when modules do not explicitly use ``from __future__ import annotations`` and import types for annotations within a ``if TYPE_CHECKING:`` block. + + +- `#13559 `_: Added missing `int` and `float` variants to the `Literal` type annotation of the `type` parameter in :meth:`pytest.Parser.addini`. + + +- `#13563 `_: :func:`pytest.approx` now only imports ``numpy`` if NumPy is already in ``sys.modules``. This fixes unconditional import behavior introduced in `8.4.0`. + + + +Improved documentation +---------------------- + +- `#13577 `_: Clarify that ``pytest_generate_tests`` is discovered in test modules/classes; other hooks must be in ``conftest.py`` or plugins. + + + +Contributor-facing changes +-------------------------- + +- `#13480 `_: Self-testing: fixed a few test failures when run with ``-Wdefault`` or a similar override. + + +- `#13547 `_: Self-testing: corrected expected message for ``test_doctest_unexpected_exception`` in Python ``3.14``. + + +- `#13684 `_: Make pytest's own testsuite insensitive to the presence of the ``CI`` environment variable -- by :user:`ogrisel`. + + pytest 8.4.1 (2025-06-17) ========================= diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 8e6479254bb..6374e0edb3d 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 - + diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 01a8f48fdbf..2487e7b9d19 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -152,7 +152,7 @@ The test collection would look like this: configfile: pytest.ini collected 2 items - + @@ -215,7 +215,7 @@ You can always peek at the collection tree without running tests like this: configfile: pytest.ini collected 3 items - + diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index c5e9f708828..349711faaf4 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 8.4.1 + pytest 8.4.2 .. _`simpletest`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 62ace745d43..7f1a7610bb8 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 - + From a336f6de4bde461814e84aa56fbdc1255acfea98 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 22:35:10 -0300 Subject: [PATCH 090/270] [automated] Update plugin list (#13703) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 130 +++++++++++++++++++------------ 1 file changed, 81 insertions(+), 49 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index e5fcefcb42c..b382ac0a8cf 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =4.0.0 @@ -318,7 +319,7 @@ This list contains 1704 plugins. :pypi:`pytest-copier` A pytest plugin to help testing Copier templates Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A - :pypi:`pytest-cov` Pytest plugin for measuring coverage. Jun 12, 2025 5 - Production/Stable pytest>=6.2.5 + :pypi:`pytest-cov` Pytest plugin for measuring coverage. Sep 06, 2025 5 - Production/Stable pytest>=6.2.5 :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jun 28, 2023 4 - Beta N/A @@ -383,9 +384,10 @@ This list contains 1704 plugins. :pypi:`pytest-dc` Manages Docker containers during your integration tests Aug 16, 2023 5 - Production/Stable pytest >=3.3 :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A :pypi:`pytest-deduplicate` Identifies duplicate unit tests Aug 12, 2023 4 - Beta pytest + :pypi:`pytest-deepassert` A pytest plugin for enhanced assertion reporting with detailed diffs Sep 02, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A :pypi:`pytest_defer` A 'defer' fixture for pytest Nov 13, 2024 N/A pytest>=8.3 - :pypi:`pytest-delta` Run only tests impacted by your code changes (delta-based selection) for pytest. Aug 29, 2025 N/A pytest>=7.0 + :pypi:`pytest-delta` Run only tests impacted by your code changes (delta-based selection) for pytest. Sep 01, 2025 N/A pytest>=7.0 :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A :pypi:`pytest-dependency` Manage dependencies of tests Dec 31, 2023 4 - Beta N/A :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) @@ -395,7 +397,7 @@ This list contains 1704 plugins. :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest :pypi:`pytest-deselect-if` A plugin to deselect pytests tests rather than using skipif Dec 26, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-devpi-server` DevPI server fixture for py.test Oct 17, 2024 5 - Production/Stable pytest - :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Aug 20, 2025 N/A pytest + :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Sep 05, 2025 N/A pytest :pypi:`pytest-dhos` Common fixtures for pytest in DHOS services and libraries Sep 07, 2022 N/A N/A :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest @@ -475,6 +477,7 @@ This list contains 1704 plugins. :pypi:`pytest-dpg` pytest-dpg is a pytest plugin for testing Dear PyGui (DPG) applications Aug 13, 2024 N/A N/A :pypi:`pytest-draw` Pytest plugin for randomly selecting a specific number of tests Mar 21, 2023 3 - Alpha pytest :pypi:`pytest-drf` A Django REST framework plugin for pytest. Jul 12, 2022 5 - Production/Stable pytest (>=3.7) + :pypi:`pytest-drill-sergeant` A pytest plugin that enforces test quality standards through automatic marker detection and AAA structure validation Sep 02, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A @@ -669,7 +672,7 @@ This list contains 1704 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 22, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Sep 04, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -683,7 +686,7 @@ This list contains 1704 plugins. :pypi:`pytest-gitlabci-parallelized` Parallelize pytest across GitLab CI workers. Mar 08, 2023 N/A N/A :pypi:`pytest-gitlab-code-quality` Collects warnings while testing and generates a GitLab Code Quality Report. Sep 09, 2024 N/A pytest>=8.1.1 :pypi:`pytest-gitlab-fold` Folds output sections in GitLab CI build log Dec 31, 2023 4 - Beta pytest >=2.6.0 - :pypi:`pytest-gitscope` A pragmatic pytest plugin that runs only the tests that matter, and ship faster Aug 21, 2025 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-gitscope` A pragmatic pytest plugin that runs only the tests that matter, and ship faster Sep 05, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 20, 2025 4 - Beta pytest<=8.4.1 :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest @@ -719,7 +722,7 @@ This list contains 1704 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 30, 2025 3 - Alpha pytest==8.4.1 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 06, 2025 3 - Alpha pytest==8.4.1 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -733,7 +736,7 @@ This list contains 1704 plugins. :pypi:`pytest-html-cn` pytest plugin for generating HTML reports Aug 19, 2024 5 - Production/Stable pytest!=6.0.0,>=5.0 :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A - :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Jun 05, 2025 N/A N/A + :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Sep 05, 2025 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 17, 2024 5 - Production/Stable N/A :pypi:`pytest-html-plus` Plugin for Auto-generated pytest single file HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config even with xdist Aug 23, 2025 N/A N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) @@ -762,7 +765,7 @@ This list contains 1704 plugins. :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jul 25, 2025 4 - Beta pytest>=7.0.0 - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Feb 06, 2025 4 - Beta pytest>=7.1 + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Sep 03, 2025 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Dec 05, 2023 4 - Beta pytest :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Dec 13, 2023 5 - Production/Stable N/A @@ -780,7 +783,7 @@ This list contains 1704 plugins. :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A :pypi:`pytest-info-plugin` Get executed interface information in pytest interface automation framework Sep 14, 2023 N/A N/A :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A - :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Aug 21, 2025 4 - Beta pytest~=8.3 + :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Sep 06, 2025 4 - Beta pytest~=8.3 :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-initry` Plugin for sending automation test data from Pytest to the initry Apr 30, 2024 N/A pytest<9.0.0,>=8.1.1 @@ -835,7 +838,7 @@ This list contains 1704 plugins. :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-json-report-wip` A pytest plugin to report test results as JSON files Jul 23, 2025 4 - Beta pytest >=3.8.0 :pypi:`pytest-jsonschema` A pytest plugin to perform JSONSchema validations Apr 20, 2025 4 - Beta pytest>=6.2.0 - :pypi:`pytest-jsonschema-snapshot` Pytest plugin for automatic JSON Schema generation and validation from examples Aug 26, 2025 N/A pytest + :pypi:`pytest-jsonschema-snapshot` Pytest plugin for automatic JSON Schema generation and validation from examples Sep 02, 2025 N/A pytest :pypi:`pytest-jtr` pytest plugin supporting json test report output Jul 21, 2024 N/A pytest<8.0.0,>=7.1.2 :pypi:`pytest-jubilant` Add your description here Jul 28, 2025 N/A pytest>=8.3.5 :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest @@ -945,7 +948,7 @@ This list contains 1704 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Aug 18, 2025 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Aug 20, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Sep 04, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -967,7 +970,7 @@ This list contains 1704 plugins. :pypi:`pytest-mitmproxy-plugin` Use MITM Proxy in autotests with full control from code Apr 10, 2025 4 - Beta pytest>=7.2.0 :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest May 26, 2025 5 - Production/Stable pytest>=6.2.5 + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Sep 04, 2025 5 - Production/Stable pytest>=6.2.5 :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest @@ -1019,7 +1022,7 @@ This list contains 1704 plugins. :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) :pypi:`pytest-neos` Pytest plugin for neos Sep 10, 2024 5 - Production/Stable pytest<8.0,>=7.2; extra == "dev" :pypi:`pytest-netconf` A pytest plugin that provides a mock NETCONF (RFC6241/RFC6242) server for local testing. Jan 06, 2025 N/A N/A - :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Apr 11, 2025 N/A pytest>=3.5.0 + :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Sep 01, 2025 N/A pytest>=3.5.0 :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) @@ -1138,11 +1141,11 @@ This list contains 1704 plugins. :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Jul 02, 2025 N/A N/A - :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Aug 10, 2025 3 - Alpha pytest + :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Sep 05, 2025 3 - Alpha pytest :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 21, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 31, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1257,7 +1260,7 @@ This list contains 1704 plugins. :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A :pypi:`pytest-regex` Select pytest tests with regular expressions May 29, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Aug 13, 2025 5 - Production/Stable pytest>=6.2.0 + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Sep 05, 2025 5 - Production/Stable pytest>=6.2.0 :pypi:`pytest-regtest` pytest plugin for snapshot regression testing Jul 21, 2025 N/A pytest>7.2 :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relative-path` Handle relative path in pytest options or ini configs Aug 30, 2024 N/A pytest @@ -1298,7 +1301,7 @@ This list contains 1704 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerun-all` Rerun testsuite for a certain time or iterations Jul 30, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-rerunclassfailures` pytest rerun class failures plugin Apr 24, 2024 5 - Production/Stable pytest>=7.2 - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Aug 29, 2025 5 - Production/Stable pytest!=8.2.2,>=7.4 + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 02, 2025 5 - Production/Stable pytest!=8.2.2,>=7.4 :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Dec 22, 2024 4 - Beta pytest :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Jul 29, 2025 N/A pytest~=7.0 @@ -1361,9 +1364,9 @@ This list contains 1704 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 29, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 04, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A - :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. May 21, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. Sep 03, 2025 5 - Production/Stable pytest<9,>=7.4 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Feb 16, 2024 5 - Production/Stable pytest >=3.5.0 :pypi:`pytest-scim2-server` SCIM2 server fixture for Pytest May 14, 2025 4 - Beta pytest>=8.3.4 @@ -1373,7 +1376,7 @@ This list contains 1704 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 29, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 04, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1428,6 +1431,7 @@ This list contains 1704 plugins. :pypi:`pytest-smtp-test-server` pytest plugin for using \`smtp-test-server\` as a fixture Dec 03, 2023 2 - Pre-Alpha pytest (>=7.4.3,<8.0.0) :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snap` A text-based snapshot testing library implemented as a pytest plugin Aug 25, 2025 N/A pytest>=8.0.0 + :pypi:`pytest-snapcheck` Minimal deterministic test-run snapshot capture for pytest. Sep 07, 2025 N/A pytest>=8.0 :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A :pypi:`pytest-snapmock` Snapshots for your mocks. Nov 15, 2024 N/A N/A :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) @@ -1590,7 +1594,7 @@ This list contains 1704 plugins. :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Dec 08, 2023 N/A pytest :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 29, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A - :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Apr 22, 2023 4 - Beta N/A + :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Sep 01, 2025 4 - Beta N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A @@ -1715,7 +1719,7 @@ This list contains 1704 plugins. :pypi:`pytest-xvirt` A pytest plugin to virtualize test. For example to transparently running them on a remote box. Dec 15, 2024 4 - Beta pytest>=7.2.2 :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yaml-fei` a pytest yaml allure package Aug 03, 2025 N/A pytest - :pypi:`pytest-yaml-sanmu` Pytest plugin for generating test cases with YAML. In test cases, you can use markers, fixtures, variables, and even call Python functions. Jan 03, 2025 N/A pytest>=8.2.2 + :pypi:`pytest-yaml-sanmu` Pytest plugin for generating test cases with YAML. In test cases, you can use markers, fixtures, variables, and even call Python functions. Aug 31, 2025 N/A pytest>=8.2.2 :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A :pypi:`pytest-yaml-yoyo` http/https API run by yaml Jun 19, 2023 N/A pytest (>=7.2.0) @@ -2703,7 +2707,7 @@ This list contains 1704 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Aug 26, 2025, + *last release*: Sep 03, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -2835,6 +2839,13 @@ This list contains 1704 plugins. pytest plugin to mark a test as blocker and skip all other tests + :pypi:`pytest-b-logger` + *last release*: Sep 06, 2025, + *status*: N/A, + *requires*: pytest + + BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. + :pypi:`pytest-blue` *last release*: Sep 05, 2022, *status*: N/A, @@ -3732,7 +3743,7 @@ This list contains 1704 plugins. count erros and send email :pypi:`pytest-cov` - *last release*: Jun 12, 2025, + *last release*: Sep 06, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6.2.5 @@ -4186,6 +4197,13 @@ This list contains 1704 plugins. Identifies duplicate unit tests + :pypi:`pytest-deepassert` + *last release*: Sep 02, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=7.0.0 + + A pytest plugin for enhanced assertion reporting with detailed diffs + :pypi:`pytest-deepcov` *last release*: Mar 30, 2021, *status*: N/A, @@ -4201,7 +4219,7 @@ This list contains 1704 plugins. A 'defer' fixture for pytest :pypi:`pytest-delta` - *last release*: Aug 29, 2025, + *last release*: Sep 01, 2025, *status*: N/A, *requires*: pytest>=7.0 @@ -4271,7 +4289,7 @@ This list contains 1704 plugins. DevPI server fixture for py.test :pypi:`pytest-dfm` - *last release*: Aug 20, 2025, + *last release*: Sep 05, 2025, *status*: N/A, *requires*: pytest @@ -4830,6 +4848,13 @@ This list contains 1704 plugins. A Django REST framework plugin for pytest. + :pypi:`pytest-drill-sergeant` + *last release*: Sep 02, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0.0 + + A pytest plugin that enforces test quality standards through automatic marker detection and AAA structure validation + :pypi:`pytest-drivings` *last release*: Jan 13, 2021, *status*: N/A, @@ -6189,7 +6214,7 @@ This list contains 1704 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Aug 22, 2025, + *last release*: Sep 04, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6287,7 +6312,7 @@ This list contains 1704 plugins. Folds output sections in GitLab CI build log :pypi:`pytest-gitscope` - *last release*: Aug 21, 2025, + *last release*: Sep 05, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0.0 @@ -6539,7 +6564,7 @@ This list contains 1704 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 30, 2025, + *last release*: Sep 06, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.1 @@ -6637,7 +6662,7 @@ This list contains 1704 plugins. Pytest HTML reports merging utility :pypi:`pytest-html-nova-act` - *last release*: Jun 05, 2025, + *last release*: Sep 05, 2025, *status*: N/A, *requires*: N/A @@ -6840,9 +6865,9 @@ This list contains 1704 plugins. A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite :pypi:`pytest-ibutsu` - *last release*: Feb 06, 2025, + *last release*: Sep 03, 2025, *status*: 4 - Beta, - *requires*: pytest>=7.1 + *requires*: pytest A plugin to sent pytest results to an Ibutsu server @@ -6966,7 +6991,7 @@ This list contains 1704 plugins. display more node ininformation. :pypi:`pytest-infrahouse` - *last release*: Aug 21, 2025, + *last release*: Sep 06, 2025, *status*: 4 - Beta, *requires*: pytest~=8.3 @@ -7351,7 +7376,7 @@ This list contains 1704 plugins. A pytest plugin to perform JSONSchema validations :pypi:`pytest-jsonschema-snapshot` - *last release*: Aug 26, 2025, + *last release*: Sep 02, 2025, *status*: N/A, *requires*: pytest @@ -8121,7 +8146,7 @@ This list contains 1704 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Aug 20, 2025, + *last release*: Sep 04, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8275,7 +8300,7 @@ This list contains 1704 plugins. pytest plugin to display test execution output like a mochajs :pypi:`pytest-mock` - *last release*: May 26, 2025, + *last release*: Sep 04, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6.2.5 @@ -8639,7 +8664,7 @@ This list contains 1704 plugins. A pytest plugin that provides a mock NETCONF (RFC6241/RFC6242) server for local testing. :pypi:`pytest-netdut` - *last release*: Apr 11, 2025, + *last release*: Sep 01, 2025, *status*: N/A, *requires*: pytest>=3.5.0 @@ -9472,7 +9497,7 @@ This list contains 1704 plugins. Easy pytest visual regression testing using playwright :pypi:`pytest-pl-grader` - *last release*: Aug 10, 2025, + *last release*: Sep 05, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -9500,7 +9525,7 @@ This list contains 1704 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Aug 21, 2025, + *last release*: Aug 31, 2025, *status*: N/A, *requires*: pytest @@ -10305,7 +10330,7 @@ This list contains 1704 plugins. Management of Pytest dependencies via regex patterns :pypi:`pytest-regressions` - *last release*: Aug 13, 2025, + *last release*: Sep 05, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6.2.0 @@ -10592,7 +10617,7 @@ This list contains 1704 plugins. pytest rerun class failures plugin :pypi:`pytest-rerunfailures` - *last release*: Aug 29, 2025, + *last release*: Sep 02, 2025, *status*: 5 - Production/Stable, *requires*: pytest!=8.2.2,>=7.4 @@ -11033,7 +11058,7 @@ This list contains 1704 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Aug 29, 2025, + *last release*: Sep 04, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11047,9 +11072,9 @@ This list contains 1704 plugins. pytest plugin for test scenarios :pypi:`pytest-scenario-files` - *last release*: May 21, 2025, + *last release*: Sep 03, 2025, *status*: 5 - Production/Stable, - *requires*: pytest>=7.0 + *requires*: pytest<9,>=7.4 A pytest plugin that generates unit test scenarios from data files. @@ -11117,7 +11142,7 @@ This list contains 1704 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Aug 29, 2025, + *last release*: Sep 04, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11501,6 +11526,13 @@ This list contains 1704 plugins. A text-based snapshot testing library implemented as a pytest plugin + :pypi:`pytest-snapcheck` + *last release*: Sep 07, 2025, + *status*: N/A, + *requires*: pytest>=8.0 + + Minimal deterministic test-run snapshot capture for pytest. + :pypi:`pytest-snapci` *last release*: Nov 12, 2015, *status*: N/A, @@ -12636,7 +12668,7 @@ This list contains 1704 plugins. this is a vue-element ui report for pytest :pypi:`pytest-tmux` - *last release*: Apr 22, 2023, + *last release*: Sep 01, 2025, *status*: 4 - Beta, *requires*: N/A @@ -13511,7 +13543,7 @@ This list contains 1704 plugins. a pytest yaml allure package :pypi:`pytest-yaml-sanmu` - *last release*: Jan 03, 2025, + *last release*: Aug 31, 2025, *status*: N/A, *requires*: pytest>=8.2.2 From cb26dfdf00ed5c23246b8c9a32f4dd50f50280b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 06:20:33 +0200 Subject: [PATCH 091/270] build(deps): Bump actions/setup-python from 5 to 6 (#13710) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy.yml | 2 +- .github/workflows/doc-check-links.yml | 2 +- .github/workflows/prepare-release-pr.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/update-plugin-list.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3cc17319a1e..1715c595ab1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -92,7 +92,7 @@ jobs: path: dist - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" diff --git a/.github/workflows/doc-check-links.yml b/.github/workflows/doc-check-links.yml index fd324618d08..bf88c2b3c6c 100644 --- a/.github/workflows/doc-check-links.yml +++ b/.github/workflows/doc-check-links.yml @@ -23,7 +23,7 @@ jobs: persist-credentials: false - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" cache: pip diff --git a/.github/workflows/prepare-release-pr.yml b/.github/workflows/prepare-release-pr.yml index ff8dc008f06..e46a307d0ef 100644 --- a/.github/workflows/prepare-release-pr.yml +++ b/.github/workflows/prepare-release-pr.yml @@ -34,7 +34,7 @@ jobs: persist-credentials: true - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.x" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cf6a6dfbd5..ff940ef5de0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -292,7 +292,7 @@ jobs: path: dist - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} check-latest: true diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index e8119acecdc..aca22a6dd95 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -26,7 +26,7 @@ jobs: persist-credentials: false - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" cache: pip From 18e0a1828f7b58e49c6cf40a7dbc0bc02b92645d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 06:21:11 +0200 Subject: [PATCH 092/270] build(deps): Bump actions/stale from 9 to 10 (#13709) Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v9...v10) --- updated-dependencies: - dependency-name: actions/stale dependency-version: '10' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 82f9a1f2579..aeac36cea60 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -10,7 +10,7 @@ jobs: permissions: issues: write steps: - - uses: actions/stale@v9 + - uses: actions/stale@v10 with: debug-only: false days-before-issue-stale: 14 From a24a1ebd5d29c851fa809fa7f7e1d450a1817c0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 06:22:24 +0200 Subject: [PATCH 093/270] build(deps): Bump pytest-cov in /testing/plugins_integration (#13707) Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.2.1 to 6.3.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.2.1...v6.3.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 00eff273457..d188e50a357 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -2,7 +2,7 @@ anyio[trio]==4.10.0 django==5.2.1 pytest-asyncio==1.1.0 pytest-bdd==8.1.0 -pytest-cov==6.2.1 +pytest-cov==6.3.0 pytest-django==4.11.1 pytest-flakes==4.0.5 pytest-html==4.1.1 From 5096a8cbe1825878034f0e816c95ed6112edc297 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 06:22:54 +0200 Subject: [PATCH 094/270] build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#13706) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 16.0 to 16.0.1. - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/16.0...16.0.1) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-version: 16.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index d188e50a357..f6feefe6f4c 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -7,7 +7,7 @@ pytest-django==4.11.1 pytest-flakes==4.0.5 pytest-html==4.1.1 pytest-mock==3.14.1 -pytest-rerunfailures==16.0 +pytest-rerunfailures==16.0.1 pytest-sugar==1.1.1 pytest-trio==0.8.0 pytest-twisted==1.14.3 From f24a40859f52d48c9b6ef8a8c77db6cfba25165b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 04:45:59 +0000 Subject: [PATCH 095/270] build(deps): Bump pytest-mock in /testing/plugins_integration (#13705) Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.14.1 to 3.15.0. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.14.1...v3.15.0) --- updated-dependencies: - dependency-name: pytest-mock dependency-version: 3.15.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index f6feefe6f4c..fbdee7bc2ec 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==6.3.0 pytest-django==4.11.1 pytest-flakes==4.0.5 pytest-html==4.1.1 -pytest-mock==3.14.1 +pytest-mock==3.15.0 pytest-rerunfailures==16.0.1 pytest-sugar==1.1.1 pytest-trio==0.8.0 From 495a6b1a664ac93431cee3b981dfd2951248f82f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 07:59:31 -0300 Subject: [PATCH 096/270] build(deps): Bump codecov/codecov-action from 5.5.0 to 5.5.1 (#13708) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.0 to 5.5.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/fdcc8476540edceab3de004e990f80d881c6cc00...5a1091511ad55cbe89839c7260b706298ca349f7) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.5.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff940ef5de0..3b372cf94d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -319,7 +319,7 @@ jobs: - name: Upload coverage to Codecov if: "matrix.use_coverage" - uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 with: fail_ci_if_error: false files: ./coverage.xml From 2baa197e249a0d9efeef66763669fba270913145 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 07:59:43 -0300 Subject: [PATCH 097/270] build(deps): Bump pypa/gh-action-pypi-publish from 1.12.4 to 1.13.0 (#13711) Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.12.4 to 1.13.0. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/76f52bc884231f62b9a034ebfe128415bbaabdfc...ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-version: 1.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1715c595ab1..7be666f3a39 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -56,7 +56,7 @@ jobs: path: dist - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e with: attestations: true From 5ebd1ec3b67e40fbfb2711e7efef23b6f4463ee6 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 8 Sep 2025 08:15:30 -0300 Subject: [PATCH 098/270] junitxml: do not print summary with `--quiet` (#13702) Fix #13700 --- changelog/13700.improvement.rst | 1 + src/_pytest/junitxml.py | 7 +++++-- testing/test_junitxml.py | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 changelog/13700.improvement.rst diff --git a/changelog/13700.improvement.rst b/changelog/13700.improvement.rst new file mode 100644 index 00000000000..40753ae5d5f --- /dev/null +++ b/changelog/13700.improvement.rst @@ -0,0 +1 @@ +`--junitxml` no longer prints the `generated xml file` summary at the end of the pytest session when `--quiet` is given. diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index dc35e3aac15..ae8d2b94d36 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -674,8 +674,11 @@ def pytest_sessionfinish(self) -> None: testsuites.append(suite_node) logfile.write(ET.tostring(testsuites, encoding="unicode")) - def pytest_terminal_summary(self, terminalreporter: TerminalReporter) -> None: - terminalreporter.write_sep("-", f"generated xml file: {self.logfile}") + def pytest_terminal_summary( + self, terminalreporter: TerminalReporter, config: pytest.Config + ) -> None: + if config.get_verbosity() >= 0: + terminalreporter.write_sep("-", f"generated xml file: {self.logfile}") def add_global_property(self, name: str, value: object) -> None: __tracebackhide__ = True diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 4b634a98d85..9f18a90d100 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -1822,3 +1822,13 @@ def test_func(): assert junit_logging == "no" assert len(node.find_by_tag("system-err")) == 0 assert len(node.find_by_tag("system-out")) == 0 + + +def test_no_message_quiet(pytester: Pytester) -> None: + """Do not show the summary banner when --quiet is given (#13700).""" + pytester.makepyfile("def test(): pass") + result = pytester.runpytest("--junitxml=pytest.xml") + result.stdout.fnmatch_lines("* generated xml file: *") + + result = pytester.runpytest("--junitxml=pytest.xml", "--quiet") + result.stdout.no_fnmatch_line("* generated xml file: *") From 41ffbef9df0883e7e06312e5eac39f0b3e2afacb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 06:33:03 +0200 Subject: [PATCH 099/270] [pre-commit.ci] pre-commit autoupdate (#13714) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.11 → v0.12.12](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.11...v0.12.12) - [github.com/adamchainz/blacken-docs: 1.19.1 → 1.20.0](https://github.com/adamchainz/blacken-docs/compare/1.19.1...1.20.0) - [github.com/RobertCraigie/pyright-python: v1.1.404 → v1.1.405](https://github.com/RobertCraigie/pyright-python/compare/v1.1.404...v1.1.405) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c8fcdd9180b..b17b032dce2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.11" + rev: "v0.12.12" hooks: - id: ruff args: ["--fix"] @@ -16,7 +16,7 @@ repos: hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs - rev: 1.19.1 + rev: 1.20.0 hooks: - id: blacken-docs additional_dependencies: [black==24.1.1] @@ -48,7 +48,7 @@ repos: # on <3.11 - exceptiongroup>=1.0.0rc8 - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.404 + rev: v1.1.405 hooks: - id: pyright files: ^(src/|scripts/) From 6ab228b54bcc7750a39a84907bc52f8037319c6f Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Tue, 9 Sep 2025 14:03:59 +0200 Subject: [PATCH 100/270] Flush stdout and stderr in pytester.run (#13695) Attempted to make `test_faulthandler.py::test_timeout` more reliable on CI, but ultimately this was not accomplished. However, it seems flushing `stdout` and `stderr` during `pytester.run` seems the right thing to do, so it was decided to leave the calls and only skip the test in more specific scenarios that were failing frequently on CI (see #13695 for discussion history). We should extend the skip list as needed. Follow-up on #13684. Partially addresses #7022. --- changelog/13695.contrib.rst | 1 + src/_pytest/pytester.py | 3 ++- testing/test_faulthandler.py | 9 ++++++++- testing/test_terminal.py | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 changelog/13695.contrib.rst diff --git a/changelog/13695.contrib.rst b/changelog/13695.contrib.rst new file mode 100644 index 00000000000..675e1fc96a0 --- /dev/null +++ b/changelog/13695.contrib.rst @@ -0,0 +1 @@ +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/src/_pytest/pytester.py b/src/_pytest/pytester.py index de4e2c8b136..d5b67abdaee 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1422,7 +1422,6 @@ def run( stdin=stdin, stdout=f1, stderr=f2, - close_fds=(sys.platform != "win32"), ) if popen.stdin is not None: popen.stdin.close() @@ -1443,6 +1442,8 @@ def handle_timeout() -> None: ret = popen.wait(timeout) except subprocess.TimeoutExpired: handle_timeout() + f1.flush() + f2.flush() with p1.open(encoding="utf8") as f1, p2.open(encoding="utf8") as f2: out = f1.read().splitlines() diff --git a/testing/test_faulthandler.py b/testing/test_faulthandler.py index d89cb274b78..b308e89adbd 100644 --- a/testing/test_faulthandler.py +++ b/testing/test_faulthandler.py @@ -2,6 +2,7 @@ from __future__ import annotations import io +import os import sys from _pytest.pytester import Pytester @@ -76,7 +77,13 @@ def test_disabled(): "enabled", [ pytest.param( - True, marks=pytest.mark.skip(reason="sometimes crashes on CI (#7022)") + True, + marks=pytest.mark.skipif( + "CI" in os.environ + and sys.platform == "linux" + and sys.version_info >= (3, 14), + reason="sometimes crashes on CI because of truncated outputs (#7022)", + ), ), False, ], diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 8c50311e9aa..2a3f4446a11 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -2250,8 +2250,8 @@ def test_times_multiline( output.stdout.re_match_lines( [ r"test_bar.py ...................", - r"........... \s+ \d{1,3}[\.[a-z\ ]{1,2}\d{0,3}\w{1,2}$", - r"test_foo.py \.{5} \s+ \d{1,3}[\.[a-z\ ]{1,2}\d{0,3}\w{1,2}$", + r"........... \s+ \d{1,4}[\.[a-z\ ]{1,2}\d{0,3}\w{1,2}$", + r"test_foo.py \.{5} \s+ \d{1,4}[\.[a-z\ ]{1,2}\d{0,3}\w{1,2}$", ], consecutive=True, ) From bcd4f9ba6857d9f7e8879c1eccfb024a2e3ecac7 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 10 Sep 2025 09:59:37 +0300 Subject: [PATCH 101/270] main: reject arguments like `pytest x.py[1]` instead of ignoring the `[]` Fix #13716. --- changelog/13716.bugfix.rst | 1 + src/_pytest/main.py | 6 ++++-- testing/test_main.py | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 changelog/13716.bugfix.rst diff --git a/changelog/13716.bugfix.rst b/changelog/13716.bugfix.rst new file mode 100644 index 00000000000..5eeef4b7624 --- /dev/null +++ b/changelog/13716.bugfix.rst @@ -0,0 +1 @@ +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/src/_pytest/main.py b/src/_pytest/main.py index 6e35c887814..b1eb22f1f61 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -1066,9 +1066,11 @@ def resolve_collection_argument( If the path doesn't exist, raise UsageError. If the path is a directory and selection parts are present, raise UsageError. """ - base, squacket, rest = str(arg).partition("[") + base, squacket, rest = arg.partition("[") strpath, *parts = base.split("::") - if parts: + if squacket: + if not parts: + raise UsageError(f"path cannot contain [] parametrization: {arg}") parts[-1] = f"{parts[-1]}{squacket}{rest}" module_name = None if as_pypath: diff --git a/testing/test_main.py b/testing/test_main.py index 4a5591bb361..3f173ec4e9f 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -220,6 +220,20 @@ def test_parametrized_name_with_colons(self, invocation_path: Path) -> None: module_name=None, ) + @pytest.mark.parametrize( + "arg", ["x.py[a]", "x.py[a]::foo", "x/y.py[a]::foo::bar", "x.py[a]::foo[b]"] + ) + def test_path_parametrization_not_allowed( + self, invocation_path: Path, arg: str + ) -> None: + with pytest.raises( + UsageError, match=r"path cannot contain \[\] parametrization" + ): + resolve_collection_argument( + invocation_path, + arg, + ) + def test_does_not_exist(self, invocation_path: Path) -> None: """Given a file/module that does not exist raises UsageError.""" with pytest.raises( From 1efe0db4d1bfb6f8bf1a6656b5ed72a98d6e3a63 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 11 Sep 2025 21:48:23 +0300 Subject: [PATCH 102/270] main: put parametrization in a separate field on CollectionArgument This is for the benefit of the next commit. That commit wants to check whether a CollectionArgument is subsumed by another. According to pytest semantics: `test_it.py::TestIt::test_it[a]` subsumed by `test_it.py::TestIt::test_it` However the `parts` are ["TestIt", test_it[a]"] ["TestIt", test_it"] which means a simple list prefix cannot be used. By splitting the parametrization `"[a]"` part to its own attribute, it can be handled cleanly. I also think this is a reasonable change regardless. We'd probably want something like this when the "collection structure contains parametrization" TODO is tackled. --- src/_pytest/main.py | 31 ++++++++++++++++++++----------- testing/test_main.py | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index b1eb22f1f61..0276313b365 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -859,6 +859,7 @@ def collect(self) -> Iterator[nodes.Item | nodes.Collector]: argpath = collection_argument.path names = collection_argument.parts + parametrization = collection_argument.parametrization module_name = collection_argument.module_name # resolve_collection_argument() ensures this. @@ -943,12 +944,18 @@ def collect(self) -> Iterator[nodes.Item | nodes.Collector]: # Name part e.g. `TestIt` in `/a/b/test_file.py::TestIt::test_it`. else: - # TODO: Remove parametrized workaround once collection structure contains - # parametrization. - is_match = ( - node.name == matchparts[0] - or node.name.split("[")[0] == matchparts[0] - ) + if len(matchparts) == 1: + # This the last part, one parametrization goes. + if parametrization is not None: + # A parametrized arg must match exactly. + is_match = node.name == matchparts[0] + parametrization + else: + # A non-parameterized arg matches all parametrizations (if any). + # TODO: Remove the hacky split once the collection structure + # contains parametrization. + is_match = node.name.split("[")[0] == matchparts[0] + else: + is_match = node.name == matchparts[0] if is_match: work.append((node, matchparts[1:])) any_matched_in_collector = True @@ -1024,6 +1031,7 @@ class CollectionArgument: path: Path parts: Sequence[str] + parametrization: str | None module_name: str | None @@ -1052,7 +1060,7 @@ def resolve_collection_argument( When as_pypath is True, expects that the command-line argument actually contains module paths instead of file-system paths: - "pkg.tests.test_foo::TestClass::test_foo" + "pkg.tests.test_foo::TestClass::test_foo[a,b]" In which case we search sys.path for a matching module, and then return the *path* to the found module, which may look like this: @@ -1060,6 +1068,7 @@ def resolve_collection_argument( CollectionArgument( path=Path("/home/u/myvenv/lib/site-packages/pkg/tests/test_foo.py"), parts=["TestClass", "test_foo"], + parametrization="[a,b]", module_name="pkg.tests.test_foo", ) @@ -1068,10 +1077,9 @@ def resolve_collection_argument( """ base, squacket, rest = arg.partition("[") strpath, *parts = base.split("::") - if squacket: - if not parts: - raise UsageError(f"path cannot contain [] parametrization: {arg}") - parts[-1] = f"{parts[-1]}{squacket}{rest}" + if squacket and not parts: + raise UsageError(f"path cannot contain [] parametrization: {arg}") + parametrization = f"{squacket}{rest}" if squacket else None module_name = None if as_pypath: pyarg_strpath = search_pypath( @@ -1099,5 +1107,6 @@ def resolve_collection_argument( return CollectionArgument( path=fspath, parts=parts, + parametrization=parametrization, module_name=module_name, ) diff --git a/testing/test_main.py b/testing/test_main.py index 3f173ec4e9f..37b887b0c66 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -125,6 +125,7 @@ def test_file(self, invocation_path: Path) -> None: ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=[], + parametrization=None, module_name=None, ) assert resolve_collection_argument( @@ -132,6 +133,7 @@ def test_file(self, invocation_path: Path) -> None: ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=[""], + parametrization=None, module_name=None, ) assert resolve_collection_argument( @@ -139,6 +141,7 @@ def test_file(self, invocation_path: Path) -> None: ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=["foo", "bar"], + parametrization=None, module_name=None, ) assert resolve_collection_argument( @@ -146,6 +149,15 @@ def test_file(self, invocation_path: Path) -> None: ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=["foo", "bar", ""], + parametrization=None, + module_name=None, + ) + assert resolve_collection_argument( + invocation_path, "src/pkg/test.py::foo::bar[a,b,c]" + ) == CollectionArgument( + path=invocation_path / "src/pkg/test.py", + parts=["foo", "bar"], + parametrization="[a,b,c]", module_name=None, ) @@ -156,6 +168,7 @@ def test_dir(self, invocation_path: Path) -> None: ) == CollectionArgument( path=invocation_path / "src/pkg", parts=[], + parametrization=None, module_name=None, ) @@ -181,6 +194,7 @@ def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None: ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=[], + parametrization=None, module_name="pkg.test", ) assert resolve_collection_argument( @@ -188,6 +202,7 @@ def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None: ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=["foo", "bar"], + parametrization=None, module_name="pkg.test", ) assert resolve_collection_argument( @@ -198,6 +213,7 @@ def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None: ) == CollectionArgument( path=invocation_path / "src/pkg", parts=[], + parametrization=None, module_name="pkg", ) @@ -216,7 +232,8 @@ def test_parametrized_name_with_colons(self, invocation_path: Path) -> None: invocation_path, "src/pkg/test.py::test[a::b]" ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", - parts=["test[a::b]"], + parts=["test"], + parametrization="[a::b]", module_name=None, ) @@ -257,6 +274,7 @@ def test_absolute_paths_are_resolved_correctly(self, invocation_path: Path) -> N ) == CollectionArgument( path=Path(os.path.abspath("src")), parts=[], + parametrization=None, module_name=None, ) @@ -268,6 +286,7 @@ def test_absolute_paths_are_resolved_correctly(self, invocation_path: Path) -> N ) == CollectionArgument( path=Path(os.path.abspath("src")), parts=[], + parametrization=None, module_name=None, ) From 6764439f3fb53c64f897742865f99c7b803f20ad Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 6 Sep 2025 20:25:21 +0300 Subject: [PATCH 103/270] main: add explicit handling of overlapping collection arguments Consider a pytest invocation like `pytest tests/ tests/test_it.py`. What should happen? Currently what happens is that only `tests/test_it.py` is run, which is obviously wrong. This regressed in the big package collection rework (PR #11646). The reason it regressed is the way pytest collection works. See #12083 for (some) details. I have made an attempt to fix the problem directly in the collection loop, but failed. The main challenge is the node caching, i.e. when should a collector node be reused when it is needed for several collection arguments. I believe it is possible to make it work, but it's hard. In order to not leave this embarrassing bug lingering for any longer, this instead takes an easier approach, which is to massage the collection argument list itself such that issues with overlapping nodes don't come up during collection at all. This *adds* complexity instead of simplifying things, but I hope it should be good enough in practice for now, and maybe we can revisit in the future. This change introduces behavioral changes, mainly: - `pytest a/b a/` is equivalent to `pytest a`; if there is an `a/a` then `a/b` will *not* be ordered before `a/a`. So the ability to order a subset before a superset is lost. - `pytest x.py x.py` does *not* run the file twice; previously we took an explicit request like this to mean that it should. The `--keep-duplicates` option remains as a sort of "expert mode" that retains its current behavior; though it is still subtly broken in that *collector nodes* are also duplicated (not just the items). A fix for that requires the harder change. Fix #12083. --- changelog/12083.breaking.rst | 9 + doc/en/example/pythoncollection.rst | 14 +- src/_pytest/main.py | 77 +++- testing/test_collection.py | 670 ++++++++++++++++++++++++++++ testing/test_junitxml.py | 2 +- testing/test_main.py | 49 +- testing/test_mark.py | 2 +- 7 files changed, 783 insertions(+), 40 deletions(-) create mode 100644 changelog/12083.breaking.rst diff --git a/changelog/12083.breaking.rst b/changelog/12083.breaking.rst new file mode 100644 index 00000000000..53a8393dfb4 --- /dev/null +++ b/changelog/12083.breaking.rst @@ -0,0 +1,9 @@ +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/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 2487e7b9d19..9aada00345a 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -55,6 +55,8 @@ You can run all of the tests within ``tests/`` *except* for ``tests/foobar/test_ by invoking ``pytest`` with ``--deselect tests/foobar/test_foobar_01.py::test_a``. ``pytest`` allows multiple ``--deselect`` options. +.. _duplicate-paths: + Keeping duplicate paths specified from command line ---------------------------------------------------- @@ -82,18 +84,6 @@ Example: collected 2 items ... -As the collector just works on directories, if you specify twice a single test file, ``pytest`` will -still collect it twice, no matter if the ``--keep-duplicates`` is not specified. -Example: - -.. code-block:: pytest - - pytest test_a.py test_a.py - - ... - collected 2 items - ... - Changing directory recursion ----------------------------------------------------- diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 0276313b365..893dee90e84 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -781,14 +781,25 @@ def perform_collect( try: initialpaths: list[Path] = [] initialpaths_with_parents: list[Path] = [] - for arg in args: - collection_argument = resolve_collection_argument( + + collection_args = [ + resolve_collection_argument( self.config.invocation_params.dir, arg, + i, as_pypath=self.config.option.pyargs, consider_namespace_packages=consider_namespace_packages, ) - self._initial_parts.append(collection_argument) + for i, arg in enumerate(args) + ] + + if not self.config.getoption("keepduplicates"): + # Normalize the collection arguments -- remove duplicates and overlaps. + self._initial_parts = normalize_collection_arguments(collection_args) + else: + self._initial_parts = collection_args + + for collection_argument in self._initial_parts: initialpaths.append(collection_argument.path) initialpaths_with_parents.append(collection_argument.path) initialpaths_with_parents.extend(collection_argument.path.parents) @@ -976,12 +987,9 @@ def genitems(self, node: nodes.Item | nodes.Collector) -> Iterator[nodes.Item]: yield node else: assert isinstance(node, nodes.Collector) - keepduplicates = self.config.getoption("keepduplicates") # For backward compat, dedup only applies to files. - handle_dupes = not (keepduplicates and isinstance(node, nodes.File)) + handle_dupes = not isinstance(node, nodes.File) rep, duplicate = self._collect_one_node(node, handle_dupes) - if duplicate and not keepduplicates: - return if rep.passed: for subnode in rep.result: yield from self.genitems(subnode) @@ -1033,11 +1041,13 @@ class CollectionArgument: parts: Sequence[str] parametrization: str | None module_name: str | None + original_index: int def resolve_collection_argument( invocation_path: Path, arg: str, + arg_index: int, *, as_pypath: bool = False, consider_namespace_packages: bool = False, @@ -1109,4 +1119,57 @@ def resolve_collection_argument( parts=parts, parametrization=parametrization, module_name=module_name, + original_index=arg_index, + ) + + +def is_collection_argument_subsumed_by( + arg: CollectionArgument, by: CollectionArgument +) -> bool: + """Check if `arg` is subsumed (contained) by `by`.""" + # First check path subsumption. + if by.path != arg.path: + # `by` subsumes `arg` if `by` is a parent directory of `arg` and has no + # parts (collects everything in that directory). + if not by.parts: + return arg.path.is_relative_to(by.path) + return False + # Paths are equal, check parts. + # For example: ("TestClass",) is a prefix of ("TestClass", "test_method"). + if len(by.parts) > len(arg.parts) or arg.parts[: len(by.parts)] != by.parts: + return False + # Paths and parts are equal, check parametrization. + # A `by` without parametrization (None) matches everything, e.g. + # `pytest x.py::test_it` matches `x.py::test_it[0]`. Otherwise must be + # exactly equal. + if by.parametrization is not None and by.parametrization != arg.parametrization: + return False + return True + + +def normalize_collection_arguments( + collection_args: Sequence[CollectionArgument], +) -> list[CollectionArgument]: + """Normalize collection arguments to eliminate overlapping paths and parts. + + Detects when collection arguments overlap in either paths or parts and only + keeps the shorter prefix, or the earliest argument if duplicate, preserving + order. The result is prefix-free. + """ + # A quadratic algorithm is not acceptable since large inputs are possible. + # So this uses an O(n*log(n)) algorithm which takes advantage of the + # property that after sorting, a collection argument will immediately + # precede collection arguments it subsumes. An O(n) algorithm is not worth + # it. + collection_args_sorted = sorted( + collection_args, + key=lambda arg: (arg.path, arg.parts, arg.parametrization or ""), ) + normalized: list[CollectionArgument] = [] + last_kept = None + for arg in collection_args_sorted: + if last_kept is None or not is_collection_argument_subsumed_by(arg, last_kept): + normalized.append(arg) + last_kept = arg + normalized.sort(key=lambda arg: arg.original_index) + return normalized diff --git a/testing/test_collection.py b/testing/test_collection.py index 2214c130a05..5d2aa6cb981 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -2031,3 +2031,673 @@ def test_namespace_packages(pytester: Pytester, import_mode: str): " ", ] ) + + +class TestOverlappingCollectionArguments: + """Test that overlapping collection arguments (e.g. `pytest a/b a + a/c::TestIt) are handled correctly (#12083).""" + + @pytest.mark.parametrize("args", [("a", "a/b"), ("a/b", "a")]) + def test_parent_child(self, pytester: Pytester, args: tuple[str, ...]) -> None: + """Test that 'pytest a a/b' and `pytest a/b a` collects all tests from 'a'.""" + pytester.makepyfile( + **{ + "a/test_a.py": """ + def test_a1(): pass + def test_a2(): pass + """, + "a/b/test_b.py": """ + def test_b1(): pass + def test_b2(): pass + """, + } + ) + + result = pytester.runpytest("--collect-only", *args) + + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_multiple_nested_paths(self, pytester: Pytester) -> None: + """Test that 'pytest a/b a a/b/c' collects all tests from 'a'.""" + pytester.makepyfile( + **{ + "a/test_a.py": """ + def test_a(): pass + """, + "a/b/test_b.py": """ + def test_b(): pass + """, + "a/b/c/test_c.py": """ + def test_c(): pass + """, + } + ) + + result = pytester.runpytest("--collect-only", "a/b", "a", "a/b/c") + + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_same_path_twice(self, pytester: Pytester) -> None: + """Test that 'pytest a a' doesn't duplicate tests.""" + pytester.makepyfile( + **{ + "a/test_a.py": """ + def test_a(): pass + """, + } + ) + + result = pytester.runpytest("--collect-only", "a", "a") + + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_keep_duplicates_flag(self, pytester: Pytester) -> None: + """Test that --keep-duplicates allows duplication.""" + pytester.makepyfile( + **{ + "a/test_a.py": """ + def test_a(): pass + """, + "a/b/test_b.py": """ + def test_b(): pass + """, + } + ) + + result = pytester.runpytest("--collect-only", "--keep-duplicates", "a", "a/b") + + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_specific_file_then_parent_dir(self, pytester: Pytester) -> None: + """Test that 'pytest a/test_a.py a' collects all tests from 'a'.""" + pytester.makepyfile( + **{ + "a/test_a.py": """ + def test_a(): pass + """, + "a/test_other.py": """ + def test_other(): pass + """, + } + ) + + result = pytester.runpytest("--collect-only", "a/test_a.py", "a") + + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_package_scope_fixture_with_overlapping_paths( + self, pytester: Pytester + ) -> None: + """Test that package-scoped fixtures work correctly with overlapping paths.""" + pytester.makepyfile( + **{ + "pkg/__init__.py": "", + "pkg/test_pkg.py": """ + import pytest + + counter = {"value": 0} + + @pytest.fixture(scope="package") + def pkg_fixture(): + counter["value"] += 1 + return counter["value"] + + def test_pkg1(pkg_fixture): + assert pkg_fixture == 1 + + def test_pkg2(pkg_fixture): + assert pkg_fixture == 1 + """, + "pkg/sub/__init__.py": "", + "pkg/sub/test_sub.py": """ + def test_sub(): pass + """, + } + ) + + # Package fixture should run only once even with overlapping paths. + result = pytester.runpytest("pkg", "pkg/sub", "pkg", "-v") + result.assert_outcomes(passed=3) + + def test_execution_order_preserved(self, pytester: Pytester) -> None: + """Test that test execution order follows argument order.""" + pytester.makepyfile( + **{ + "a/test_a.py": """ + def test_a(): pass + """, + "b/test_b.py": """ + def test_b(): pass + """, + } + ) + + result = pytester.runpytest("--collect-only", "b", "a", "b/test_b.py::test_b") + + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_overlapping_node_ids_class_and_method(self, pytester: Pytester) -> None: + """Test that overlapping node IDs are handled correctly.""" + pytester.makepyfile( + test_nodeids=""" + class TestClass: + def test_method1(self): pass + def test_method2(self): pass + def test_method3(self): pass + + def test_function(): pass + """ + ) + + # Class then specific method. + result = pytester.runpytest( + "--collect-only", + "test_nodeids.py::TestClass", + "test_nodeids.py::TestClass::test_method2", + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + # Specific method then class. + result = pytester.runpytest( + "--collect-only", + "test_nodeids.py::TestClass::test_method3", + "test_nodeids.py::TestClass", + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_overlapping_node_ids_file_and_class(self, pytester: Pytester) -> None: + """Test that file-level and class-level selections work correctly.""" + pytester.makepyfile( + test_file=""" + class TestClass: + def test_method(self): pass + + class TestOther: + def test_other(self): pass + + def test_function(): pass + """ + ) + + # File then class. + result = pytester.runpytest( + "--collect-only", "test_file.py", "test_file.py::TestClass" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + # Class then file. + result = pytester.runpytest( + "--collect-only", "test_file.py::TestClass", "test_file.py" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_same_node_id_twice(self, pytester: Pytester) -> None: + """Test that the same node ID specified twice is collected only once.""" + pytester.makepyfile( + test_dup=""" + def test_one(): pass + def test_two(): pass + """ + ) + + result = pytester.runpytest( + "--collect-only", + "test_dup.py::test_one", + "test_dup.py::test_one", + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_overlapping_with_parametrization(self, pytester: Pytester) -> None: + """Test overlapping with parametrized tests.""" + pytester.makepyfile( + test_param=""" + import pytest + + @pytest.mark.parametrize("n", [1, 2]) + def test_param(n): pass + + class TestClass: + @pytest.mark.parametrize("x", ["a", "b"]) + def test_method(self, x): pass + """ + ) + + result = pytester.runpytest( + "--collect-only", + "test_param.py::test_param[2]", + "test_param.py::TestClass::test_method[a]", + "test_param.py", + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest( + "--collect-only", + "test_param.py::test_param[2]", + "test_param.py::test_param", + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + @pytest.mark.parametrize("order", [(".", "a"), ("a", ".")]) + def test_root_and_subdir(self, pytester: Pytester, order: tuple[str, ...]) -> None: + """Test that '. a' and 'a .' both collect all tests.""" + pytester.makepyfile( + test_root=""" + def test_root(): pass + """, + **{ + "a/test_a.py": """ + def test_a(): pass + """, + }, + ) + + result = pytester.runpytest("--collect-only", *order) + + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + def test_complex_combined_handling(self, pytester: Pytester) -> None: + """Test some scenarios in a complex hierarchy.""" + pytester.makepyfile( + **{ + "top1/__init__.py": "", + "top1/test_1.py": ( + """ + def test_1(): pass + + class TestIt: + def test_2(): pass + + def test_3(): pass + """ + ), + "top1/test_2.py": ( + """ + def test_1(): pass + """ + ), + "top2/__init__.py": "", + "top2/test_1.py": ( + """ + def test_1(): pass + """ + ), + }, + ) + + result = pytester.runpytest_inprocess("--collect-only", ".") + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess("--collect-only", "top2", "top1") + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess( + "--collect-only", "top1", "top1/test_2.py" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + # NOTE: Also sensible arguably even without --keep-duplicates. + # " ", + # " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess( + "--collect-only", "top1/test_2.py", "top1" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + # NOTE: Ideally test_2 would come before test_1 here. + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess( + "--collect-only", "--keep-duplicates", "top1/test_2.py", "top1" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess( + "--collect-only", "top1/test_2.py", "top1/test_2.py" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + # NOTE: Also sensible arguably even without --keep-duplicates. + # " ", + # " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess("--collect-only", "top2/", "top2/") + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + # NOTE: Also sensible arguably even without --keep-duplicates. + # " ", + # " ", + # " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess( + "--collect-only", "top2/", "top2/", "top2/test_1.py" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + # NOTE: Also sensible arguably even without --keep-duplicates. + # " ", + # " ", + # " ", + # " ", + # " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess( + "--collect-only", "top1/test_1.py", "top1/test_1.py::test_3" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + " ", + " ", + # NOTE: Also sensible arguably even without --keep-duplicates. + # " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess( + "--collect-only", "top1/test_1.py::test_3", "top1/test_1.py" + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + # NOTE: Ideally test_3 would come before the others here. + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) + + result = pytester.runpytest_inprocess( + "--collect-only", + "--keep-duplicates", + "top1/test_1.py::test_3", + "top1/test_1.py", + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + # NOTE: That is duplicated here is not great. + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + ], + consecutive=True, + ) diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 9f18a90d100..6f8e2c81426 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -1468,7 +1468,7 @@ def test_pass(): """ ) - result, dom = run_and_parse(f, f) + result, dom = run_and_parse("--keep-duplicates", f, f) result.stdout.no_fnmatch_line("*INTERNALERROR*") first, second = (x["classname"] for x in dom.find_by_tag("testcase")) assert first == second diff --git a/testing/test_main.py b/testing/test_main.py index 37b887b0c66..4f1426f1278 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -121,66 +121,72 @@ def invocation_path(self, pytester: Pytester) -> Path: def test_file(self, invocation_path: Path) -> None: """File and parts.""" assert resolve_collection_argument( - invocation_path, "src/pkg/test.py" + invocation_path, "src/pkg/test.py", 0 ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=[], parametrization=None, module_name=None, + original_index=0, ) assert resolve_collection_argument( - invocation_path, "src/pkg/test.py::" + invocation_path, "src/pkg/test.py::", 10 ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=[""], parametrization=None, module_name=None, + original_index=10, ) assert resolve_collection_argument( - invocation_path, "src/pkg/test.py::foo::bar" + invocation_path, "src/pkg/test.py::foo::bar", 20 ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=["foo", "bar"], parametrization=None, module_name=None, + original_index=20, ) assert resolve_collection_argument( - invocation_path, "src/pkg/test.py::foo::bar::" + invocation_path, "src/pkg/test.py::foo::bar::", 30 ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=["foo", "bar", ""], parametrization=None, module_name=None, + original_index=30, ) assert resolve_collection_argument( - invocation_path, "src/pkg/test.py::foo::bar[a,b,c]" + invocation_path, "src/pkg/test.py::foo::bar[a,b,c]", 40 ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=["foo", "bar"], parametrization="[a,b,c]", module_name=None, + original_index=40, ) def test_dir(self, invocation_path: Path) -> None: """Directory and parts.""" assert resolve_collection_argument( - invocation_path, "src/pkg" + invocation_path, "src/pkg", 0 ) == CollectionArgument( path=invocation_path / "src/pkg", parts=[], parametrization=None, module_name=None, + original_index=0, ) with pytest.raises( UsageError, match=r"directory argument cannot contain :: selection parts" ): - resolve_collection_argument(invocation_path, "src/pkg::") + resolve_collection_argument(invocation_path, "src/pkg::", 0) with pytest.raises( UsageError, match=r"directory argument cannot contain :: selection parts" ): - resolve_collection_argument(invocation_path, "src/pkg::foo::bar") + resolve_collection_argument(invocation_path, "src/pkg::foo::bar", 0) @pytest.mark.parametrize("namespace_package", [False, True]) def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None: @@ -190,24 +196,27 @@ def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None: (invocation_path / "src/pkg/__init__.py").unlink() assert resolve_collection_argument( - invocation_path, "pkg.test", as_pypath=True + invocation_path, "pkg.test", 0, as_pypath=True ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=[], parametrization=None, module_name="pkg.test", + original_index=0, ) assert resolve_collection_argument( - invocation_path, "pkg.test::foo::bar", as_pypath=True + invocation_path, "pkg.test::foo::bar", 0, as_pypath=True ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=["foo", "bar"], parametrization=None, module_name="pkg.test", + original_index=0, ) assert resolve_collection_argument( invocation_path, "pkg", + 0, as_pypath=True, consider_namespace_packages=namespace_package, ) == CollectionArgument( @@ -215,6 +224,7 @@ def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None: parts=[], parametrization=None, module_name="pkg", + original_index=0, ) with pytest.raises( @@ -223,18 +233,20 @@ def test_pypath(self, namespace_package: bool, invocation_path: Path) -> None: resolve_collection_argument( invocation_path, "pkg::foo::bar", + 0, as_pypath=True, consider_namespace_packages=namespace_package, ) def test_parametrized_name_with_colons(self, invocation_path: Path) -> None: assert resolve_collection_argument( - invocation_path, "src/pkg/test.py::test[a::b]" + invocation_path, "src/pkg/test.py::test[a::b]", 0 ) == CollectionArgument( path=invocation_path / "src/pkg/test.py", parts=["test"], parametrization="[a::b]", module_name=None, + original_index=0, ) @pytest.mark.parametrize( @@ -246,17 +258,14 @@ def test_path_parametrization_not_allowed( with pytest.raises( UsageError, match=r"path cannot contain \[\] parametrization" ): - resolve_collection_argument( - invocation_path, - arg, - ) + resolve_collection_argument(invocation_path, arg, 0) def test_does_not_exist(self, invocation_path: Path) -> None: """Given a file/module that does not exist raises UsageError.""" with pytest.raises( UsageError, match=re.escape("file or directory not found: foobar") ): - resolve_collection_argument(invocation_path, "foobar") + resolve_collection_argument(invocation_path, "foobar", 0) with pytest.raises( UsageError, @@ -264,30 +273,32 @@ def test_does_not_exist(self, invocation_path: Path) -> None: "module or package not found: foobar (missing __init__.py?)" ), ): - resolve_collection_argument(invocation_path, "foobar", as_pypath=True) + resolve_collection_argument(invocation_path, "foobar", 0, as_pypath=True) def test_absolute_paths_are_resolved_correctly(self, invocation_path: Path) -> None: """Absolute paths resolve back to absolute paths.""" full_path = str(invocation_path / "src") assert resolve_collection_argument( - invocation_path, full_path + invocation_path, full_path, 0 ) == CollectionArgument( path=Path(os.path.abspath("src")), parts=[], parametrization=None, module_name=None, + original_index=0, ) # ensure full paths given in the command-line without the drive letter resolve # to the full path correctly (#7628) drive, full_path_without_drive = os.path.splitdrive(full_path) assert resolve_collection_argument( - invocation_path, full_path_without_drive + invocation_path, full_path_without_drive, 0 ) == CollectionArgument( path=Path(os.path.abspath("src")), parts=[], parametrization=None, module_name=None, + original_index=0, ) diff --git a/testing/test_mark.py b/testing/test_mark.py index 1e51f9db18f..e05aebc0730 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -59,7 +59,7 @@ def test_1(self, abc): """ ) file_name = os.path.basename(py_file) - rec = pytester.inline_run(file_name, file_name) + rec = pytester.inline_run("--keep-duplicates", file_name, file_name) rec.assertoutcome(passed=6) From 9ef4cd0797940815fd4a5ced64e5e25961a73a95 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 12 Sep 2025 23:59:31 +0300 Subject: [PATCH 104/270] python_api: improve approx assert message on mappings with only extra elements Fix #13722 --- changelog/13722.bugfix.rst | 1 + src/_pytest/python_api.py | 6 ++++++ testing/python/approx.py | 11 +++++++++++ 3 files changed, 18 insertions(+) create mode 100644 changelog/13722.bugfix.rst diff --git a/changelog/13722.bugfix.rst b/changelog/13722.bugfix.rst new file mode 100644 index 00000000000..ec36f466815 --- /dev/null +++ b/changelog/13722.bugfix.rst @@ -0,0 +1 @@ +Fixed a misleading assertion failure message when using :func:`pytest.approx` on mappings with differing lengths. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 52e564bd809..958a3bd9b25 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -236,6 +236,12 @@ def __repr__(self) -> str: def _repr_compare(self, other_side: Mapping[object, float]) -> list[str]: import math + if len(self.expected) != len(other_side): + return [ + "Impossible to compare mappings with different sizes.", + f"Lengths: {len(self.expected)} and {len(other_side)}", + ] + approx_side_as_map = { k: self._approx_scalar(v) for k, v in self.expected.items() } diff --git a/testing/python/approx.py b/testing/python/approx.py index 06633b544ec..2707b3638e8 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -741,6 +741,17 @@ def test_dict_for_div_by_zero(self, assert_approx_raises_regex): ], ) + def test_dict_differing_lengths(self, assert_approx_raises_regex): + assert_approx_raises_regex( + {"a": 0}, + {"a": 0, "b": 1}, + [ + " ", + r" Impossible to compare mappings with different sizes\.", + r" Lengths: 2 and 1", + ], + ) + def test_numpy_array(self): np = pytest.importorskip("numpy") From bb712f151ebc62fad928621448d1aea21be493b8 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 12 Sep 2025 13:20:26 +0300 Subject: [PATCH 105/270] Remove support for Python 3.9 It will be end-of-life (or on its last breaths) by the time of the next release. Refs #13719 --- .github/workflows/test.yml | 115 +++++++++++++----------------- .pre-commit-config.yaml | 2 +- CONTRIBUTING.rst | 18 ++--- README.rst | 2 +- changelog/13719.breaking.rst | 1 + doc/en/example/multipython.py | 2 +- doc/en/getting-started.rst | 2 - doc/en/how-to/skipping.rst | 4 +- doc/en/index.rst | 4 +- pyproject.toml | 11 ++- src/_pytest/_code/code.py | 20 ++---- src/_pytest/_code/source.py | 6 +- src/_pytest/_io/terminalwriter.py | 3 +- src/_pytest/_py/path.py | 2 +- src/_pytest/assertion/rewrite.py | 60 +++++++--------- src/_pytest/assertion/util.py | 2 +- src/_pytest/cacheprovider.py | 2 +- src/_pytest/config/findpaths.py | 13 ++-- src/_pytest/doctest.py | 22 +----- src/_pytest/fixtures.py | 18 ++--- src/_pytest/mark/__init__.py | 3 +- src/_pytest/mark/structures.py | 5 +- src/_pytest/pathlib.py | 2 +- src/_pytest/python.py | 16 +++-- src/_pytest/python_api.py | 18 ++--- src/_pytest/raises.py | 2 +- src/_pytest/reports.py | 2 +- src/_pytest/runner.py | 2 +- src/_pytest/skipping.py | 5 +- src/_pytest/unittest.py | 9 ++- testing/_py/test_local.py | 3 +- testing/conftest.py | 2 +- testing/python/approx.py | 2 +- testing/python/fixtures.py | 3 +- testing/python/metafunc.py | 2 +- testing/python/raises.py | 4 +- testing/python/raises_group.py | 2 +- testing/test_assertrewrite.py | 6 +- testing/test_compat.py | 2 +- testing/test_junitxml.py | 3 +- testing/test_reports.py | 6 +- testing/test_skipping.py | 26 +++---- testing/test_terminal.py | 2 +- testing/test_warnings.py | 3 +- testing/typing_checks.py | 5 +- testing/typing_raises_group.py | 13 +--- tox.ini | 12 ++-- 47 files changed, 190 insertions(+), 279 deletions(-) create mode 100644 changelog/13719.breaking.rst diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b372cf94d1..41a0773e1af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,24 +56,22 @@ jobs: fail-fast: false matrix: name: [ - "windows-py39-unittest-asynctest", - "windows-py39-unittest-twisted24", - "windows-py39-unittest-twisted25", - "windows-py39-pluggy", - "windows-py39-xdist", - "windows-py310", + "windows-py310-unittest-asynctest", + "windows-py310-unittest-twisted24", + "windows-py310-unittest-twisted25", + "windows-py310-pluggy", + "windows-py310-xdist", "windows-py311", "windows-py312", "windows-py313", "windows-py314", - "ubuntu-py39-unittest-asynctest", - "ubuntu-py39-unittest-twisted24", - "ubuntu-py39-unittest-twisted25", - "ubuntu-py39-lsof-numpy-pexpect", - "ubuntu-py39-pluggy", - "ubuntu-py39-freeze", - "ubuntu-py39-xdist", + "ubuntu-py310-unittest-asynctest", + "ubuntu-py310-unittest-twisted24", + "ubuntu-py310-unittest-twisted25", + "ubuntu-py310-lsof-numpy-pexpect", + "ubuntu-py310-pluggy", + "ubuntu-py310-freeze", "ubuntu-py310-xdist", "ubuntu-py311", "ubuntu-py312", @@ -81,7 +79,6 @@ jobs: "ubuntu-py314", "ubuntu-pypy3-xdist", - "macos-py39", "macos-py310", "macos-py312", "macos-py313", @@ -93,35 +90,30 @@ jobs: include: # Use separate jobs for different unittest flavors (twisted, asynctest) to ensure proper coverage. - - name: "windows-py39-unittest-asynctest" - python: "3.9" + - name: "windows-py310-unittest-asynctest" + python: "3.10" os: windows-latest - tox_env: "py39-asynctest" + tox_env: "py310-asynctest" use_coverage: true - - name: "windows-py39-unittest-twisted24" - python: "3.9" + - name: "windows-py310-unittest-twisted24" + python: "3.10" os: windows-latest - tox_env: "py39-twisted24" + tox_env: "py310-twisted24" use_coverage: true - - name: "windows-py39-unittest-twisted25" - python: "3.9" + - name: "windows-py310-unittest-twisted25" + python: "3.10" os: windows-latest - tox_env: "py39-twisted25" + tox_env: "py310-twisted25" use_coverage: true - - name: "windows-py39-pluggy" - python: "3.9" - os: windows-latest - tox_env: "py39-pluggymain-pylib-xdist" - - - name: "windows-py39-xdist" - python: "3.9" + - name: "windows-py310-pluggy" + python: "3.10" os: windows-latest - tox_env: "py39-xdist" + tox_env: "py310-pluggymain-pylib-xdist" - - name: "windows-py310" + - name: "windows-py310-xdist" python: "3.10" os: windows-latest tox_env: "py310-xdist" @@ -147,44 +139,39 @@ jobs: tox_env: "py314" # Use separate jobs for different unittest flavors (twisted, asynctest) to ensure proper coverage. - - name: "ubuntu-py39-unittest-asynctest" - python: "3.9" + - name: "ubuntu-py310-unittest-asynctest" + python: "3.10" os: ubuntu-latest - tox_env: "py39-asynctest" + tox_env: "py310-asynctest" use_coverage: true - - name: "ubuntu-py39-unittest-twisted24" - python: "3.9" + - name: "ubuntu-py310-unittest-twisted24" + python: "3.10" os: ubuntu-latest - tox_env: "py39-twisted24" + tox_env: "py310-twisted24" use_coverage: true - - name: "ubuntu-py39-unittest-twisted25" - python: "3.9" + - name: "ubuntu-py310-unittest-twisted25" + python: "3.10" os: ubuntu-latest - tox_env: "py39-twisted25" + tox_env: "py310-twisted25" use_coverage: true - - name: "ubuntu-py39-lsof-numpy-pexpect" - python: "3.9" + - name: "ubuntu-py310-lsof-numpy-pexpect" + python: "3.10" os: ubuntu-latest - tox_env: "py39-lsof-numpy-pexpect" + tox_env: "py310-lsof-numpy-pexpect" use_coverage: true - - name: "ubuntu-py39-pluggy" - python: "3.9" - os: ubuntu-latest - tox_env: "py39-pluggymain-pylib-xdist" - - - name: "ubuntu-py39-freeze" - python: "3.9" + - name: "ubuntu-py310-pluggy" + python: "3.10" os: ubuntu-latest - tox_env: "py39-freeze" + tox_env: "py310-pluggymain-pylib-xdist" - - name: "ubuntu-py39-xdist" - python: "3.9" + - name: "ubuntu-py310-freeze" + python: "3.10" os: ubuntu-latest - tox_env: "py39-xdist" + tox_env: "py310-freeze" - name: "ubuntu-py310-xdist" python: "3.10" @@ -216,17 +203,11 @@ jobs: use_coverage: true - name: "ubuntu-pypy3-xdist" - python: "pypy-3.9" + python: "pypy-3.10" os: ubuntu-latest tox_env: "pypy3-xdist" - - name: "macos-py39" - python: "3.9" - os: macos-latest - tox_env: "py39-xdist" - use_coverage: true - - name: "macos-py310" python: "3.10" os: macos-latest @@ -254,7 +235,7 @@ jobs: - name: "doctesting" - python: "3.9" + python: "3.10" os: ubuntu-latest tox_env: "doctesting" use_coverage: true @@ -264,12 +245,12 @@ jobs: contains( fromJSON( '[ - "windows-py39-pluggy", + "windows-py310-pluggy", "windows-py313", - "ubuntu-py39-pluggy", - "ubuntu-py39-freeze", + "ubuntu-py310-pluggy", + "ubuntu-py310-freeze", "ubuntu-py313", - "macos-py39", + "macos-py310", "macos-py313" ]' ), diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b17b032dce2..4b7ea12fa4c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -76,7 +76,7 @@ repos: hooks: - id: pyupgrade args: - - "--py39-plus" + - "--py310-plus" # Manual because ruff does what pyupgrade does and the two are not out of sync # often enough to make launching pyupgrade everytime worth it stages: [manual] diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index b79955e1c01..e98dd06fb5a 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -197,7 +197,7 @@ Short version #. Follow `PEP-8 `_ for naming. #. Tests are run using ``tox``:: - tox -e linting,py39 + tox -e linting,py313 The test environments above are usually enough to cover most cases locally. @@ -269,24 +269,24 @@ Here is a simple overview, with pytest-specific bits: #. Run all the tests - You need to have Python 3.9 or later available in your system. Now + You need to have a supported Python version available in your system. Now running tests is as simple as issuing this command:: - $ tox -e linting,py39 + $ tox -e linting,py - This command will run tests via the "tox" tool against Python 3.9 - and also perform "lint" coding-style checks. + This command will run tests via the "tox" tool against your default Python + version and also perform "lint" coding-style checks. #. You can now edit your local working copy and run the tests again as necessary. Please follow `PEP-8 `_ for naming. - You can pass different options to ``tox``. For example, to run tests on Python 3.9 and pass options to pytest + You can pass different options to ``tox``. For example, to run tests on Python 3.13 and pass options to pytest (e.g. enter pdb on failure) to pytest you can do:: - $ tox -e py39 -- --pdb + $ tox -e py313 -- --pdb - Or to only run tests in a particular test module on Python 3.9:: + Or to only run tests in a particular test module on Python 3.12:: - $ tox -e py39 -- testing/test_config.py + $ tox -e py312 -- testing/test_config.py When committing, ``pre-commit`` will re-format the files if necessary. diff --git a/README.rst b/README.rst index 091afc363da..bf9cd445884 100644 --- a/README.rst +++ b/README.rst @@ -97,7 +97,7 @@ Features - Can run `unittest `_ (or trial) test suites out of the box -- Python 3.9+ or PyPy3 +- Python 3.10+ or PyPy3 - Rich plugin architecture, with over 1300+ `external plugins `_ and thriving community diff --git a/changelog/13719.breaking.rst b/changelog/13719.breaking.rst new file mode 100644 index 00000000000..328c7dfcf2b --- /dev/null +++ b/changelog/13719.breaking.rst @@ -0,0 +1 @@ +Support for Python 3.9 is dropped following its end of life. diff --git a/doc/en/example/multipython.py b/doc/en/example/multipython.py index f54524213bc..c04a2868812 100644 --- a/doc/en/example/multipython.py +++ b/doc/en/example/multipython.py @@ -10,7 +10,7 @@ import pytest -pythonlist = ["python3.9", "python3.10", "python3.11"] +pythonlist = ["python3.11", "python3.12", "python3.13"] @pytest.fixture(params=pythonlist) diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 349711faaf4..4089e0e5867 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -9,8 +9,6 @@ Get Started Install ``pytest`` ---------------------------------------- -``pytest`` requires: Python 3.8+ or PyPy3. - 1. Run the following command in your command line: .. code-block:: bash diff --git a/doc/en/how-to/skipping.rst b/doc/en/how-to/skipping.rst index 09a19766f99..6584b1c7b24 100644 --- a/doc/en/how-to/skipping.rst +++ b/doc/en/how-to/skipping.rst @@ -84,14 +84,14 @@ It is also possible to skip the whole module using If you wish to skip something conditionally then you can use ``skipif`` instead. Here is an example of marking a test function to be skipped -when run on an interpreter earlier than Python3.10: +when run on an interpreter earlier than Python3.13: .. code-block:: python import sys - @pytest.mark.skipif(sys.version_info < (3, 10), reason="requires python3.10 or higher") + @pytest.mark.skipif(sys.version_info < (3, 13), reason="requires python3.13 or higher") def test_function(): ... If the condition evaluates to ``True`` during collection, the test function will be skipped, diff --git a/doc/en/index.rst b/doc/en/index.rst index 2b58bebc20f..5b139800e0d 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -46,8 +46,6 @@ The ``pytest`` framework makes it easy to write small, readable tests, and can scale to support complex functional testing for applications and libraries. -``pytest`` requires: Python 3.8+ or PyPy3. - **PyPI package name**: :pypi:`pytest` A quick example @@ -104,7 +102,7 @@ Features - Can run :ref:`unittest ` (including trial) test suites out of the box -- Python 3.8+ or PyPy 3 +- Python 3.10+ or PyPy 3 - Rich plugin architecture, with over 1300+ :ref:`external plugins ` and thriving community diff --git a/pyproject.toml b/pyproject.toml index a277961ccb4..12c51078a8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ authors = [ { name = "Florian Bruhin" }, { name = "Others (See AUTHORS)" }, ] -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Development Status :: 6 - Mature", "Intended Audience :: Developers", @@ -33,7 +33,6 @@ classifiers = [ "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -86,10 +85,10 @@ write_to = "src/_pytest/_version.py" [tool.black] # See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version -target-version = [ "py39", "py310", "py311", "py312", "py313" ] +target-version = [ "py310", "py311", "py312", "py313" ] [tool.ruff] -target-version = "py39" +target-version = "py310" line-length = 88 src = [ "src", @@ -520,7 +519,7 @@ files = [ mypy_path = [ "src", ] -python_version = "3.9" +python_version = "3.10" check_untyped_defs = true disallow_any_generics = true disallow_untyped_defs = true @@ -543,7 +542,7 @@ include = [ extraPaths = [ "src", ] -pythonVersion = "3.9" +pythonVersion = "3.10" typeCheckingMode = "basic" reportMissingImports = "none" reportMissingModuleSource = "none" diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index f1241f14136..06036d21956 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -30,9 +30,8 @@ from typing import Literal from typing import overload from typing import SupportsIndex -from typing import TYPE_CHECKING +from typing import TypeAlias from typing import TypeVar -from typing import Union import pluggy @@ -55,7 +54,7 @@ TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"] -EXCEPTION_OR_MORE = Union[type[BaseException], tuple[type[BaseException], ...]] +EXCEPTION_OR_MORE = type[BaseException] | tuple[type[BaseException], ...] class Code: @@ -469,7 +468,7 @@ def stringify_exception( notes = getattr(exc, "__notes__", []) except KeyError: # Workaround for https://github.com/python/cpython/issues/98778 on - # Python <= 3.9, and some 3.10 and 3.11 patch versions. + # some 3.10 and 3.11 patch versions. HTTPError = getattr(sys.modules.get("urllib.error", None), "HTTPError", ()) if sys.version_info < (3, 12) and isinstance(exc, HTTPError): notes = [] @@ -853,15 +852,10 @@ def group_contains( return self._group_contains(self.value, expected_exception, match, depth) -if TYPE_CHECKING: - from typing_extensions import TypeAlias - - # Type alias for the `tbfilter` setting: - # bool: If True, it should be filtered using Traceback.filter() - # callable: A callable that takes an ExceptionInfo and returns the filtered traceback. - TracebackFilter: TypeAlias = Union[ - bool, Callable[[ExceptionInfo[BaseException]], Traceback] - ] +# Type alias for the `tbfilter` setting: +# bool: If True, it should be filtered using Traceback.filter() +# callable: A callable that takes an ExceptionInfo and returns the filtered traceback. +TracebackFilter: TypeAlias = bool | Callable[[ExceptionInfo[BaseException]], Traceback] @dataclasses.dataclass diff --git a/src/_pytest/_code/source.py b/src/_pytest/_code/source.py index a8f7201a40f..280691f0b6c 100644 --- a/src/_pytest/_code/source.py +++ b/src/_pytest/_code/source.py @@ -26,7 +26,7 @@ def __init__(self, obj: object = None) -> None: elif isinstance(obj, Source): self.lines = obj.lines self.raw_lines = obj.raw_lines - elif isinstance(obj, (tuple, list)): + elif isinstance(obj, tuple | list): self.lines = deindent(x.rstrip("\n") for x in obj) self.raw_lines = list(x.rstrip("\n") for x in obj) elif isinstance(obj, str): @@ -155,9 +155,9 @@ def get_statement_startend2(lineno: int, node: ast.AST) -> tuple[int, int | None # AST's line numbers start indexing at 1. values: list[int] = [] for x in ast.walk(node): - if isinstance(x, (ast.stmt, ast.ExceptHandler)): + if isinstance(x, ast.stmt | ast.ExceptHandler): # The lineno points to the class/def, so need to include the decorators. - if isinstance(x, (ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef)): + if isinstance(x, ast.ClassDef | ast.FunctionDef | ast.AsyncFunctionDef): for d in x.decorator_list: values.append(d.lineno - 1) values.append(x.lineno - 1) diff --git a/src/_pytest/_io/terminalwriter.py b/src/_pytest/_io/terminalwriter.py index fd808f8b3b7..68fe4994555 100644 --- a/src/_pytest/_io/terminalwriter.py +++ b/src/_pytest/_io/terminalwriter.py @@ -198,7 +198,8 @@ def _write_source(self, lines: Sequence[str], indents: Sequence[str] = ()) -> No indents = [""] * len(lines) source = "\n".join(lines) new_lines = self._highlight(source).splitlines() - for indent, new_line in zip(indents, new_lines): + # Would be better to strict=True but that fails some CI jobs. + for indent, new_line in zip(indents, new_lines, strict=False): self.line(indent + new_line) def _get_pygments_lexer(self, lexer: Literal["python", "diff"]) -> Lexer: diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index e353c1a9b52..878fc7a538b 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -432,7 +432,7 @@ def relto(self, relpath): """Return a string which is the relative part of the path to the given 'relpath'. """ - if not isinstance(relpath, (str, LocalPath)): + if not isinstance(relpath, str | LocalPath): raise TypeError(f"{relpath!r}: not a string or path object") strrelpath = str(relpath) if strrelpath and strrelpath[-1] != self.sep: diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index b07f8b24b57..bff33ccf155 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -26,6 +26,17 @@ from typing import IO from typing import TYPE_CHECKING + +if sys.version_info >= (3, 12): + from importlib.resources.abc import TraversableResources +else: + from importlib.abc import TraversableResources +if sys.version_info < (3, 11): + from importlib.readers import FileReader +else: + from importlib.resources.readers import FileReader + + from _pytest._io.saferepr import DEFAULT_REPR_MAX_SIZE from _pytest._io.saferepr import saferepr from _pytest._io.saferepr import saferepr_unlimited @@ -291,19 +302,8 @@ def get_data(self, pathname: str | bytes) -> bytes: with open(pathname, "rb") as f: return f.read() - if sys.version_info >= (3, 10): - if sys.version_info >= (3, 12): - from importlib.resources.abc import TraversableResources - else: - from importlib.abc import TraversableResources - - def get_resource_reader(self, name: str) -> TraversableResources: - if sys.version_info < (3, 11): - from importlib.readers import FileReader - else: - from importlib.resources.readers import FileReader - - return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) + def get_resource_reader(self, name: str) -> TraversableResources: + return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) # type: ignore[arg-type] def _write_pyc_fp( @@ -496,7 +496,7 @@ def _call_reprcompare( expls: Sequence[str], each_obj: Sequence[object], ) -> str: - for i, res, expl in zip(range(len(ops)), results, expls): + for i, res, expl in zip(range(len(ops)), results, expls, strict=True): try: done = not res except Exception: @@ -729,21 +729,15 @@ def run(self, mod: ast.Module) -> None: else: lineno = item.lineno # Now actually insert the special imports. - if sys.version_info >= (3, 10): - aliases = [ - ast.alias("builtins", "@py_builtins", lineno=lineno, col_offset=0), - ast.alias( - "_pytest.assertion.rewrite", - "@pytest_ar", - lineno=lineno, - col_offset=0, - ), - ] - else: - aliases = [ - ast.alias("builtins", "@py_builtins"), - ast.alias("_pytest.assertion.rewrite", "@pytest_ar"), - ] + aliases = [ + ast.alias("builtins", "@py_builtins", lineno=lineno, col_offset=0), + ast.alias( + "_pytest.assertion.rewrite", + "@pytest_ar", + lineno=lineno, + col_offset=0, + ), + ] imports = [ ast.Import([alias], lineno=lineno, col_offset=0) for alias in aliases ] @@ -754,7 +748,7 @@ def run(self, mod: ast.Module) -> None: nodes: list[ast.AST | Sentinel] = [mod] while nodes: node = nodes.pop() - if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)): + if isinstance(node, ast.FunctionDef | ast.AsyncFunctionDef | ast.ClassDef): self.scope = tuple((*self.scope, node)) nodes.append(_SCOPE_END_MARKER) if node == _SCOPE_END_MARKER: @@ -1132,12 +1126,12 @@ def visit_Compare(self, comp: ast.Compare) -> tuple[ast.expr, str]: if isinstance(comp.left, ast.NamedExpr): self.variables_overwrite[self.scope][comp.left.target.id] = comp.left # type:ignore[assignment] left_res, left_expl = self.visit(comp.left) - if isinstance(comp.left, (ast.Compare, ast.BoolOp)): + if isinstance(comp.left, ast.Compare | ast.BoolOp): left_expl = f"({left_expl})" res_variables = [self.variable() for i in range(len(comp.ops))] load_names: list[ast.expr] = [ast.Name(v, ast.Load()) for v in res_variables] store_names = [ast.Name(v, ast.Store()) for v in res_variables] - it = zip(range(len(comp.ops)), comp.ops, comp.comparators) + it = zip(range(len(comp.ops)), comp.ops, comp.comparators, strict=True) expls: list[ast.expr] = [] syms: list[ast.expr] = [] results = [left_res] @@ -1150,7 +1144,7 @@ def visit_Compare(self, comp: ast.Compare) -> tuple[ast.expr, str]: next_operand.target.id = self.variable() self.variables_overwrite[self.scope][left_res.id] = next_operand # type:ignore[assignment] next_res, next_expl = self.visit(next_operand) - if isinstance(next_operand, (ast.Compare, ast.BoolOp)): + if isinstance(next_operand, ast.Compare | ast.BoolOp): next_expl = f"({next_expl})" results.append(next_res) sym = BINOP_MAP[op.__class__] diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index c545e6cd20c..cc499f7186f 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -131,7 +131,7 @@ def isdict(x: Any) -> bool: def isset(x: Any) -> bool: - return isinstance(x, (set, frozenset)) + return isinstance(x, set | frozenset) def isnamedtuple(obj: Any) -> bool: diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index 7f30e72007e..4383f105af6 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -256,7 +256,7 @@ def pytest_make_collect_report( self, collector: nodes.Collector ) -> Generator[None, CollectReport, CollectReport]: res = yield - if isinstance(collector, (Session, Directory)): + if isinstance(collector, Session | Directory): # Sort any lf-paths to the beginning. lf_paths = self.lfplugin._last_failed_paths diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index 15bfbb0613e..763803adbe7 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -5,7 +5,7 @@ import os from pathlib import Path import sys -from typing import TYPE_CHECKING +from typing import TypeAlias import iniconfig @@ -16,14 +16,9 @@ from _pytest.pathlib import safe_exists -if TYPE_CHECKING: - from typing import Union - - from typing_extensions import TypeAlias - - # Even though TOML supports richer data types, all values are converted to str/list[str] during - # parsing to maintain compatibility with the rest of the configuration system. - ConfigDict: TypeAlias = dict[str, Union[str, list[str]]] +# Even though TOML supports richer data types, all values are converted to str/list[str] during +# parsing to maintain compatibility with the rest of the configuration system. +ConfigDict: TypeAlias = dict[str, str | list[str]] def _parse_ini_config(path: Path) -> iniconfig.IniConfig: diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 0dbef6056d7..cd255f5eeb6 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -324,7 +324,7 @@ def repr_failure( # type: ignore[override] Sequence[doctest.DocTestFailure | doctest.UnexpectedException] | None ) = None if isinstance( - excinfo.value, (doctest.DocTestFailure, doctest.UnexpectedException) + excinfo.value, doctest.DocTestFailure | doctest.UnexpectedException ): failures = [excinfo.value] elif isinstance(excinfo.value, MultipleDoctestFailures): @@ -530,24 +530,6 @@ def _find_lineno(self, obj, source_lines): source_lines, ) - if sys.version_info < (3, 10): - - def _find( - self, tests, obj, name, module, source_lines, globs, seen - ) -> None: - """Override _find to work around issue in stdlib. - - https://github.com/pytest-dev/pytest/issues/3456 - https://github.com/python/cpython/issues/69718 - """ - if _is_mocked(obj): - return # pragma: no cover - with _patch_unwrap_mock_aware(): - # Type ignored because this is a private function. - super()._find( # type:ignore[misc] - tests, obj, name, module, source_lines, globs, seen - ) - if sys.version_info < (3, 13): def _from_module(self, module, object): @@ -657,7 +639,7 @@ def _remove_unwanted_precision(self, want: str, got: str) -> str: if len(wants) != len(gots): return got offset = 0 - for w, g in zip(wants, gots): + for w, g in zip(wants, gots, strict=True): fraction: str | None = w.group("fraction") exponent: str | None = w.group("exponent1") if exponent is None: diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index bc5805aaea9..91f1b3a67f6 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -26,11 +26,9 @@ from typing import final from typing import Generic from typing import NoReturn -from typing import Optional from typing import overload from typing import TYPE_CHECKING from typing import TypeVar -from typing import Union import warnings import _pytest @@ -88,26 +86,24 @@ # The type of the fixture function (type variable). FixtureFunction = TypeVar("FixtureFunction", bound=Callable[..., object]) # The type of a fixture function (type alias generic in fixture value). -_FixtureFunc = Union[ - Callable[..., FixtureValue], Callable[..., Generator[FixtureValue]] -] +_FixtureFunc = Callable[..., FixtureValue] | Callable[..., Generator[FixtureValue]] # The type of FixtureDef.cached_result (type alias generic in fixture value). -_FixtureCachedResult = Union[ +_FixtureCachedResult = ( tuple[ # The result. FixtureValue, # Cache key. object, None, - ], - tuple[ + ] + | tuple[ None, # Cache key. object, # The exception and the original traceback. - tuple[BaseException, Optional[types.TracebackType]], - ], -] + tuple[BaseException, types.TracebackType | None], + ] +) @dataclasses.dataclass(frozen=True) diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index 068c7410a46..cd59069559e 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -7,7 +7,6 @@ from collections.abc import Iterable from collections.abc import Set as AbstractSet import dataclasses -from typing import Optional from typing import TYPE_CHECKING from .expression import Expression @@ -45,7 +44,7 @@ ] -old_mark_config_key = StashKey[Optional[Config]]() +old_mark_config_key = StashKey[Config | None]() def param( diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index f9261076ad0..04c37796e10 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -18,7 +18,6 @@ from typing import overload from typing import TYPE_CHECKING from typing import TypeVar -from typing import Union import warnings from .._code import getfslineno @@ -302,7 +301,7 @@ def combined_with(self, other: Mark) -> Mark: # A generic parameter designating an object to which a Mark may # be applied -- a test function (callable) or class. # Note: a lambda is not allowed, but this can't be represented. -Markable = TypeVar("Markable", bound=Union[Callable[..., object], type]) +Markable = TypeVar("Markable", bound=Callable[..., object] | type) @dataclasses.dataclass @@ -396,7 +395,7 @@ def __call__(self, *args: object, **kwargs: object): # For staticmethods/classmethods, the marks are eventually fetched from the # function object, not the descriptor, so unwrap. unwrapped_func = func - if isinstance(func, (staticmethod, classmethod)): + if isinstance(func, staticmethod | classmethod): unwrapped_func = func.__func__ if len(args) == 1 and (istestfunc(unwrapped_func) or is_class): store_mark(unwrapped_func, self.mark, stacklevel=3) diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index d6b90687a6f..cd15434605d 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -348,7 +348,7 @@ def cleanup_candidates(root: Path, prefix: str, keep: int) -> Iterator[Path]: entries = find_prefixed(root, prefix) entries, entries2 = itertools.tee(entries) numbers = map(parse_num, extract_suffixes(entries2, prefix)) - for entry, number in zip(entries, numbers): + for entry, number in zip(entries, numbers, strict=True): if number <= max_delete: yield Path(entry) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 8e4fb041532..3f9da026799 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -210,7 +210,7 @@ def pytest_pycollect_makemodule(module_path: Path, parent) -> Module: def pytest_pycollect_makeitem( collector: Module | Class, name: str, obj: object ) -> None | nodes.Item | nodes.Collector | list[nodes.Item | nodes.Collector]: - assert isinstance(collector, (Class, Module)), type(collector) + assert isinstance(collector, Class | Module), type(collector) # Nothing was collected elsewhere, let's do it here. if safe_isclass(obj): if collector.istestclass(obj, name): @@ -358,7 +358,7 @@ def classnamefilter(self, name: str) -> bool: def istestfunction(self, obj: object, name: str) -> bool: if self.funcnamefilter(name) or self.isnosetest(obj): - if isinstance(obj, (staticmethod, classmethod)): + if isinstance(obj, staticmethod | classmethod): # staticmethods and classmethods need to be unwrapped. obj = safe_getattr(obj, "__func__", False) return callable(obj) and fixtures.getfixturemarker(obj) is None @@ -944,7 +944,9 @@ def _resolve_ids(self) -> Iterable[str | _HiddenParam]: # ID not provided - generate it. yield "-".join( self._idval(val, argname, idx) - for val, argname in zip(parameterset.values, self.argnames) + for val, argname in zip( + parameterset.values, self.argnames, strict=True + ) ) def _idval(self, val: object, argname: str, idx: int) -> str: @@ -989,9 +991,9 @@ def _idval_from_hook(self, val: object, argname: str) -> str | None: def _idval_from_value(self, val: object) -> str | None: """Try to make an ID for a parameter in a ParameterSet from its value, if the value type is supported.""" - if isinstance(val, (str, bytes)): + if isinstance(val, str | bytes): return _ascii_escaped_by_config(val, self.config) - elif val is None or isinstance(val, (float, int, bool, complex)): + elif val is None or isinstance(val, float | int | bool | complex): return str(val) elif isinstance(val, re.Pattern): return ascii_escaped(val.pattern) @@ -1079,7 +1081,7 @@ def setmulti( params = self.params.copy() indices = self.indices.copy() arg2scope = dict(self._arg2scope) - for arg, val in zip(argnames, valset): + for arg, val in zip(argnames, valset, strict=True): if arg in params: raise nodes.Collector.CollectError( f"{nodeid}: duplicate parametrization of {arg!r}" @@ -1336,7 +1338,7 @@ def parametrize( newcalls = [] for callspec in self._calls or [CallSpec2()]: for param_index, (param_id, param_set) in enumerate( - zip(ids, parametersets) + zip(ids, parametersets, strict=True) ): newcallspec = callspec.setmulti( argnames=argnames, diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 52e564bd809..8abd054a60a 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -113,7 +113,7 @@ def _check_type(self) -> None: def _recursive_sequence_map(f, x): """Recursively map a function over a sequence of arbitrary depth""" - if isinstance(x, (list, tuple)): + if isinstance(x, list | tuple): seq_type = type(x) return seq_type(_recursive_sequence_map(f, xi) for xi in x) elif _is_sequence_like(x): @@ -245,7 +245,7 @@ def _repr_compare(self, other_side: Mapping[object, float]) -> list[str]: max_rel_diff = -math.inf different_ids = [] for (approx_key, approx_value), other_value in zip( - approx_side_as_map.items(), other_side.values() + approx_side_as_map.items(), other_side.values(), strict=True ): if approx_value != other_value: if approx_value.expected is not None and other_value is not None: @@ -327,7 +327,7 @@ def _repr_compare(self, other_side: Sequence[float]) -> list[str]: max_rel_diff = -math.inf different_ids = [] for i, (approx_value, other_value) in enumerate( - zip(approx_side_as_map, other_side) + zip(approx_side_as_map, other_side, strict=True) ): if approx_value != other_value: try: @@ -365,7 +365,7 @@ def __eq__(self, actual) -> bool: return super().__eq__(actual) def _yield_comparisons(self, actual): - return zip(actual, self.expected) + return zip(actual, self.expected, strict=True) def _check_type(self) -> None: __tracebackhide__ = True @@ -394,7 +394,7 @@ def __repr__(self) -> str: # handle complex numbers, e.g. (inf + 1j). if ( isinstance(self.expected, bool) - or (not isinstance(self.expected, (Complex, Decimal))) + or (not isinstance(self.expected, Complex | Decimal)) or math.isinf(abs(self.expected) or isinstance(self.expected, bool)) ): return str(self.expected) @@ -447,8 +447,8 @@ def is_bool(val: Any) -> bool: # __sub__, and __float__ are defined. Also, consider bool to be # non-numeric, even though it has the required arithmetic. if is_bool(self.expected) or not ( - isinstance(self.expected, (Complex, Decimal)) - and isinstance(actual, (Complex, Decimal)) + isinstance(self.expected, Complex | Decimal) + and isinstance(actual, Complex | Decimal) ): return False @@ -766,7 +766,7 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: cls = ApproxNumpy elif _is_sequence_like(expected): cls = ApproxSequenceLike - elif isinstance(expected, Collection) and not isinstance(expected, (str, bytes)): + elif isinstance(expected, Collection) and not isinstance(expected, str | bytes): msg = f"pytest.approx() only supports ordered sequences, but got: {expected!r}" raise TypeError(msg) else: @@ -779,7 +779,7 @@ def _is_sequence_like(expected: object) -> bool: return ( hasattr(expected, "__getitem__") and isinstance(expected, Sized) - and not isinstance(expected, (str, bytes)) + and not isinstance(expected, str | bytes) ) diff --git a/src/_pytest/raises.py b/src/_pytest/raises.py index 78fae6ddcde..9066779a8af 100644 --- a/src/_pytest/raises.py +++ b/src/_pytest/raises.py @@ -29,9 +29,9 @@ # for some reason Sphinx does not play well with 'from types import TracebackType' import types + from typing import TypeGuard from typing_extensions import ParamSpec - from typing_extensions import TypeGuard from typing_extensions import TypeVar P = ParamSpec("P") diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 480ffae1f9c..2122c021020 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -459,7 +459,7 @@ def toterminal(self, out: TerminalWriter) -> None: def pytest_report_to_serializable( report: CollectReport | TestReport, ) -> dict[str, Any] | None: - if isinstance(report, (TestReport, CollectReport)): + if isinstance(report, TestReport | CollectReport): data = report._to_json() data["$report_type"] = report.__class__.__name__ return data diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index 26e4e838b77..ec08025d897 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -262,7 +262,7 @@ def check_interactive_exception(call: CallInfo[object], report: BaseReport) -> b if hasattr(report, "wasxfail"): # Exception was expected. return False - if isinstance(call.excinfo.value, (Skipped, bdb.BdbQuit)): + if isinstance(call.excinfo.value, Skipped | bdb.BdbQuit): # Special control flow exception. return False return True diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index ec118f2c92f..6ba30c4574c 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -10,7 +10,6 @@ import platform import sys import traceback -from typing import Optional from _pytest.config import Config from _pytest.config import hookimpl @@ -236,7 +235,7 @@ def evaluate_xfail_marks(item: Item) -> Xfail | None: # Saves the xfail mark evaluation. Can be refreshed during call if None. -xfailed_key = StashKey[Optional[Xfail]]() +xfailed_key = StashKey[Xfail | None]() @hookimpl(tryfirst=True) @@ -285,7 +284,7 @@ def pytest_runtest_makereport( raises = xfailed.raises if raises is None or ( ( - isinstance(raises, (type, tuple)) + isinstance(raises, type | tuple) and isinstance(call.excinfo.value, raises) ) or ( diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index b18ac56b811..341173ee6ac 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -14,7 +14,6 @@ import traceback import types from typing import TYPE_CHECKING -from typing import Union import _pytest._code from _pytest.compat import is_async_function @@ -43,10 +42,10 @@ import twisted.trial.unittest -_SysExcInfoType = Union[ - tuple[type[BaseException], BaseException, types.TracebackType], - tuple[None, None, None], -] +_SysExcInfoType = ( + tuple[type[BaseException], BaseException, types.TracebackType] + | tuple[None, None, None] +) def pytest_pycollect_makeitem( diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index 7064d1daa9b..ab62e93b223 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -18,8 +18,7 @@ @contextlib.contextmanager def ignore_encoding_warning(): with warnings.catch_warnings(): - if sys.version_info >= (3, 10): - warnings.simplefilter("ignore", EncodingWarning) # noqa: F821 + warnings.simplefilter("ignore", EncodingWarning) yield diff --git a/testing/conftest.py b/testing/conftest.py index 25abce913ea..663c9d80b3e 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -111,7 +111,7 @@ def write(self, msg, **kw): def _write_source(self, lines, indents=()): if not indents: indents = [""] * len(lines) - for indent, line in zip(indents, lines): + for indent, line in zip(indents, lines, strict=True): self.line(indent + line) def line(self, line, **kw): diff --git a/testing/python/approx.py b/testing/python/approx.py index 06633b544ec..4756b90b267 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -77,7 +77,7 @@ def do_assert(lhs, rhs, expected_message, verbosity_level=0): ) for i, (obtained_line, expected_line) in enumerate( - zip(obtained_message, expected_message) + zip(obtained_message, expected_message, strict=True) ): regex = re.compile(expected_line) assert regex.match(obtained_line) is not None, ( diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index fb76fe6cf96..b58ddc6e162 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -1,6 +1,7 @@ # mypy: allow-untyped-defs from __future__ import annotations +from itertools import zip_longest import os from pathlib import Path import sys @@ -3043,7 +3044,7 @@ def test_4(modarg, arg): ] import pprint - pprint.pprint(list(zip(values, expected))) + pprint.pprint(list(zip_longest(values, expected))) assert values == expected def test_parametrized_fixture_teardown_order(self, pytester: Pytester) -> None: diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 7ae26de3a18..010c22f5c0c 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -429,7 +429,7 @@ def test_idmaker_autoname(self) -> None: def test_idmaker_with_bytes_regex(self) -> None: result = IdMaker( - ("a"), [pytest.param(re.compile(b"foo"), 1.0)], None, None, None, None, None + ("a"), [pytest.param(re.compile(b"foo"))], None, None, None, None, None ).make_unique_parameterset_ids() assert result == ["foo"] diff --git a/testing/python/raises.py b/testing/python/raises.py index 40f9afea3ba..9e3fe304528 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -395,8 +395,8 @@ class NotAnException: def test_issue_11872(self) -> None: """Regression test for #11872. - urllib.error.HTTPError on Python<=3.9 raises KeyError instead of - AttributeError on invalid attribute access. + urllib.error.HTTPError on some Python 3.10/11 minor releases raises + KeyError instead of AttributeError on invalid attribute access. https://github.com/python/cpython/issues/98778 """ diff --git a/testing/python/raises_group.py b/testing/python/raises_group.py index 386e127a13d..6b9f98201dd 100644 --- a/testing/python/raises_group.py +++ b/testing/python/raises_group.py @@ -292,7 +292,7 @@ def test_catch_unwrapped_exceptions() -> None: # if users want one of several exception types they need to use a RaisesExc # (which the error message suggests) with RaisesGroup( - RaisesExc(check=lambda e: isinstance(e, (SyntaxError, ValueError))), + RaisesExc(check=lambda e: isinstance(e, SyntaxError | ValueError)), allow_unwrapped=True, ): raise ValueError diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index f13c71352de..18bc32dc86f 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -132,7 +132,7 @@ def test_location_is_set(self) -> None: if isinstance(node, ast.Import): continue for n in [node, *ast.iter_child_nodes(node)]: - assert isinstance(n, (ast.stmt, ast.expr)) + assert isinstance(n, ast.stmt | ast.expr) for location in [ (n.lineno, n.col_offset), (n.end_lineno, n.end_col_offset), @@ -2263,10 +2263,6 @@ def test_get_cache_dir(self, monkeypatch, prefix, source, expected) -> None: assert get_cache_dir(Path(source)) == Path(expected) - @pytest.mark.skipif( - sys.version_info[:2] == (3, 9) and sys.platform.startswith("win"), - reason="#9298", - ) def test_sys_pycache_prefix_integration( self, tmp_path, monkeypatch, pytester: Pytester ) -> None: diff --git a/testing/test_compat.py b/testing/test_compat.py index 3722bfcfb40..fa9e259647f 100644 --- a/testing/test_compat.py +++ b/testing/test_compat.py @@ -16,7 +16,7 @@ if TYPE_CHECKING: - from typing_extensions import Literal + from typing import Literal def test_real_func_loop_limit() -> None: diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 9f18a90d100..4f9702149a8 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -661,8 +661,7 @@ def test_func(arg1): node = dom.get_first_by_tag("testsuite") node.assert_attr(failures=3, tests=3) tnodes = node.find_by_tag("testcase") - assert len(tnodes) == 3 - for tnode, char in zip(tnodes, "<&'"): + for tnode, char in zip(tnodes, "<&'", strict=True): tnode.assert_attr( classname="test_failure_escape", name=f"test_func[{char}]" ) diff --git a/testing/test_reports.py b/testing/test_reports.py index 7a893981838..5ffbde563b6 100644 --- a/testing/test_reports.py +++ b/testing/test_reports.py @@ -101,8 +101,7 @@ def test_repr_entry(): rep_entries = rep.longrepr.reprtraceback.reprentries a_entries = a.longrepr.reprtraceback.reprentries - assert len(rep_entries) == len(a_entries) # python < 3.10 zip(strict=True) - for a_entry, rep_entry in zip(a_entries, rep_entries): + for a_entry, rep_entry in zip(a_entries, rep_entries, strict=True): assert isinstance(rep_entry, ReprEntry) assert rep_entry.reprfileloc is not None assert rep_entry.reprfuncargs is not None @@ -146,8 +145,7 @@ def test_repr_entry_native(): rep_entries = rep.longrepr.reprtraceback.reprentries a_entries = a.longrepr.reprtraceback.reprentries - assert len(rep_entries) == len(a_entries) # python < 3.10 zip(strict=True) - for rep_entry, a_entry in zip(rep_entries, a_entries): + for rep_entry, a_entry in zip(rep_entries, a_entries, strict=True): assert isinstance(rep_entry, ReprEntryNative) assert rep_entry.lines == a_entry.lines diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 9a6c2c4b6aa..3a3b4057e45 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -1,7 +1,6 @@ # mypy: allow-untyped-defs from __future__ import annotations -import sys import textwrap from _pytest.pytester import Pytester @@ -1136,22 +1135,13 @@ def test_func(): """ ) result = pytester.runpytest() - markline = " ^" - pypy_version_info = getattr(sys, "pypy_version_info", None) - if pypy_version_info is not None: - markline = markline[7:] - - if sys.version_info >= (3, 10): - expected = [ - "*ERROR*test_nameerror*", - "*asd*", - "", - "During handling of the above exception, another exception occurred:", - ] - else: - expected = [ - "*ERROR*test_nameerror*", - ] + + expected = [ + "*ERROR*test_nameerror*", + "*asd*", + "", + "During handling of the above exception, another exception occurred:", + ] expected += [ "*evaluating*skipif*condition*", @@ -1159,7 +1149,7 @@ def test_func(): "*ERROR*test_syntax*", "*evaluating*xfail*condition*", " syntax error", - markline, + " ^", "SyntaxError: invalid syntax", "*1 pass*2 errors*", ] diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 2a3f4446a11..bacce108b42 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -2677,7 +2677,7 @@ def test_len_dict(): [ "*short test summary info*", f"*{list(range(10))}*", - f"*{dict(zip(range(10), range(10)))}*", + f"*{dict(zip(range(10), range(10), strict=True))}*", ] ) diff --git a/testing/test_warnings.py b/testing/test_warnings.py index b1c64dc9332..ff7ee4915c9 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -280,8 +280,7 @@ def pytest_warning_recorded(self, warning_message, when, nodeid, location): ("call warning", "runtest", "test_warning_recorded_hook.py::test_func"), ("teardown warning", "runtest", "test_warning_recorded_hook.py::test_func"), ] - assert len(collected) == len(expected) # python < 3.10 zip(strict=True) - for collected_result, expected_result in zip(collected, expected): + for collected_result, expected_result in zip(collected, expected, strict=True): assert collected_result[0] == expected_result[0], str(collected) assert collected_result[1] == expected_result[1], str(collected) assert collected_result[2] == expected_result[2], str(collected) diff --git a/testing/typing_checks.py b/testing/typing_checks.py index 8a316580a25..3ee2dfb3019 100644 --- a/testing/typing_checks.py +++ b/testing/typing_checks.py @@ -9,7 +9,6 @@ import contextlib from typing import Literal -from typing import Optional from typing_extensions import assert_type @@ -52,10 +51,10 @@ class Foo(TypedDict): def check_raises_is_a_context_manager(val: bool) -> None: with pytest.raises(RuntimeError) if val else contextlib.nullcontext() as excinfo: pass - assert_type(excinfo, Optional[pytest.ExceptionInfo[RuntimeError]]) + assert_type(excinfo, pytest.ExceptionInfo[RuntimeError] | None) # Issue #12941. def check_testreport_attributes(report: TestReport) -> None: assert_type(report.when, Literal["setup", "call", "teardown"]) - assert_type(report.location, tuple[str, Optional[int], str]) + assert_type(report.location, tuple[str, int | None, str]) diff --git a/testing/typing_raises_group.py b/testing/typing_raises_group.py index c7dd16991ac..081ffd59bca 100644 --- a/testing/typing_raises_group.py +++ b/testing/typing_raises_group.py @@ -1,8 +1,7 @@ from __future__ import annotations +from collections.abc import Callable import sys -from typing import Callable -from typing import Union from typing_extensions import assert_type @@ -160,10 +159,7 @@ def check_nested_raisesgroups_contextmanager() -> None: assert_type( excinfo.value.exceptions[0], # this union is because of how typeshed defines .exceptions - Union[ - ExceptionGroup[ValueError], - ExceptionGroup[ExceptionGroup[ValueError]], - ], + ExceptionGroup[ValueError] | ExceptionGroup[ExceptionGroup[ValueError]], ) @@ -240,8 +236,5 @@ def check_check_typing() -> None: # `BaseExceptiongroup` should perhaps be `ExceptionGroup`, but close enough assert_type( RaisesGroup(ValueError).check, - Union[ - Callable[[BaseExceptionGroup[ValueError]], bool], - None, - ], + Callable[[BaseExceptionGroup[ValueError]], bool] | None, ) diff --git a/tox.ini b/tox.ini index 3fe7865a289..fa86c9c4403 100644 --- a/tox.ini +++ b/tox.ini @@ -4,18 +4,17 @@ minversion = 3.20.0 distshare = {homedir}/.tox/distshare envlist = linting - py39 py310 py311 py312 py313 py314 pypy3 - py39-{pexpect,xdist,twisted24,twisted25,asynctest,numpy,pluggymain,pylib} + py310-{pexpect,xdist,twisted24,twisted25,asynctest,numpy,pluggymain,pylib} doctesting doctesting-coverage plugins - py39-freeze + py310-freeze docs docs-checklinks @@ -58,10 +57,11 @@ setenv = # See https://docs.python.org/3/library/io.html#io-encoding-warning # If we don't enable this, neither can any of our downstream users! - PYTHONWARNDEFAULTENCODING=1 + # pylib is not PYTHONWARNDEFAULTENCODING clean, so don't set for it. + !pylib: PYTHONWARNDEFAULTENCODING=1 # Configuration to run with coverage similar to CI, e.g. - # "tox -e py39-coverage". + # "tox -e py313-coverage". coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess coverage: COVERAGE_FILE={toxinidir}/.coverage @@ -182,7 +182,7 @@ commands = pytest pytest_twisted_integration.py pytest simple_integration.py --force-sugar --flakes -[testenv:py39-freeze] +[testenv:py310-freeze] description = test pytest frozen with `pyinstaller` under `{basepython}` changedir = testing/freeze From f586c7972c3128ee6bdb86538ed9414d892c1a7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Sep 2025 05:53:46 +0000 Subject: [PATCH 106/270] [automated] Update plugin list (#13726) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 232 ++++++++++++++++++------------- 1 file changed, 132 insertions(+), 100 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index b382ac0a8cf..f12bb80e3a9 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =6.1.0 :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Jan 10, 2023 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-aiohttp-mock` Send responses to aiohttp. Sep 13, 2025 3 - Alpha pytest>=8 :pypi:`pytest-aiomoto` pytest-aiomoto Jun 24, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jan 02, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 26, 2024 5 - Production/Stable pytest>=8.3.4 @@ -91,9 +92,9 @@ This list contains 1708 plugins. :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Dec 02, 2023 5 - Production/Stable pytest ; extra == 'test' :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-api-cov` Api Coverage Report Pytest Plugin Aug 26, 2025 N/A pytest>=8.4.1 + :pypi:`pytest-api-cov` Pytest Plugin to provide API Coverage statistics for Python Web Frameworks Sep 11, 2025 N/A pytest>=6.0.0 :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Aug 28, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Sep 10, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -125,7 +126,7 @@ This list contains 1708 plugins. :pypi:`pytest_async` pytest-async - Run your coroutine in event loop without decorator Feb 26, 2020 N/A N/A :pypi:`pytest-async-benchmark` pytest-async-benchmark: Modern pytest benchmarking for async code. 🚀 May 28, 2025 N/A pytest>=8.3.5 :pypi:`pytest-async-generators` Pytest fixtures for async generators Jul 05, 2023 N/A N/A - :pypi:`pytest-asyncio` Pytest support for asyncio Jul 16, 2025 5 - Production/Stable pytest<9,>=8.2 + :pypi:`pytest-asyncio` Pytest support for asyncio Sep 12, 2025 5 - Production/Stable pytest<9,>=8.2 :pypi:`pytest-asyncio-concurrent` Pytest plugin to execute python async tests concurrently. May 17, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jun 24, 2025 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) @@ -171,7 +172,7 @@ This list contains 1708 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Sep 03, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Sep 12, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -190,9 +191,10 @@ This list contains 1708 plugins. :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A - :pypi:`pytest-b-logger` BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. Sep 06, 2025 N/A pytest + :pypi:`pytest-b-logger` BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. Sep 11, 2025 N/A pytest :pypi:`pytest-blue` A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. Sep 05, 2022 N/A N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A + :pypi:`pytest-boardfarm3` Integrate boardfarm as a pytest plugin. Sep 12, 2025 N/A pytest :pypi:`pytest-boilerplate` The pytest plugin for your Django Boilerplate. Sep 12, 2024 5 - Production/Stable pytest>=4.0.0 :pypi:`pytest-bonsai` Apr 08, 2025 N/A pytest>=6 :pypi:`pytest-boost-xml` Plugin for pytest to generate boost xml reports Nov 30, 2022 4 - Beta N/A @@ -319,7 +321,7 @@ This list contains 1708 plugins. :pypi:`pytest-copier` A pytest plugin to help testing Copier templates Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A - :pypi:`pytest-cov` Pytest plugin for measuring coverage. Sep 06, 2025 5 - Production/Stable pytest>=6.2.5 + :pypi:`pytest-cov` Pytest plugin for measuring coverage. Sep 09, 2025 5 - Production/Stable pytest>=7 :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jun 28, 2023 4 - Beta N/A @@ -354,7 +356,7 @@ This list contains 1708 plugins. :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-dashboard` Jun 02, 2025 N/A pytest<8.0.0,>=7.4.3 :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A - :pypi:`pytest-databases` Reusable database fixtures for any and all databases. Jun 14, 2025 4 - Beta pytest + :pypi:`pytest-databases` Reusable database fixtures for any and all databases. Sep 11, 2025 4 - Beta pytest :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest :pypi:`pytest-datadir` pytest plugin for test data directories and files Jul 30, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Apr 06, 2023 5 - Production/Stable pytest (>=7.1) @@ -397,7 +399,7 @@ This list contains 1708 plugins. :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest :pypi:`pytest-deselect-if` A plugin to deselect pytests tests rather than using skipif Dec 26, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-devpi-server` DevPI server fixture for py.test Oct 17, 2024 5 - Production/Stable pytest - :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Sep 05, 2025 N/A pytest + :pypi:`pytest-dfm` pytest-dfm provides a pytest integration for DV Flow Manager, a build system for silicon design Sep 13, 2025 N/A pytest :pypi:`pytest-dhos` Common fixtures for pytest in DHOS services and libraries Sep 07, 2022 N/A N/A :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest @@ -477,7 +479,7 @@ This list contains 1708 plugins. :pypi:`pytest-dpg` pytest-dpg is a pytest plugin for testing Dear PyGui (DPG) applications Aug 13, 2024 N/A N/A :pypi:`pytest-draw` Pytest plugin for randomly selecting a specific number of tests Mar 21, 2023 3 - Alpha pytest :pypi:`pytest-drf` A Django REST framework plugin for pytest. Jul 12, 2022 5 - Production/Stable pytest (>=3.7) - :pypi:`pytest-drill-sergeant` A pytest plugin that enforces test quality standards through automatic marker detection and AAA structure validation Sep 02, 2025 4 - Beta pytest>=7.0.0 + :pypi:`pytest-drill-sergeant` A pytest plugin that enforces test quality standards through automatic marker detection and AAA structure validation Sep 12, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection Mar 04, 2024 5 - Production/Stable pytest >=7 :pypi:`pytest-dryci` Test caching plugin for pytest Sep 27, 2024 4 - Beta N/A @@ -507,15 +509,15 @@ This list contains 1708 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Aug 11, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Aug 11, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Aug 11, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Aug 11, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Aug 11, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Aug 11, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Aug 11, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Aug 11, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Aug 11, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Sep 10, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Sep 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Sep 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Sep 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Sep 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Sep 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Sep 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Sep 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Sep 10, 2025 5 - Production/Stable N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 09, 2023 4 - Beta pytest (==7.0.1) @@ -622,10 +624,11 @@ This list contains 1708 plugins. :pypi:`pytest-fixture-remover` A LibCST codemod to remove pytest fixtures applied via the usefixtures decorator, as well as its parametrizations. Feb 14, 2024 5 - Production/Stable N/A :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-fixtures-fixtures` Handy fixtues to access your fixtures from your _pytest tests. Sep 09, 2025 4 - Beta pytest>=8.4.1 :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Apr 30, 2025 6 - Mature pytest :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Nov 09, 2024 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Oct 25, 2024 5 - Production/Stable pytest + :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Sep 09, 2025 5 - Production/Stable pytest :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Mar 01, 2022 5 - Production/Stable pytest (>=7.0) :pypi:`pytest-flake-detection` Continuously runs your tests to detect flaky tests Nov 29, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Oct 26, 2022 4 - Beta pytest (>=2.7.1) @@ -686,14 +689,14 @@ This list contains 1708 plugins. :pypi:`pytest-gitlabci-parallelized` Parallelize pytest across GitLab CI workers. Mar 08, 2023 N/A N/A :pypi:`pytest-gitlab-code-quality` Collects warnings while testing and generates a GitLab Code Quality Report. Sep 09, 2024 N/A pytest>=8.1.1 :pypi:`pytest-gitlab-fold` Folds output sections in GitLab CI build log Dec 31, 2023 4 - Beta pytest >=2.6.0 - :pypi:`pytest-gitscope` A pragmatic pytest plugin that runs only the tests that matter, and ship faster Sep 05, 2025 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-gitscope` A pragmatic pytest plugin that runs only the tests that matter, and ship faster Sep 07, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 20, 2025 4 - Beta pytest<=8.4.1 :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-goldie` A plugin to support golden tests with pytest. May 23, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest - :pypi:`pytest-google-cloud-storage` Pytest custom features, e.g. fixtures and various tests. Aimed to emulate Google Cloud Storage service May 22, 2025 N/A pytest==8.3.5 + :pypi:`pytest-google-cloud-storage` Pytest custom features, e.g. fixtures and various tests. Aimed to emulate Google Cloud Storage service Sep 11, 2025 N/A pytest>=8.0.0 :pypi:`pytest-grader` Pytest extension for scoring programming assignments. Aug 25, 2025 N/A pytest>=8 :pypi:`pytest-gradescope` A pytest plugin for Gradescope integration Apr 29, 2025 N/A N/A :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A @@ -722,7 +725,7 @@ This list contains 1708 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 06, 2025 3 - Alpha pytest==8.4.1 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 13, 2025 3 - Alpha pytest==8.4.1 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -744,7 +747,7 @@ This list contains 1708 plugins. :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A :pypi:`pytest-html-report-merger` May 22, 2024 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A - :pypi:`pytest-htmlx` Custom HTML report plugin for Pytest with charts and tables Aug 07, 2025 4 - Beta pytest + :pypi:`pytest-htmlx` Custom HTML report plugin for Pytest with charts and tables Sep 09, 2025 4 - Beta pytest :pypi:`pytest-http` Fixture "http" for http requests Aug 22, 2024 N/A pytest :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Sep 18, 2024 5 - Production/Stable pytest; extra == "test" :pypi:`pytest-httpchain` pytest plugin for HTTP testing using JSON files Aug 16, 2025 5 - Production/Stable N/A @@ -774,7 +777,7 @@ This list contains 1708 plugins. :pypi:`pytest-ignore-test-results` A pytest plugin to ignore test results. Feb 03, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-image-diff` Dec 31, 2024 3 - Alpha pytest :pypi:`pytest-image-snapshot` A pytest plugin for image snapshot management and comparison. Jul 16, 2025 4 - Beta pytest>=3.5.0 - :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. Aug 02, 2025 4 - Beta pytest>=8.0.0 + :pypi:`pytest-impacted` A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis. Sep 11, 2025 4 - Beta pytest>=8.0.0 :pypi:`pytest-import-check` pytest plugin to check whether Python modules can be imported Jul 19, 2024 3 - Alpha pytest>=8.1 :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-infinity` Jun 09, 2024 N/A pytest<9.0.0,>=8.0.0 @@ -812,7 +815,7 @@ This list contains 1708 plugins. :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest :pypi:`pytest-ipywidgets` Aug 20, 2025 N/A pytest - :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Jun 08, 2025 4 - Beta pytest + :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Sep 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 :pypi:`pytest-isort` py.test plugin to check import ordering using isort Mar 05, 2024 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 29, 2024 4 - Beta N/A @@ -838,7 +841,7 @@ This list contains 1708 plugins. :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-json-report-wip` A pytest plugin to report test results as JSON files Jul 23, 2025 4 - Beta pytest >=3.8.0 :pypi:`pytest-jsonschema` A pytest plugin to perform JSONSchema validations Apr 20, 2025 4 - Beta pytest>=6.2.0 - :pypi:`pytest-jsonschema-snapshot` Pytest plugin for automatic JSON Schema generation and validation from examples Sep 02, 2025 N/A pytest + :pypi:`pytest-jsonschema-snapshot` Pytest plugin for automatic JSON Schema generation and validation from examples Sep 13, 2025 N/A pytest :pypi:`pytest-jtr` pytest plugin supporting json test report output Jul 21, 2024 N/A pytest<8.0.0,>=7.1.2 :pypi:`pytest-jubilant` Add your description here Jul 28, 2025 N/A pytest>=8.3.5 :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest @@ -898,7 +901,7 @@ This list contains 1708 plugins. :pypi:`pytest-localserver` pytest plugin to test server connections locally. Oct 06, 2024 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Jun 07, 2023 4 - Beta pytest (>=6.0.0,<7.0.0) :pypi:`pytest-lock` pytest-lock is a pytest plugin that allows you to "lock" the results of unit tests, storing them in a local cache. This is particularly useful for tests that are resource-intensive or don't need to be run every time. When the tests are run subsequently, pytest-lock will compare the current results with the locked results and issue a warning if there are any discrepancies. Feb 03, 2024 N/A pytest (>=7.4.3,<8.0.0) - :pypi:`pytest-lockable` lockable resource plugin for pytest Jan 24, 2024 5 - Production/Stable pytest + :pypi:`pytest-lockable` lockable resource plugin for pytest Sep 08, 2025 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Dec 20, 2024 N/A pytest>=5.4 :pypi:`pytest-log` print log Aug 15, 2021 N/A pytest (>=3.8) :pypi:`pytest-logbook` py.test plugin to capture logbook log messages Nov 23, 2015 5 - Production/Stable pytest (>=2.8) @@ -908,7 +911,7 @@ This list contains 1708 plugins. :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-logging-strict` pytest fixture logging configured from packaged YAML May 20, 2025 3 - Alpha pytest - :pypi:`pytest-logikal` Common testing environment Aug 14, 2025 5 - Production/Stable pytest==8.4.1 + :pypi:`pytest-logikal` Common testing environment Sep 11, 2025 5 - Production/Stable pytest==8.4.2 :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-logscanner` Pytest plugin for logscanner (A logger for python logging outputting to easily viewable (and filterable) html files. Good for people not grep savey, and color higlighting and quickly changing filters might even bye useful for commandline wizards.) Sep 30, 2024 4 - Beta pytest>=8.2.2 :pypi:`pytest-loguru` Pytest Loguru Mar 20, 2024 5 - Production/Stable pytest; extra == "test" @@ -948,7 +951,7 @@ This list contains 1708 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Aug 18, 2025 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Sep 04, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Sep 10, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -976,7 +979,7 @@ This list contains 1708 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Mar 10, 2025 N/A pytest>=1.0 + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Sep 11, 2025 N/A pytest>=1.0 :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest @@ -1001,7 +1004,7 @@ This list contains 1708 plugins. :pypi:`pytest-mpiexec` pytest plugin for running individual tests with mpiexec Jul 29, 2024 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Feb 14, 2024 4 - Beta pytest :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Nov 15, 2022 4 - Beta pytest (>=6) - :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Jan 07, 2025 5 - Production/Stable pytest<9; extra == "test" + :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Sep 10, 2025 5 - Production/Stable pytest<9; extra == "test" :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jan 17, 2023 N/A pytest :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 05, 2024 N/A N/A @@ -1112,7 +1115,7 @@ This list contains 1708 plugins. :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-performancetotal` A performance plugin for pytest Aug 05, 2025 5 - Production/Stable N/A :pypi:`pytest-persistence` Pytest tool for persistent objects Aug 21, 2024 N/A N/A - :pypi:`pytest-pexpect` Pytest pexpect plugin. Aug 13, 2024 4 - Beta pytest>=6.2.0 + :pypi:`pytest-pexpect` Pytest pexpect plugin. Sep 10, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker May 18, 2025 5 - Production/Stable pytest>=7.4 :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) @@ -1132,9 +1135,9 @@ This list contains 1708 plugins. :pypi:`pytest-platform-markers` Markers for pytest to skip tests on specific platforms Sep 09, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-play` pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files Jun 12, 2019 5 - Production/Stable N/A :pypi:`pytest-playbook` Pytest plugin for reading playbooks. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Jan 31, 2025 N/A pytest<9.0.0,>=6.2.4 + :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Sep 08, 2025 N/A pytest<9.0.0,>=6.2.4 :pypi:`pytest_playwright_async` ASYNC Pytest plugin for Playwright Sep 28, 2024 N/A N/A - :pypi:`pytest-playwright-asyncio` A pytest wrapper with async fixtures for Playwright to automate web browsers Jan 31, 2025 N/A pytest<9.0.0,>=6.2.4 + :pypi:`pytest-playwright-asyncio` A pytest wrapper with async fixtures for Playwright to automate web browsers Sep 08, 2025 N/A pytest<9.0.0,>=6.2.4 :pypi:`pytest-playwright-axe` An axe-core integration for accessibility testing using Playwright Python. Mar 27, 2025 4 - Beta N/A :pypi:`pytest-playwright-enhanced` A pytest plugin for playwright python Mar 24, 2024 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A @@ -1145,7 +1148,7 @@ This list contains 1708 plugins. :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Aug 31, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Sep 13, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1240,7 +1243,7 @@ This list contains 1708 plugins. :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest :pypi:`pytest-random` py.test plugin to randomize tests Apr 28, 2013 3 - Alpha N/A - :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. Oct 25, 2024 5 - Production/Stable pytest + :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. Sep 12, 2025 5 - Production/Stable pytest :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Jun 22, 2025 5 - Production/Stable pytest @@ -1288,7 +1291,7 @@ This list contains 1708 plugins. :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jul 08, 2025 N/A pytest>=4.6.10 :pypi:`pytest-report-stream` A pytest plugin which allows to stream test reports at runtime Oct 22, 2023 4 - Beta N/A :pypi:`pytest-repo-structure` Pytest Repo Structure Mar 18, 2024 1 - Planning N/A - :pypi:`pytest-req` pytest requests plugin Aug 31, 2024 5 - Production/Stable pytest<9.0.0,>=8.3.2 + :pypi:`pytest-req` pytest requests plugin Sep 08, 2025 5 - Production/Stable pytest>=8.4.2 :pypi:`pytest-reqcov` A pytest plugin for requirement coverage tracking Jul 04, 2025 3 - Alpha pytest>=6.0 :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) @@ -1312,10 +1315,10 @@ This list contains 1708 plugins. :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Oct 24, 2024 5 - Production/Stable pytest + :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Sep 09, 2025 5 - Production/Stable pytest :pypi:`pytest-result-log` A pytest plugin that records the start, end, and result information of each use case in a log file Jan 10, 2024 N/A pytest>=7.2.0 :pypi:`pytest-result-notify` Default template for PDM package Apr 27, 2025 N/A pytest>=8.3.5 - :pypi:`pytest-results` Easily spot regressions in your tests. Jun 15, 2025 4 - Beta pytest + :pypi:`pytest-results` Easily spot regressions in your tests. Sep 10, 2025 4 - Beta pytest :pypi:`pytest-result-sender` Apr 20, 2023 N/A pytest>=7.3.1 :pypi:`pytest-result-sender-jms` Default template for PDM package May 22, 2025 N/A pytest>=8.3.5 :pypi:`pytest-result-sender-lj` Default template for PDM package Dec 17, 2024 N/A pytest>=8.3.4 @@ -1327,7 +1330,7 @@ This list contains 1708 plugins. :pypi:`pytest-retry-class` A pytest plugin to rerun entire class on failure Nov 24, 2024 N/A pytest>=5.3 :pypi:`pytest-reusable-testcases` Apr 28, 2023 N/A N/A :pypi:`pytest-revealtype-injector` Pytest plugin for replacing reveal_type() calls inside test functions with static and runtime type checking result comparison, for confirming type annotation validity. Mar 18, 2025 4 - Beta pytest<9,>=7.0 - :pypi:`pytest-reverse` Pytest plugin to reverse test order. Oct 25, 2024 5 - Production/Stable pytest + :pypi:`pytest-reverse` Pytest plugin to reverse test order. Sep 09, 2025 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Dec 12, 2024 4 - Beta pytest>=7.0 :pypi:`pytest-richer` Pytest plugin providing a Rich based reporter. Oct 27, 2023 3 - Alpha pytest :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) @@ -1364,7 +1367,7 @@ This list contains 1708 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 04, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 13, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. Sep 03, 2025 5 - Production/Stable pytest<9,>=7.4 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1376,7 +1379,7 @@ This list contains 1708 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 04, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 13, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1410,7 +1413,7 @@ This list contains 1708 plugins. :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-skip` A pytest plugin which allows to (de-)select or skip tests from a file. Apr 04, 2025 3 - Alpha pytest + :pypi:`pytest-skip` A pytest plugin which allows to (de-)select or skip tests from a file. Sep 12, 2025 3 - Alpha pytest :pypi:`pytest-skip-markers` Pytest Salt Plugin Aug 09, 2024 5 - Production/Stable pytest>=7.1.0 :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) @@ -1450,7 +1453,7 @@ This list contains 1708 plugins. :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. May 21, 2025 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A - :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. Jun 03, 2025 N/A pytest; extra == "test" + :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. Sep 08, 2025 N/A pytest; extra == "test" :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Apr 10, 2024 N/A pytest>7.0 :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jan 22, 2023 3 - Alpha pytest>=7 :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Apr 13, 2024 4 - Beta pytest>=8.1.1 @@ -1487,10 +1490,11 @@ This list contains 1708 plugins. :pypi:`pytest-stf` pytest plugin for openSTF Sep 24, 2024 N/A pytest>=5.0 :pypi:`pytest-stochastics` pytest plugin that allows selectively running tests several times and accepting \*some\* failures. Dec 01, 2024 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A + :pypi:`pytest-storage` Pytest plugin to store test artifacts Sep 12, 2025 3 - Alpha pytest>=8.4.2 :pypi:`pytest-store` Pytest plugin to store values from test runs Jul 30, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-streaming` Plugin for testing pubsub, pulsar, and kafka systems with pytest locally and in ci/cd May 28, 2025 5 - Production/Stable pytest>=8.3.5 :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-structlog` Structured logging assertions Jul 25, 2024 N/A pytest + :pypi:`pytest-structlog` Structured logging assertions Sep 10, 2025 N/A pytest :pypi:`pytest-structmpd` provide structured temporary directory Oct 17, 2018 N/A N/A :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) @@ -1611,7 +1615,7 @@ This list contains 1708 plugins. :pypi:`pytest-translations` Test your translation files. Sep 11, 2023 5 - Production/Stable pytest (>=7) :pypi:`pytest-travis-fold` Folds captured output sections in Travis CI build log Nov 29, 2017 4 - Beta pytest (>=2.6.0) :pypi:`pytest-trello` Plugin for py.test that integrates trello using markers Nov 20, 2015 5 - Production/Stable N/A - :pypi:`pytest-trepan` Pytest plugin for trepan debugger. Jul 28, 2018 5 - Production/Stable N/A + :pypi:`pytest-trepan` Pytest plugin for trepan debugger. Sep 11, 2025 5 - Production/Stable pytest>=4.0.0 :pypi:`pytest-trialtemp` py.test plugin for using the same _trial_temp working directory as trial Jun 08, 2015 N/A N/A :pypi:`pytest-trio` Pytest plugin for trio Nov 01, 2022 N/A pytest (>=7.2.0) :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Nov 04, 2022 4 - Beta pytest (>=5) @@ -1915,6 +1919,13 @@ This list contains 1708 plugins. Pytest \`client\` fixture for the Aiohttp + :pypi:`pytest-aiohttp-mock` + *last release*: Sep 13, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=8 + + Send responses to aiohttp. + :pypi:`pytest-aiomoto` *last release*: Jun 24, 2023, *status*: N/A, @@ -2147,11 +2158,11 @@ This list contains 1708 plugins. An ASGI middleware to populate OpenAPI Specification examples from pytest functions :pypi:`pytest-api-cov` - *last release*: Aug 26, 2025, + *last release*: Sep 11, 2025, *status*: N/A, - *requires*: pytest>=8.4.1 + *requires*: pytest>=6.0.0 - Api Coverage Report Pytest Plugin + Pytest Plugin to provide API Coverage statistics for Python Web Frameworks :pypi:`pytest-api-framework` *last release*: Jun 22, 2025, @@ -2161,7 +2172,7 @@ This list contains 1708 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Aug 28, 2025, + *last release*: Sep 10, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2385,7 +2396,7 @@ This list contains 1708 plugins. Pytest fixtures for async generators :pypi:`pytest-asyncio` - *last release*: Jul 16, 2025, + *last release*: Sep 12, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9,>=8.2 @@ -2707,7 +2718,7 @@ This list contains 1708 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Sep 03, 2025, + *last release*: Sep 12, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -2840,7 +2851,7 @@ This list contains 1708 plugins. pytest plugin to mark a test as blocker and skip all other tests :pypi:`pytest-b-logger` - *last release*: Sep 06, 2025, + *last release*: Sep 11, 2025, *status*: N/A, *requires*: pytest @@ -2860,6 +2871,13 @@ This list contains 1708 plugins. Local continuous test runner with pytest and watchdog. + :pypi:`pytest-boardfarm3` + *last release*: Sep 12, 2025, + *status*: N/A, + *requires*: pytest + + Integrate boardfarm as a pytest plugin. + :pypi:`pytest-boilerplate` *last release*: Sep 12, 2024, *status*: 5 - Production/Stable, @@ -3743,9 +3761,9 @@ This list contains 1708 plugins. count erros and send email :pypi:`pytest-cov` - *last release*: Sep 06, 2025, + *last release*: Sep 09, 2025, *status*: 5 - Production/Stable, - *requires*: pytest>=6.2.5 + *requires*: pytest>=7 Pytest plugin for measuring coverage. @@ -3988,7 +4006,7 @@ This list contains 1708 plugins. Useful functions for managing data for pytest fixtures :pypi:`pytest-databases` - *last release*: Jun 14, 2025, + *last release*: Sep 11, 2025, *status*: 4 - Beta, *requires*: pytest @@ -4289,7 +4307,7 @@ This list contains 1708 plugins. DevPI server fixture for py.test :pypi:`pytest-dfm` - *last release*: Sep 05, 2025, + *last release*: Sep 13, 2025, *status*: N/A, *requires*: pytest @@ -4849,7 +4867,7 @@ This list contains 1708 plugins. A Django REST framework plugin for pytest. :pypi:`pytest-drill-sergeant` - *last release*: Sep 02, 2025, + *last release*: Sep 12, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -5059,63 +5077,63 @@ This list contains 1708 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-idf` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: Aug 11, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -5863,6 +5881,13 @@ This list contains 1708 plugins. Common fixtures for pytest + :pypi:`pytest-fixtures-fixtures` + *last release*: Sep 09, 2025, + *status*: 4 - Beta, + *requires*: pytest>=8.4.1 + + Handy fixtues to access your fixtures from your _pytest tests. + :pypi:`pytest-fixture-tools` *last release*: Apr 30, 2025, *status*: 6 - Mature, @@ -5885,7 +5910,7 @@ This list contains 1708 plugins. pytest plugin to check FLAKE8 requirements :pypi:`pytest-flake8-path` - *last release*: Oct 25, 2024, + *last release*: Sep 09, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -6312,7 +6337,7 @@ This list contains 1708 plugins. Folds output sections in GitLab CI build log :pypi:`pytest-gitscope` - *last release*: Sep 05, 2025, + *last release*: Sep 07, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0.0 @@ -6361,9 +6386,9 @@ This list contains 1708 plugins. Notify google chat channel for test results :pypi:`pytest-google-cloud-storage` - *last release*: May 22, 2025, + *last release*: Sep 11, 2025, *status*: N/A, - *requires*: pytest==8.3.5 + *requires*: pytest>=8.0.0 Pytest custom features, e.g. fixtures and various tests. Aimed to emulate Google Cloud Storage service @@ -6564,7 +6589,7 @@ This list contains 1708 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Sep 06, 2025, + *last release*: Sep 13, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.1 @@ -6718,7 +6743,7 @@ This list contains 1708 plugins. pytest plugin for generating HTML reports :pypi:`pytest-htmlx` - *last release*: Aug 07, 2025, + *last release*: Sep 09, 2025, *status*: 4 - Beta, *requires*: pytest @@ -6928,7 +6953,7 @@ This list contains 1708 plugins. A pytest plugin for image snapshot management and comparison. :pypi:`pytest-impacted` - *last release*: Aug 02, 2025, + *last release*: Sep 11, 2025, *status*: 4 - Beta, *requires*: pytest>=8.0.0 @@ -7194,7 +7219,7 @@ This list contains 1708 plugins. :pypi:`pytest-isolate` - *last release*: Jun 08, 2025, + *last release*: Sep 08, 2025, *status*: 4 - Beta, *requires*: pytest @@ -7376,7 +7401,7 @@ This list contains 1708 plugins. A pytest plugin to perform JSONSchema validations :pypi:`pytest-jsonschema-snapshot` - *last release*: Sep 02, 2025, + *last release*: Sep 13, 2025, *status*: N/A, *requires*: pytest @@ -7796,7 +7821,7 @@ This list contains 1708 plugins. pytest-lock is a pytest plugin that allows you to "lock" the results of unit tests, storing them in a local cache. This is particularly useful for tests that are resource-intensive or don't need to be run every time. When the tests are run subsequently, pytest-lock will compare the current results with the locked results and issue a warning if there are any discrepancies. :pypi:`pytest-lockable` - *last release*: Jan 24, 2024, + *last release*: Sep 08, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -7866,9 +7891,9 @@ This list contains 1708 plugins. pytest fixture logging configured from packaged YAML :pypi:`pytest-logikal` - *last release*: Aug 14, 2025, + *last release*: Sep 11, 2025, *status*: 5 - Production/Stable, - *requires*: pytest==8.4.1 + *requires*: pytest==8.4.2 Common testing environment @@ -8146,7 +8171,7 @@ This list contains 1708 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Sep 04, 2025, + *last release*: Sep 10, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8342,7 +8367,7 @@ This list contains 1708 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Mar 10, 2025, + *last release*: Sep 11, 2025, *status*: N/A, *requires*: pytest>=1.0 @@ -8517,7 +8542,7 @@ This list contains 1708 plugins. low-startup-overhead, scalable, distributed-testing pytest plugin :pypi:`pytest-mqtt` - *last release*: Jan 07, 2025, + *last release*: Sep 10, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9; extra == "test" @@ -9294,7 +9319,7 @@ This list contains 1708 plugins. Pytest tool for persistent objects :pypi:`pytest-pexpect` - *last release*: Aug 13, 2024, + *last release*: Sep 10, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 @@ -9434,7 +9459,7 @@ This list contains 1708 plugins. Pytest plugin for reading playbooks. :pypi:`pytest-playwright` - *last release*: Jan 31, 2025, + *last release*: Sep 08, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=6.2.4 @@ -9448,7 +9473,7 @@ This list contains 1708 plugins. ASYNC Pytest plugin for Playwright :pypi:`pytest-playwright-asyncio` - *last release*: Jan 31, 2025, + *last release*: Sep 08, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=6.2.4 @@ -9525,7 +9550,7 @@ This list contains 1708 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Aug 31, 2025, + *last release*: Sep 13, 2025, *status*: N/A, *requires*: pytest @@ -10190,7 +10215,7 @@ This list contains 1708 plugins. py.test plugin to randomize tests :pypi:`pytest-randomly` - *last release*: Oct 25, 2024, + *last release*: Sep 12, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -10526,9 +10551,9 @@ This list contains 1708 plugins. Pytest Repo Structure :pypi:`pytest-req` - *last release*: Aug 31, 2024, + *last release*: Sep 08, 2025, *status*: 5 - Production/Stable, - *requires*: pytest<9.0.0,>=8.3.2 + *requires*: pytest>=8.4.2 pytest requests plugin @@ -10694,7 +10719,7 @@ This list contains 1708 plugins. :pypi:`pytest-restrict` - *last release*: Oct 24, 2024, + *last release*: Sep 09, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -10715,7 +10740,7 @@ This list contains 1708 plugins. Default template for PDM package :pypi:`pytest-results` - *last release*: Jun 15, 2025, + *last release*: Sep 10, 2025, *status*: 4 - Beta, *requires*: pytest @@ -10799,7 +10824,7 @@ This list contains 1708 plugins. Pytest plugin for replacing reveal_type() calls inside test functions with static and runtime type checking result comparison, for confirming type annotation validity. :pypi:`pytest-reverse` - *last release*: Oct 25, 2024, + *last release*: Sep 09, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -11058,7 +11083,7 @@ This list contains 1708 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Sep 04, 2025, + *last release*: Sep 13, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11142,7 +11167,7 @@ This list contains 1708 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Sep 04, 2025, + *last release*: Sep 13, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11380,7 +11405,7 @@ This list contains 1708 plugins. Allow for multiple processes to log to a single file :pypi:`pytest-skip` - *last release*: Apr 04, 2025, + *last release*: Sep 12, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -11660,7 +11685,7 @@ This list contains 1708 plugins. py.test plugin to spawn process and communicate with them. :pypi:`pytest-spec` - *last release*: Jun 03, 2025, + *last release*: Sep 08, 2025, *status*: N/A, *requires*: pytest; extra == "test" @@ -11918,6 +11943,13 @@ This list contains 1708 plugins. A plugin to pytest stoq + :pypi:`pytest-storage` + *last release*: Sep 12, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=8.4.2 + + Pytest plugin to store test artifacts + :pypi:`pytest-store` *last release*: Jul 30, 2025, *status*: 3 - Alpha, @@ -11940,7 +11972,7 @@ This list contains 1708 plugins. A Pytest plugin that allows you to loop tests for a user defined amount of time. :pypi:`pytest-structlog` - *last release*: Jul 25, 2024, + *last release*: Sep 10, 2025, *status*: N/A, *requires*: pytest @@ -12787,9 +12819,9 @@ This list contains 1708 plugins. Plugin for py.test that integrates trello using markers :pypi:`pytest-trepan` - *last release*: Jul 28, 2018, + *last release*: Sep 11, 2025, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest>=4.0.0 Pytest plugin for trepan debugger. From d4ea714d60b21efed82887b6c29245d72f7875e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 07:57:10 +0200 Subject: [PATCH 107/270] build(deps): Bump pytest-cov in /testing/plugins_integration (#13730) Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.3.0 to 7.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.3.0...v7.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index fbdee7bc2ec..a3f18747b95 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -2,7 +2,7 @@ anyio[trio]==4.10.0 django==5.2.1 pytest-asyncio==1.1.0 pytest-bdd==8.1.0 -pytest-cov==6.3.0 +pytest-cov==7.0.0 pytest-django==4.11.1 pytest-flakes==4.0.5 pytest-html==4.1.1 From 5366cd2d4b79fd231cecb3efda39c08774f937e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 08:42:10 +0200 Subject: [PATCH 108/270] build(deps): Bump pytest-asyncio in /testing/plugins_integration (#13729) Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-version: 1.2.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pierre Sassoulas --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index a3f18747b95..f8095007751 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[trio]==4.10.0 django==5.2.1 -pytest-asyncio==1.1.0 +pytest-asyncio==1.2.0 pytest-bdd==8.1.0 pytest-cov==7.0.0 pytest-django==4.11.1 From 5a73c57799fde4fce8f3f73c457807b8f2efa8f0 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 14 Sep 2025 14:15:40 +0300 Subject: [PATCH 109/270] terminal: add a `TerminalReporter.write_raw` method The `write` method does some processing on the input, namely markup and adding to the current line. `write_raw` skips these parts. It is useful for emitting invisible escape sequences. --- src/_pytest/_io/terminalwriter.py | 31 +++++++++++++++++-------------- src/_pytest/terminal.py | 3 +++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/_pytest/_io/terminalwriter.py b/src/_pytest/_io/terminalwriter.py index 68fe4994555..9191b4edace 100644 --- a/src/_pytest/_io/terminalwriter.py +++ b/src/_pytest/_io/terminalwriter.py @@ -161,20 +161,23 @@ def write(self, msg: str, *, flush: bool = False, **markup: bool) -> None: msg = self.markup(msg, **markup) - try: - self._file.write(msg) - except UnicodeEncodeError: - # Some environments don't support printing general Unicode - # strings, due to misconfiguration or otherwise; in that case, - # print the string escaped to ASCII. - # When the Unicode situation improves we should consider - # letting the error propagate instead of masking it (see #7475 - # for one brief attempt). - msg = msg.encode("unicode-escape").decode("ascii") - self._file.write(msg) - - if flush: - self.flush() + self.write_raw(msg, flush=flush) + + def write_raw(self, msg: str, *, flush: bool = False) -> None: + try: + self._file.write(msg) + except UnicodeEncodeError: + # Some environments don't support printing general Unicode + # strings, due to misconfiguration or otherwise; in that case, + # print the string escaped to ASCII. + # When the Unicode situation improves we should consider + # letting the error propagate instead of masking it (see #7475 + # for one brief attempt). + msg = msg.encode("unicode-escape").decode("ascii") + self._file.write(msg) + + if flush: + self.flush() def line(self, s: str = "", **markup: bool) -> None: self.write(s, **markup) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index a95f79ba6b6..8e0cf84767b 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -508,6 +508,9 @@ def wrap_write( def write(self, content: str, *, flush: bool = False, **markup: bool) -> None: self._tw.write(content, flush=flush, **markup) + def write_raw(self, content: str, *, flush: bool = False) -> None: + self._tw.write_raw(content, flush=flush) + def flush(self) -> None: self._tw.flush() From c71920cdc2c774da6fb3139c72cf038dc3a45fe8 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 14 Sep 2025 14:53:47 +0300 Subject: [PATCH 110/270] terminal: add TerminalReporter.reported_progress Return how many items have been reported in the progress so far. This cleans up the code a bit, but also allows grabbing this info without accessing the internals. We can consider making this property public separately. --- src/_pytest/terminal.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 8e0cf84767b..d4d5c4e800c 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -454,6 +454,14 @@ def showfspath(self, value: bool | None) -> None: def showlongtestinfo(self) -> bool: return self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) > 0 + @property + def reported_progress(self) -> int: + """The amount of items reported in the progress so far. + + :meta private: + """ + return len(self._progress_nodeids_reported) + def hasopt(self, char: str) -> bool: char = {"xfailed": "x", "skipped": "s"}.get(char, char) return char in self.reportchars @@ -684,7 +692,7 @@ def pytest_runtest_logreport(self, report: TestReport) -> None: @property def _is_last_item(self) -> bool: assert self._session is not None - return len(self._progress_nodeids_reported) == self._session.testscollected + return self.reported_progress == self._session.testscollected @hookimpl(wrapper=True) def pytest_runtestloop(self) -> Generator[None, object, object]: @@ -694,7 +702,7 @@ def pytest_runtestloop(self) -> Generator[None, object, object]: if ( self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) <= 0 and self._show_progress_info - and self._progress_nodeids_reported + and self.reported_progress ): self._write_progress_information_filling_space() @@ -705,7 +713,7 @@ def _get_progress_information_message(self) -> str: collected = self._session.testscollected if self._show_progress_info == "count": if collected: - progress = len(self._progress_nodeids_reported) + progress = self.reported_progress counter_format = f"{{:{len(str(collected))}d}}" format_string = f" [{counter_format}/{{}}]" return format_string.format(progress, collected) @@ -742,7 +750,7 @@ def _get_progress_information_message(self) -> str: ) return "" if collected: - return f" [{len(self._progress_nodeids_reported) * 100 // collected:3d}%]" + return f" [{self.reported_progress * 100 // collected:3d}%]" return " [100%]" def _write_progress_information_if_past_edge(self) -> None: From 09ad02c2b0b16cbd30c9d346b8f01685ad6d2ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isra=C3=ABl=20Hall=C3=A9?= Date: Sat, 20 Sep 2025 07:03:22 -0400 Subject: [PATCH 111/270] config: do not fail if a warning filter category cannot be imported (#13732) --- AUTHORS | 1 + changelog/13732.improvement.rst | 1 + src/_pytest/config/__init__.py | 18 ++++++++++++++++-- testing/test_config.py | 2 -- testing/test_warnings.py | 27 +++++++++++++++++++++++++++ 5 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 changelog/13732.improvement.rst diff --git a/AUTHORS b/AUTHORS index f93de06c10d..52363a177bb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -201,6 +201,7 @@ Ilya Konstantinov Ionuț Turturică Isaac Virshup Israel Fruchter +Israël Hallé Itxaso Aizpurua Iwan Briquemont Jaap Broekhuizen diff --git a/changelog/13732.improvement.rst b/changelog/13732.improvement.rst new file mode 100644 index 00000000000..07b3d620cf6 --- /dev/null +++ b/changelog/13732.improvement.rst @@ -0,0 +1 @@ +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/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 0248f046407..8c80405a6ab 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1965,6 +1965,8 @@ def parse_warning_filter( raise UsageError(error_template.format(error=str(e))) from None try: category: type[Warning] = _resolve_warning_category(category_) + except ImportError: + raise except Exception: exc_info = ExceptionInfo.from_current() exception_text = exc_info.getrepr(style="native") @@ -2023,7 +2025,19 @@ def apply_warning_filters( # Filters should have this precedence: cmdline options, config. # Filters should be applied in the inverse order of precedence. for arg in config_filters: - warnings.filterwarnings(*parse_warning_filter(arg, escape=False)) + try: + warnings.filterwarnings(*parse_warning_filter(arg, escape=False)) + except ImportError as e: + warnings.warn( + f"Failed to import filter module '{e.name}': {arg}", PytestConfigWarning + ) + continue for arg in cmdline_filters: - warnings.filterwarnings(*parse_warning_filter(arg, escape=True)) + try: + warnings.filterwarnings(*parse_warning_filter(arg, escape=True)) + except ImportError as e: + warnings.warn( + f"Failed to import filter module '{e.name}': {arg}", PytestConfigWarning + ) + continue diff --git a/testing/test_config.py b/testing/test_config.py index 3e8635fd1fc..f2cc139dffa 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -2400,8 +2400,6 @@ def test_parse_warning_filter( ":" * 5, # Invalid action. "FOO::", - # ImportError when importing the warning class. - "::test_parse_warning_filter_failure.NonExistentClass::", # Class is not a Warning subclass. "::list::", # Negative line number. diff --git a/testing/test_warnings.py b/testing/test_warnings.py index ff7ee4915c9..399ca586927 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -424,6 +424,33 @@ def test(): result.stdout.fnmatch_lines(["* 1 failed in*"]) +def test_accept_unknown_category(pytester: Pytester) -> None: + """Category types that can't be imported don't cause failure (#13732).""" + pytester.makeini( + """ + [pytest] + filterwarnings = + always:Failed to import filter module.*:pytest.PytestConfigWarning + ignore::foobar.Foobar + """ + ) + pytester.makepyfile( + """ + def test(): + pass + """ + ) + result = pytester.runpytest("-W", "ignore::bizbaz.Bizbaz") + result.stdout.fnmatch_lines( + [ + f"*== {WARNINGS_SUMMARY_HEADER} ==*", + "*PytestConfigWarning: Failed to import filter module 'foobar': ignore::foobar.Foobar", + "*PytestConfigWarning: Failed to import filter module 'bizbaz': ignore::bizbaz.Bizbaz", + "* 1 passed, * warning*", + ] + ) + + class TestDeprecationWarningsByDefault: """ Note: all pytest runs are executed in a subprocess so we don't inherit warning filters From 4abfdc52cb327dfb91480997efe05cc49f73a62a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 04:54:55 +0000 Subject: [PATCH 112/270] [automated] Update plugin list (#13740) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 194 ++++++++++++++++++++----------- 1 file changed, 125 insertions(+), 69 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index f12bb80e3a9..09555d5b2db 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =7.1.1,<8.0.0) :pypi:`pytest-api-cov` Pytest Plugin to provide API Coverage statistics for Python Web Frameworks Sep 11, 2025 N/A pytest>=6.0.0 :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Sep 10, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Sep 16, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -102,9 +102,9 @@ This list contains 1712 plugins. :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Jul 14, 2025 5 - Production/Stable pytest - :pypi:`pytest-archon` Rule your architecture like a real developer Dec 18, 2023 5 - Production/Stable pytest >=7.2 + :pypi:`pytest-archon` Rule your architecture like a real developer Sep 19, 2025 5 - Production/Stable pytest>=7.2 :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) - :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Aug 01, 2025 4 - Beta pytest>=3.0; extra == "dev" + :pypi:`pytest-argus-reporter` A simple plugin to report results of test into argus Sep 17, 2025 4 - Beta pytest>=3.0; extra == "dev" :pypi:`pytest-argus-server` A plugin that provides a running Argus API server for tests Mar 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Nov 27, 2023 4 - Beta pytest >=4.6 :pypi:`pytest-asdf-plugin` Pytest plugin for testing ASDF schemas Aug 18, 2025 5 - Production/Stable pytest>=7 @@ -172,7 +172,7 @@ This list contains 1712 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Sep 12, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Sep 15, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -191,10 +191,10 @@ This list contains 1712 plugins. :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A - :pypi:`pytest-b-logger` BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. Sep 11, 2025 N/A pytest + :pypi:`pytest-b-logger` BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. Sep 16, 2025 N/A pytest :pypi:`pytest-blue` A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. Sep 05, 2022 N/A N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A - :pypi:`pytest-boardfarm3` Integrate boardfarm as a pytest plugin. Sep 12, 2025 N/A pytest + :pypi:`pytest-boardfarm3` Integrate boardfarm as a pytest plugin. Sep 15, 2025 N/A pytest :pypi:`pytest-boilerplate` The pytest plugin for your Django Boilerplate. Sep 12, 2024 5 - Production/Stable pytest>=4.0.0 :pypi:`pytest-bonsai` Apr 08, 2025 N/A pytest>=6 :pypi:`pytest-boost-xml` Plugin for pytest to generate boost xml reports Nov 30, 2022 4 - Beta N/A @@ -248,7 +248,7 @@ This list contains 1712 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Apr 04, 2025 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Sep 15, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-checkdocs` check the README when running tests Apr 30, 2024 5 - Production/Stable pytest!=8.1.*,>=6; extra == "testing" :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Dec 04, 2023 5 - Production/Stable pytest >=2.9.2 :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -389,7 +389,7 @@ This list contains 1712 plugins. :pypi:`pytest-deepassert` A pytest plugin for enhanced assertion reporting with detailed diffs Sep 02, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A :pypi:`pytest_defer` A 'defer' fixture for pytest Nov 13, 2024 N/A pytest>=8.3 - :pypi:`pytest-delta` Run only tests impacted by your code changes (delta-based selection) for pytest. Sep 01, 2025 N/A pytest>=7.0 + :pypi:`pytest-delta` Run only tests impacted by your code changes (delta-based selection) for pytest. Sep 15, 2025 N/A pytest>=7.0 :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A :pypi:`pytest-dependency` Manage dependencies of tests Dec 31, 2023 4 - Beta N/A :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) @@ -474,6 +474,7 @@ This list contains 1712 plugins. :pypi:`pytest-donde` record pytest session characteristics per test item (coverage and duration) into a persistent file and use them in your own plugin or script. Oct 01, 2023 4 - Beta pytest >=7.3.1 :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-dotenv-modern` A modern pytest plugin that loads environment variables from dotenv files Sep 14, 2025 4 - Beta pytest>=6.0.0 :pypi:`pytest-dot-only-pkcopley` A Pytest marker for only running a single test Oct 27, 2023 N/A N/A :pypi:`pytest-dparam` A more readable alternative to @pytest.mark.parametrize. Aug 27, 2024 6 - Mature pytest :pypi:`pytest-dpg` pytest-dpg is a pytest plugin for testing Dear PyGui (DPG) applications Aug 13, 2024 N/A N/A @@ -491,7 +492,7 @@ This list contains 1712 plugins. :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Aug 29, 2025 5 - Production/Stable pytest>=4.6 - :pypi:`pytest-dynamic-parameterize` A Python package for managing pytest plugins. Aug 27, 2025 N/A pytest + :pypi:`pytest-dynamic-parameterize` A Python package for managing pytest plugins. Sep 14, 2025 N/A pytest :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Apr 04, 2025 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A @@ -509,15 +510,15 @@ This list contains 1712 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Sep 10, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Sep 10, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Sep 10, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Sep 10, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Sep 10, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Sep 10, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Sep 10, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Sep 10, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Sep 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Sep 17, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Sep 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Sep 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Sep 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Sep 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Sep 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Sep 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Sep 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Sep 17, 2025 5 - Production/Stable N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 09, 2023 4 - Beta pytest (==7.0.1) @@ -624,7 +625,7 @@ This list contains 1712 plugins. :pypi:`pytest-fixture-remover` A LibCST codemod to remove pytest fixtures applied via the usefixtures decorator, as well as its parametrizations. Feb 14, 2024 5 - Production/Stable N/A :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-fixtures-fixtures` Handy fixtues to access your fixtures from your _pytest tests. Sep 09, 2025 4 - Beta pytest>=8.4.1 + :pypi:`pytest-fixtures-fixtures` Handy fixtues to access your fixtures from your _pytest tests. Sep 14, 2025 4 - Beta pytest>=8.4.1 :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Apr 30, 2025 6 - Mature pytest :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Nov 09, 2024 5 - Production/Stable pytest>=7.0 @@ -675,7 +676,7 @@ This list contains 1712 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Sep 04, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Sep 19, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -725,7 +726,7 @@ This list contains 1712 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 13, 2025 3 - Alpha pytest==8.4.1 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 20, 2025 3 - Alpha pytest==8.4.1 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -741,7 +742,7 @@ This list contains 1712 plugins. :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A :pypi:`pytest-html-nova-act` A Pytest Plugin for Amazon Nova Act Python SDK. Sep 05, 2025 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 17, 2024 5 - Production/Stable N/A - :pypi:`pytest-html-plus` Plugin for Auto-generated pytest single file HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config even with xdist Aug 23, 2025 N/A N/A + :pypi:`pytest-html-plus` Get started with rich pytest reports in under 3 seconds. Just install the plugin — no setup required. The simplest, fastest reporter for pytest. Sep 18, 2025 N/A N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-report` Enhanced HTML reporting for pytest with categories, specifications, and detailed logging Jun 24, 2025 4 - Beta pytest>=6.0 :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A @@ -768,7 +769,7 @@ This list contains 1712 plugins. :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jul 25, 2025 4 - Beta pytest>=7.0.0 - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Sep 03, 2025 4 - Beta pytest + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Sep 19, 2025 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Dec 05, 2023 4 - Beta pytest :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Dec 13, 2023 5 - Production/Stable N/A @@ -874,7 +875,7 @@ This list contains 1712 plugins. :pypi:`pytest-launchable` Launchable Pytest Plugin Apr 05, 2023 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) - :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. Aug 19, 2025 N/A pytest>=7 + :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. Sep 16, 2025 N/A pytest>=7 :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest :pypi:`pytest-leak-finder` Find the test that's leaking before the one that fails Feb 15, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A @@ -908,6 +909,7 @@ This list contains 1712 plugins. :pypi:`pytest-logdog` Pytest plugin to test logging Jun 15, 2021 1 - Planning pytest (>=6.2.0) :pypi:`pytest-logfest` Pytest plugin providing three logger fixtures with basic or full writing to log files Jul 21, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Mar 10, 2024 5 - Production/Stable pytest (>=3.2) + :pypi:`pytest-logger-db` Add your description here Sep 14, 2025 N/A N/A :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-logging-strict` pytest fixture logging configured from packaged YAML May 20, 2025 3 - Alpha pytest @@ -973,13 +975,13 @@ This list contains 1712 plugins. :pypi:`pytest-mitmproxy-plugin` Use MITM Proxy in autotests with full control from code Apr 10, 2025 4 - Beta pytest>=7.2.0 :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Sep 04, 2025 5 - Production/Stable pytest>=6.2.5 + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Sep 16, 2025 5 - Production/Stable pytest>=6.2.5 :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Sep 11, 2025 N/A pytest>=1.0 + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Sep 17, 2025 N/A pytest>=1.0 :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest @@ -1033,7 +1035,7 @@ This list contains 1712 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 11, 2025 N/A pytest<9.0.0,>=8.2.0 + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Sep 18, 2025 N/A pytest<9.0.0,>=8.2.0 :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest_nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Aug 05, 2024 N/A N/A @@ -1080,6 +1082,7 @@ This list contains 1712 plugins. :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A :pypi:`pytest-ot` A pytest plugin for instrumenting test runs via OpenTelemetry Mar 21, 2024 N/A pytest; extra == "dev" :pypi:`pytest-otel` OpenTelemetry plugin for Pytest Apr 24, 2025 N/A pytest==8.3.5 + :pypi:`pytest-otelmark` Pytest plugin for otelmark. Sep 14, 2025 3 - Alpha pytest>=8.3.5 :pypi:`pytest-override-env-var` Pytest mark to override a value of an environment variable. Feb 25, 2023 N/A N/A :pypi:`pytest-owner` Add owner mark for tests Aug 19, 2024 N/A pytest :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A @@ -1144,11 +1147,11 @@ This list contains 1712 plugins. :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Jul 02, 2025 N/A N/A - :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Sep 05, 2025 3 - Alpha pytest + :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Sep 16, 2025 3 - Alpha pytest :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Sep 13, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Sep 14, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1214,6 +1217,7 @@ This list contains 1712 plugins. :pypi:`pytest-pyspark-plugin` Pytest pyspark plugin (p3) Jul 28, 2025 4 - Beta pytest>=8.0.0 :pypi:`pytest-pyspec` A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". Aug 17, 2024 N/A pytest<9.0.0,>=8.3.2 :pypi:`pytest-pystack` Plugin to run pystack after a timeout for a test suite. Nov 16, 2024 N/A pytest>=3.5.0 + :pypi:`pytest-pytestdb` Add your description here Sep 14, 2025 N/A N/A :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pytestrail-internal` Pytest plugin for interaction with TestRail, Pytest plugin for TestRail (internal fork from: https://github.com/tolstislon/pytest-pytestrail with PR #25 fix) Jun 12, 2025 4 - Beta pytest>=3.8.0 :pypi:`pytest-pythonhashseed` Pytest plugin to set PYTHONHASHSEED env var. Feb 25, 2024 4 - Beta pytest>=3.0.0 @@ -1309,7 +1313,7 @@ This list contains 1712 plugins. :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Dec 22, 2024 4 - Beta pytest :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Jul 29, 2025 N/A pytest~=7.0 :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A - :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 15, 2025 5 - Production/Stable pytest>=3.5.0 + :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory Sep 18, 2025 5 - Production/Stable pytest>=3.5.0 :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-respect` Pytest plugin to load resource files relative to test code and to expect values to match them. Aug 25, 2025 5 - Production/Stable pytest>=8.0.0 :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A @@ -1367,7 +1371,7 @@ This list contains 1712 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 13, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 20, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. Sep 03, 2025 5 - Production/Stable pytest<9,>=7.4 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1379,7 +1383,7 @@ This list contains 1712 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 13, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 20, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1426,6 +1430,7 @@ This list contains 1712 plugins. :pypi:`pytest-slow-last` Run tests in order of execution time (faster tests first) Mar 16, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A + :pypi:`pytest-smart-debugger-backend` Backend server for Pytest Smart Debugger Sep 17, 2025 N/A N/A :pypi:`pytest-smell` Automated bad smell detection tool for Pytest Jun 26, 2022 N/A N/A :pypi:`pytest-smoke` Pytest plugin for smoke testing May 23, 2025 4 - Beta pytest<9,>=7.0.0 :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest @@ -1483,6 +1488,8 @@ This list contains 1712 plugins. :pypi:`pytest-stats` Collects tests metadata for future analysis, easy to extend for any data store Jul 18, 2024 N/A pytest>=8.0.0 :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-status` Add status mark for tests Aug 22, 2024 N/A pytest + :pypi:`pytest-stderr-db` Add your description here Sep 14, 2025 N/A N/A + :pypi:`pytest-stdout-db` Add your description here Sep 14, 2025 N/A N/A :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A :pypi:`pytest-stepthrough` Pause and wait for Enter after each test with --step Aug 14, 2025 N/A N/A @@ -1723,7 +1730,7 @@ This list contains 1712 plugins. :pypi:`pytest-xvirt` A pytest plugin to virtualize test. For example to transparently running them on a remote box. Dec 15, 2024 4 - Beta pytest>=7.2.2 :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yaml-fei` a pytest yaml allure package Aug 03, 2025 N/A pytest - :pypi:`pytest-yaml-sanmu` Pytest plugin for generating test cases with YAML. In test cases, you can use markers, fixtures, variables, and even call Python functions. Aug 31, 2025 N/A pytest>=8.2.2 + :pypi:`pytest-yaml-sanmu` Pytest plugin for generating test cases with YAML. In test cases, you can use markers, fixtures, variables, and even call Python functions. Sep 16, 2025 N/A pytest>=8.2.2 :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A :pypi:`pytest-yaml-yoyo` http/https API run by yaml Jun 19, 2023 N/A pytest (>=7.2.0) @@ -2172,7 +2179,7 @@ This list contains 1712 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Sep 10, 2025, + *last release*: Sep 16, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2228,9 +2235,9 @@ This list contains 1712 plugins. Extension for ApprovalTests.Python specific to geo data verification :pypi:`pytest-archon` - *last release*: Dec 18, 2023, + *last release*: Sep 19, 2025, *status*: 5 - Production/Stable, - *requires*: pytest >=7.2 + *requires*: pytest>=7.2 Rule your architecture like a real developer @@ -2242,7 +2249,7 @@ This list contains 1712 plugins. pyest results colection plugin :pypi:`pytest-argus-reporter` - *last release*: Aug 01, 2025, + *last release*: Sep 17, 2025, *status*: 4 - Beta, *requires*: pytest>=3.0; extra == "dev" @@ -2718,7 +2725,7 @@ This list contains 1712 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Sep 12, 2025, + *last release*: Sep 15, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -2851,7 +2858,7 @@ This list contains 1712 plugins. pytest plugin to mark a test as blocker and skip all other tests :pypi:`pytest-b-logger` - *last release*: Sep 11, 2025, + *last release*: Sep 16, 2025, *status*: N/A, *requires*: pytest @@ -2872,7 +2879,7 @@ This list contains 1712 plugins. Local continuous test runner with pytest and watchdog. :pypi:`pytest-boardfarm3` - *last release*: Sep 12, 2025, + *last release*: Sep 15, 2025, *status*: N/A, *requires*: pytest @@ -3250,7 +3257,7 @@ This list contains 1712 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Apr 04, 2025, + *last release*: Sep 15, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0.0 @@ -4237,7 +4244,7 @@ This list contains 1712 plugins. A 'defer' fixture for pytest :pypi:`pytest-delta` - *last release*: Sep 01, 2025, + *last release*: Sep 15, 2025, *status*: N/A, *requires*: pytest>=7.0 @@ -4831,6 +4838,13 @@ This list contains 1712 plugins. A py.test plugin that parses environment files before running tests + :pypi:`pytest-dotenv-modern` + *last release*: Sep 14, 2025, + *status*: 4 - Beta, + *requires*: pytest>=6.0.0 + + A modern pytest plugin that loads environment variables from dotenv files + :pypi:`pytest-dot-only-pkcopley` *last release*: Oct 27, 2023, *status*: N/A, @@ -4951,7 +4965,7 @@ This list contains 1712 plugins. Pytest plugin reporting fixtures and test functions execution time. :pypi:`pytest-dynamic-parameterize` - *last release*: Aug 27, 2025, + *last release*: Sep 14, 2025, *status*: N/A, *requires*: pytest @@ -5077,63 +5091,63 @@ This list contains 1712 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-idf` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: Sep 10, 2025, + *last release*: Sep 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -5882,7 +5896,7 @@ This list contains 1712 plugins. Common fixtures for pytest :pypi:`pytest-fixtures-fixtures` - *last release*: Sep 09, 2025, + *last release*: Sep 14, 2025, *status*: 4 - Beta, *requires*: pytest>=8.4.1 @@ -6239,7 +6253,7 @@ This list contains 1712 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Sep 04, 2025, + *last release*: Sep 19, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6589,7 +6603,7 @@ This list contains 1712 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Sep 13, 2025, + *last release*: Sep 20, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.1 @@ -6701,11 +6715,11 @@ This list contains 1712 plugins. Pytest report plugin for send HTML report on object-storage :pypi:`pytest-html-plus` - *last release*: Aug 23, 2025, + *last release*: Sep 18, 2025, *status*: N/A, *requires*: N/A - Plugin for Auto-generated pytest single file HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config even with xdist + Get started with rich pytest reports in under 3 seconds. Just install the plugin — no setup required. The simplest, fastest reporter for pytest. :pypi:`pytest-html-profiling` *last release*: Feb 11, 2020, @@ -6890,7 +6904,7 @@ This list contains 1712 plugins. A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite :pypi:`pytest-ibutsu` - *last release*: Sep 03, 2025, + *last release*: Sep 19, 2025, *status*: 4 - Beta, *requires*: pytest @@ -7632,7 +7646,7 @@ This list contains 1712 plugins. It helps to use fixtures in pytest.mark.parametrize :pypi:`pytest-lazy-fixtures` - *last release*: Aug 19, 2025, + *last release*: Sep 16, 2025, *status*: N/A, *requires*: pytest>=7 @@ -7869,6 +7883,13 @@ This list contains 1712 plugins. Plugin configuring handlers for loggers from Python logging module. + :pypi:`pytest-logger-db` + *last release*: Sep 14, 2025, + *status*: N/A, + *requires*: N/A + + Add your description here + :pypi:`pytest-logging` *last release*: Nov 04, 2015, *status*: 4 - Beta, @@ -8325,7 +8346,7 @@ This list contains 1712 plugins. pytest plugin to display test execution output like a mochajs :pypi:`pytest-mock` - *last release*: Sep 04, 2025, + *last release*: Sep 16, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=6.2.5 @@ -8367,7 +8388,7 @@ This list contains 1712 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Sep 11, 2025, + *last release*: Sep 17, 2025, *status*: N/A, *requires*: pytest>=1.0 @@ -8745,7 +8766,7 @@ This list contains 1712 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Aug 11, 2025, + *last release*: Sep 18, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.2.0 @@ -9073,6 +9094,13 @@ This list contains 1712 plugins. OpenTelemetry plugin for Pytest + :pypi:`pytest-otelmark` + *last release*: Sep 14, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=8.3.5 + + Pytest plugin for otelmark. + :pypi:`pytest-override-env-var` *last release*: Feb 25, 2023, *status*: N/A, @@ -9522,7 +9550,7 @@ This list contains 1712 plugins. Easy pytest visual regression testing using playwright :pypi:`pytest-pl-grader` - *last release*: Sep 05, 2025, + *last release*: Sep 16, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -9550,7 +9578,7 @@ This list contains 1712 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Sep 13, 2025, + *last release*: Sep 14, 2025, *status*: N/A, *requires*: pytest @@ -10011,6 +10039,13 @@ This list contains 1712 plugins. Plugin to run pystack after a timeout for a test suite. + :pypi:`pytest-pytestdb` + *last release*: Sep 14, 2025, + *status*: N/A, + *requires*: N/A + + Add your description here + :pypi:`pytest-pytestrail` *last release*: Aug 27, 2020, *status*: 4 - Beta, @@ -10677,7 +10712,7 @@ This list contains 1712 plugins. Load resource fixture plugin to use with pytest :pypi:`pytest-resource-path` - *last release*: May 15, 2025, + *last release*: Sep 18, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=3.5.0 @@ -11083,7 +11118,7 @@ This list contains 1712 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Sep 13, 2025, + *last release*: Sep 20, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11167,7 +11202,7 @@ This list contains 1712 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Sep 13, 2025, + *last release*: Sep 20, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11495,6 +11530,13 @@ This list contains 1712 plugins. Smart coverage plugin for pytest. + :pypi:`pytest-smart-debugger-backend` + *last release*: Sep 17, 2025, + *status*: N/A, + *requires*: N/A + + Backend server for Pytest Smart Debugger + :pypi:`pytest-smell` *last release*: Jun 26, 2022, *status*: N/A, @@ -11894,6 +11936,20 @@ This list contains 1712 plugins. Add status mark for tests + :pypi:`pytest-stderr-db` + *last release*: Sep 14, 2025, + *status*: N/A, + *requires*: N/A + + Add your description here + + :pypi:`pytest-stdout-db` + *last release*: Sep 14, 2025, + *status*: N/A, + *requires*: N/A + + Add your description here + :pypi:`pytest-stepfunctions` *last release*: May 08, 2021, *status*: 4 - Beta, @@ -13575,7 +13631,7 @@ This list contains 1712 plugins. a pytest yaml allure package :pypi:`pytest-yaml-sanmu` - *last release*: Aug 31, 2025, + *last release*: Sep 16, 2025, *status*: N/A, *requires*: pytest>=8.2.2 From aaeb1ca107ebcded73f05a2130ae0db7f65abf94 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 20:46:58 +0000 Subject: [PATCH 113/270] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.12 → v0.13.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.12...v0.13.0) - [github.com/woodruffw/zizmor-pre-commit: v1.12.1 → v1.13.0](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.12.1...v1.13.0) - [github.com/pre-commit/mirrors-mypy: v1.17.1 → v1.18.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.17.1...v1.18.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b7ea12fa4c..c6cb8da92cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.12" + rev: "v0.13.0" hooks: - id: ruff args: ["--fix"] @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.12.1 + rev: v1.13.0 hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs @@ -32,7 +32,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.17.1 + rev: v1.18.1 hooks: - id: mypy files: ^(src/|testing/|scripts/) From 779cecde7caedd6cc59f2ee1c4f689a45246f3c5 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 16 Sep 2025 09:48:10 -0300 Subject: [PATCH 114/270] Comply with new lint rule for unused variables --- doc/en/example/.ruff.toml | 1 + src/_pytest/_code/source.py | 2 +- src/_pytest/_py/path.py | 2 +- src/_pytest/config/__init__.py | 6 ++-- src/_pytest/helpconfig.py | 2 +- src/_pytest/mark/structures.py | 2 +- src/_pytest/reports.py | 2 +- testing/_py/test_local.py | 3 +- testing/acceptance_test.py | 5 ++- testing/code/test_code.py | 4 +-- testing/code/test_excinfo.py | 2 +- testing/code/test_source.py | 4 +-- .../sub2/conftest.py | 4 ++- testing/python/collect.py | 6 ++-- testing/python/fixtures.py | 2 +- testing/python/integration.py | 4 +-- testing/python/metafunc.py | 2 +- testing/test_capture.py | 16 +++++----- testing/test_collection.py | 20 ++++++------ testing/test_doctest.py | 14 ++++---- testing/test_junitxml.py | 32 +++++++++---------- testing/test_legacypath.py | 4 +-- testing/test_main.py | 4 +-- testing/test_mark.py | 28 ++++++++-------- testing/test_nodes.py | 8 ++--- testing/test_pathlib.py | 2 +- testing/test_pluginmanager.py | 2 +- testing/test_pytester.py | 2 +- testing/test_reports.py | 8 ++--- testing/test_session.py | 2 +- testing/test_skipping.py | 6 ++-- testing/test_tmpdir.py | 2 +- testing/test_unittest.py | 14 ++++---- testing/test_warning_types.py | 2 +- 34 files changed, 111 insertions(+), 108 deletions(-) create mode 100644 doc/en/example/.ruff.toml diff --git a/doc/en/example/.ruff.toml b/doc/en/example/.ruff.toml new file mode 100644 index 00000000000..1cbca296f8c --- /dev/null +++ b/doc/en/example/.ruff.toml @@ -0,0 +1 @@ +ignore = ["RUF059"] diff --git a/src/_pytest/_code/source.py b/src/_pytest/_code/source.py index 280691f0b6c..99c242dd98e 100644 --- a/src/_pytest/_code/source.py +++ b/src/_pytest/_code/source.py @@ -103,7 +103,7 @@ def getstatementrange(self, lineno: int) -> tuple[int, int]: which containing the given lineno.""" if not (0 <= lineno < len(self)): raise IndexError("lineno out of range") - ast, start, end = getstatementrange_ast(lineno, self) + _ast, start, end = getstatementrange_ast(lineno, self) return start, end def deindent(self) -> Source: diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 878fc7a538b..b7131b08a20 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -652,7 +652,7 @@ def new(self, **kw): if not kw: obj.strpath = self.strpath return obj - drive, dirname, basename, purebasename, ext = self._getbyspec( + drive, dirname, _basename, purebasename, ext = self._getbyspec( "drive,dirname,basename,purebasename,ext" ) if "basename" in kw: diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 8c80405a6ab..38fb1ee6d27 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1217,7 +1217,7 @@ def pytest_load_initial_conftests(self, early_config: Config) -> None: # early_config.args it not set yet. But we need it for # discovering the initial conftests. So "pre-run" the logic here. # It will be done for real in `parse()`. - args, args_source = early_config._decide_args( + args, _args_source = early_config._decide_args( args=early_config.known_args_namespace.file_or_dir, pyargs=early_config.known_args_namespace.pyargs, testpaths=early_config.getini("testpaths"), @@ -1273,7 +1273,7 @@ def _consider_importhook(self, args: Sequence[str]) -> None: and find all the installed plugins to mark them for rewriting by the importhook. """ - ns, unknown_args = self._parser.parse_known_and_unknown_args(args) + ns, _unknown_args = self._parser.parse_known_and_unknown_args(args) mode = getattr(ns, "assertmode", "plain") disable_autoload = getattr(ns, "disable_plugin_autoload", False) or bool( @@ -1630,7 +1630,7 @@ def _getini_unknown_type(self, name: str, type: str, value: object): def _getini(self, name: str): try: - description, type, default = self._parser._inidict[name] + _description, type, default = self._parser._inidict[name] except KeyError as e: raise ValueError(f"unknown configuration value: {name!r}") from e override_value = self._get_override_ini_value(name) diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index b5ac0e6a50c..a531c75d28b 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -185,7 +185,7 @@ def showhelp(config: Config) -> None: indent_len = 24 # based on argparse's max_help_position=24 indent = " " * indent_len for name in config._parser._ininames: - help, type, default = config._parser._inidict[name] + help, type, _default = config._parser._inidict[name] if type is None: type = "string" if help is None: diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 04c37796e10..d0280e26945 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -60,7 +60,7 @@ def get_empty_parameterset_mark( argslisting = ", ".join(argnames) - fs, lineno = getfslineno(func) + _fs, lineno = getfslineno(func) reason = f"got empty parameter set for ({argslisting})" requested_mark = config.getini(EMPTY_PARAMETERSET_OPTION) if requested_mark in ("", None, "skip"): diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 2122c021020..fb0607bfb95 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -188,7 +188,7 @@ def head_line(self) -> str | None: even in patch releases. """ if self.location is not None: - fspath, lineno, domain = self.location + _fspath, _lineno, domain = self.location return domain return None diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index ab62e93b223..673ce9b3de6 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -9,9 +9,10 @@ from unittest import mock import warnings -from py import error from py.path import local +from py import error + import pytest diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 2101fe9ad76..544b2cd3f0f 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -644,10 +644,9 @@ def test_invoke_with_invalid_type(self) -> None: ): pytest.main("-h") # type: ignore[arg-type] - def test_invoke_with_path(self, pytester: Pytester, capsys) -> None: + def test_invoke_with_path(self, pytester: Pytester) -> None: retcode = pytest.main([str(pytester.path)]) assert retcode == ExitCode.NO_TESTS_COLLECTED - out, err = capsys.readouterr() def test_invoke_plugin_api(self, capsys) -> None: class MyPlugin: @@ -655,7 +654,7 @@ def pytest_addoption(self, parser): parser.addoption("--myopt") pytest.main(["-h"], plugins=[MyPlugin()]) - out, err = capsys.readouterr() + out, _err = capsys.readouterr() assert "--myopt" in out def test_pyargs_importerror(self, pytester: Pytester, monkeypatch) -> None: diff --git a/testing/code/test_code.py b/testing/code/test_code.py index 7ae5ad46100..ae5e0e949cf 100644 --- a/testing/code/test_code.py +++ b/testing/code/test_code.py @@ -86,9 +86,9 @@ def test_unicode_handling() -> None: value = "ąć".encode() def f() -> None: - raise Exception(value) + raise ValueError(value) - excinfo = pytest.raises(Exception, f) + excinfo = pytest.raises(ValueError, f) str(excinfo) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 555645030fc..636469ee6f1 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -263,7 +263,7 @@ def do_stuff() -> None: def reraise_me() -> None: import sys - exc, val, tb = sys.exc_info() + _exc, val, tb = sys.exc_info() assert val is not None raise val.with_traceback(tb) diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 321372d4b59..e413af3766e 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -399,7 +399,7 @@ def getstatement(lineno: int, source) -> Source: from _pytest._code.source import getstatementrange_ast src = Source(source) - ast, start, end = getstatementrange_ast(lineno, src) + _ast, start, end = getstatementrange_ast(lineno, src) return src[start:end] @@ -418,7 +418,7 @@ def test_comment_and_no_newline_at_end() -> None: "# vim: filetype=pyopencl:fdm=marker", ] ) - ast, start, end = getstatementrange_ast(1, source) + _ast, _start, end = getstatementrange_ast(1, source) assert end == 2 diff --git a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/conftest.py b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/conftest.py index 112d1e05f27..0185628c3a0 100644 --- a/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/conftest.py +++ b/testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/conftest.py @@ -1,9 +1,11 @@ # mypy: allow-untyped-defs from __future__ import annotations +from _pytest.fixtures import FixtureLookupError import pytest @pytest.fixture def arg2(request): - pytest.raises(Exception, request.getfixturevalue, "arg1") + with pytest.raises(FixtureLookupError): + request.getfixturevalue("arg1") diff --git a/testing/python/collect.py b/testing/python/collect.py index 80981ed280f..b26931007d9 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -1273,10 +1273,10 @@ def test_bar(self): ) classcol = pytester.collect_by_name(modcol, "TestClass") assert isinstance(classcol, Class) - path, lineno, msg = classcol.reportinfo() + _path, _lineno, _msg = classcol.reportinfo() func = next(iter(classcol.collect())) assert isinstance(func, Function) - path, lineno, msg = func.reportinfo() + _path, _lineno, _msg = func.reportinfo() def test_customized_python_discovery(pytester: Pytester) -> None: @@ -1489,7 +1489,7 @@ def test_package_collection_init_given_as_argument(pytester: Pytester) -> None: Module, not the entire package. """ p = pytester.copy_example("collect/package_init_given_as_arg") - items, hookrecorder = pytester.inline_genitems(p / "pkg" / "__init__.py") + items, _hookrecorder = pytester.inline_genitems(p / "pkg" / "__init__.py") assert len(items) == 1 assert items[0].name == "test_init" diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index b58ddc6e162..8b97d35c21e 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -1150,7 +1150,7 @@ def test_session_scoped_unavailable_attributes(self, session_request, name): class TestRequestMarking: def test_applymarker(self, pytester: Pytester) -> None: - item1, item2 = pytester.getitems( + item1, _item2 = pytester.getitems( """ import pytest diff --git a/testing/python/integration.py b/testing/python/integration.py index c96b6e4c260..d8f8d0ffae9 100644 --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -21,8 +21,8 @@ def wrap(f): def wrapped_func(x, y, z): pass - fs, lineno = getfslineno(wrapped_func) - fs2, lineno2 = getfslineno(wrap) + _fs, lineno = getfslineno(wrapped_func) + _fs2, lineno2 = getfslineno(wrap) assert lineno > lineno2, "getfslineno does not unwrap correctly" diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 010c22f5c0c..20ccacf4b73 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -92,7 +92,7 @@ def func(x, y): with pytest.raises(pytest.Collector.CollectError): metafunc.parametrize("y", [5, 6]) - with pytest.raises(TypeError, match="^ids must be a callable or an iterable$"): + with pytest.raises(TypeError, match=r"^ids must be a callable or an iterable$"): metafunc.parametrize("y", [5, 6], ids=42) # type: ignore[arg-type] def test_parametrize_error_iterator(self) -> None: diff --git a/testing/test_capture.py b/testing/test_capture.py index 0f64e9c73d8..ffbc440e3bf 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -76,7 +76,7 @@ def test_capturing_basic_api(self, method) -> None: assert outerr == ("", "") print("hello") capman.suspend_global_capture() - out, err = capman.read_global_capture() + out, _err = capman.read_global_capture() if method == "no": assert old == (sys.stdout, sys.stderr, sys.stdin) else: @@ -84,7 +84,7 @@ def test_capturing_basic_api(self, method) -> None: capman.resume_global_capture() print("hello") capman.suspend_global_capture() - out, err = capman.read_global_capture() + out, _err = capman.read_global_capture() if method != "no": assert out == "hello\n" capman.stop_global_capturing() @@ -563,7 +563,7 @@ def test_hello(capfd): @pytest.mark.parametrize("nl", ("\n", "\r\n", "\r")) def test_cafd_preserves_newlines(self, capfd, nl) -> None: print("test", end=nl) - out, err = capfd.readouterr() + out, _err = capfd.readouterr() assert out.endswith(nl) def test_capfdbinary(self, pytester: Pytester) -> None: @@ -1153,7 +1153,7 @@ def test_capture_results_accessible_by_attribute(self) -> None: def test_capturing_readouterr_unicode(self) -> None: with self.getcapture() as cap: print("hxąć") - out, err = cap.readouterr() + out, _err = cap.readouterr() assert out == "hxąć\n" def test_reset_twice_error(self) -> None: @@ -1185,8 +1185,8 @@ def test_capturing_error_recursive(self) -> None: print("cap1") with self.getcapture() as cap2: print("cap2") - out2, err2 = cap2.readouterr() - out1, err1 = cap1.readouterr() + out2, _err2 = cap2.readouterr() + out1, _err1 = cap1.readouterr() assert out1 == "cap1\n" assert out2 == "cap2\n" @@ -1231,8 +1231,8 @@ def test_capturing_error_recursive(self) -> None: print("cap1") with self.getcapture() as cap2: print("cap2") - out2, err2 = cap2.readouterr() - out1, err1 = cap1.readouterr() + out2, _err2 = cap2.readouterr() + out1, _err1 = cap1.readouterr() assert out1 == "cap1\ncap2\n" assert out2 == "cap2\n" diff --git a/testing/test_collection.py b/testing/test_collection.py index 2214c130a05..bb2fd82c898 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -243,20 +243,20 @@ def test_testpaths_ini(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> No # executing from rootdir only tests from `testpaths` directories # are collected - items, reprec = pytester.inline_genitems("-v") + items, _reprec = pytester.inline_genitems("-v") assert [x.name for x in items] == ["test_b", "test_c"] # check that explicitly passing directories in the command-line # collects the tests for dirname in ("a", "b", "c"): - items, reprec = pytester.inline_genitems(tmp_path.joinpath(dirname)) + items, _reprec = pytester.inline_genitems(tmp_path.joinpath(dirname)) assert [x.name for x in items] == [f"test_{dirname}"] # changing cwd to each subdirectory and running pytest without # arguments collects the tests in that directory normally for dirname in ("a", "b", "c"): monkeypatch.chdir(pytester.path.joinpath(dirname)) - items, reprec = pytester.inline_genitems() + items, _reprec = pytester.inline_genitems() assert [x.name for x in items] == [f"test_{dirname}"] def test_missing_permissions_on_unselected_directory_doesnt_crash( @@ -640,10 +640,10 @@ def test_collect_two_commandline_args(self, pytester: Pytester) -> None: def test_serialization_byid(self, pytester: Pytester) -> None: pytester.makepyfile("def test_func(): pass") - items, hookrec = pytester.inline_genitems() + items, _hookrec = pytester.inline_genitems() assert len(items) == 1 (item,) = items - items2, hookrec = pytester.inline_genitems(item.nodeid) + items2, _hookrec = pytester.inline_genitems(item.nodeid) (item2,) = items2 assert item2.name == item.name assert item2.path == item.path @@ -673,7 +673,7 @@ def test_collect_parametrized_order(self, pytester: Pytester) -> None: def test_param(i): ... """ ) - items, hookrec = pytester.inline_genitems(f"{p}::test_param") + items, _hookrec = pytester.inline_genitems(f"{p}::test_param") assert len(items) == 3 assert [item.nodeid for item in items] == [ "test_collect_parametrized_order.py::test_param[0]", @@ -732,7 +732,7 @@ def test_2(): """ ) shutil.copy(p, p.parent / (p.stem + "2" + ".py")) - items, reprec = pytester.inline_genitems(p.parent) + items, _reprec = pytester.inline_genitems(p.parent) assert len(items) == 4 for numi, i in enumerate(items): for numj, j in enumerate(items): @@ -758,7 +758,7 @@ def testmethod_two(self, arg0): pass """ ) - items, reprec = pytester.inline_genitems(p) + items, _reprec = pytester.inline_genitems(p) assert len(items) == 4 assert items[0].name == "testone" assert items[1].name == "testmethod_one" @@ -786,7 +786,7 @@ def test_classmethod(cls) -> None: pass """ ) - items, reprec = pytester.inline_genitems(p) + items, _reprec = pytester.inline_genitems(p) ids = [x.getmodpath() for x in items] # type: ignore[attr-defined] assert ids == ["TestCase.test_classmethod"] @@ -811,7 +811,7 @@ def test_y(self): pass """ ) - items, reprec = pytester.inline_genitems(p) + items, _reprec = pytester.inline_genitems(p) ids = [x.getmodpath() for x in items] # type: ignore[attr-defined] assert ids == ["MyTestSuite.x_test", "TestCase.test_y"] diff --git a/testing/test_doctest.py b/testing/test_doctest.py index f4ed976c839..415d3a24faa 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -33,24 +33,24 @@ def test_collect_testtextfile(self, pytester: Pytester): for x in (pytester.path, checkfile): # print "checking that %s returns custom items" % (x,) - items, reprec = pytester.inline_genitems(x) + items, _reprec = pytester.inline_genitems(x) assert len(items) == 1 assert isinstance(items[0], DoctestItem) assert isinstance(items[0].parent, DoctestTextfile) # Empty file has no items. - items, reprec = pytester.inline_genitems(w) + items, _reprec = pytester.inline_genitems(w) assert len(items) == 0 def test_collect_module_empty(self, pytester: Pytester): path = pytester.makepyfile(whatever="#") for p in (path, pytester.path): - items, reprec = pytester.inline_genitems(p, "--doctest-modules") + items, _reprec = pytester.inline_genitems(p, "--doctest-modules") assert len(items) == 0 def test_collect_module_single_modulelevel_doctest(self, pytester: Pytester): path = pytester.makepyfile(whatever='""">>> pass"""') for p in (path, pytester.path): - items, reprec = pytester.inline_genitems(p, "--doctest-modules") + items, _reprec = pytester.inline_genitems(p, "--doctest-modules") assert len(items) == 1 assert isinstance(items[0], DoctestItem) assert isinstance(items[0].parent, DoctestModule) @@ -64,7 +64,7 @@ def my_func(): """ ) for p in (path, pytester.path): - items, reprec = pytester.inline_genitems(p, "--doctest-modules") + items, _reprec = pytester.inline_genitems(p, "--doctest-modules") assert len(items) == 2 assert isinstance(items[0], DoctestItem) assert isinstance(items[1], DoctestItem) @@ -97,7 +97,7 @@ def another(): }, ) for p in (path, pytester.path): - items, reprec = pytester.inline_genitems(p, "--doctest-modules") + items, _reprec = pytester.inline_genitems(p, "--doctest-modules") assert len(items) == 2 assert isinstance(items[0], DoctestItem) assert isinstance(items[1], DoctestItem) @@ -840,7 +840,7 @@ def foo(x): return 'c' """ ) - items, reprec = pytester.inline_genitems(p, "--doctest-modules") + items, _reprec = pytester.inline_genitems(p, "--doctest-modules") reportinfo = items[0].reportinfo() assert reportinfo[1] == 1 diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 4f9702149a8..a05a69c58ca 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -261,7 +261,7 @@ def test_pass(): pass """ ) - result, dom = run_and_parse(family=xunit_family) + _result, dom = run_and_parse(family=xunit_family) node = dom.get_first_by_tag("testsuite") node.assert_attr(hostname=platform.node()) @@ -276,7 +276,7 @@ def test_pass(): """ ) start_time = datetime.now(timezone.utc) - result, dom = run_and_parse(family=xunit_family) + _result, dom = run_and_parse(family=xunit_family) node = dom.get_first_by_tag("testsuite") timestamp = datetime.fromisoformat(node["timestamp"]) assert start_time <= timestamp < datetime.now(timezone.utc) @@ -298,7 +298,7 @@ def test_sleep(): timing.sleep(4) """ ) - result, dom = run_and_parse() + _result, dom = run_and_parse() node = dom.get_first_by_tag("testsuite") tnode = node.get_first_by_tag("testcase") val = tnode["time"] @@ -329,7 +329,7 @@ def test_foo(): pass """ ) - result, dom = run_and_parse("-o", f"junit_duration_report={duration_report}") + _result, dom = run_and_parse("-o", f"junit_duration_report={duration_report}") node = dom.get_first_by_tag("testsuite") tnode = node.get_first_by_tag("testcase") val = float(tnode["time"]) @@ -635,7 +635,7 @@ def test_fail(): assert 0, "An error" """ ) - result, dom = run_and_parse(family=xunit_family) + _result, dom = run_and_parse(family=xunit_family) node = dom.get_first_by_tag("testsuite") tnode = node.get_first_by_tag("testcase") fnode = tnode.get_first_by_tag("failure") @@ -752,7 +752,7 @@ def test_fail(): assert 0 """ ) - result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") + _result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") node = dom.get_first_by_tag("testsuite") tnode = node.get_first_by_tag("testcase") @@ -777,7 +777,7 @@ def test_xpass(): pass """ ) - result, dom = run_and_parse(family=xunit_family) + _result, dom = run_and_parse(family=xunit_family) # assert result.ret node = dom.get_first_by_tag("testsuite") node.assert_attr(skipped=0, tests=1) @@ -796,7 +796,7 @@ def test_xpass(): pass """ ) - result, dom = run_and_parse(family=xunit_family) + _result, dom = run_and_parse(family=xunit_family) # assert result.ret node = dom.get_first_by_tag("testsuite") node.assert_attr(skipped=0, tests=1) @@ -849,7 +849,7 @@ def test_str_compare(): assert M1 == M2 """ ) - result, dom = run_and_parse() + _result, dom = run_and_parse() print(dom.toxml()) @pytest.mark.parametrize("junit_logging", ["no", "system-out"]) @@ -862,7 +862,7 @@ def test_pass(): print('hello-stdout') """ ) - result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") + _result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") node = dom.get_first_by_tag("testsuite") pnode = node.get_first_by_tag("testcase") if junit_logging == "no": @@ -886,7 +886,7 @@ def test_pass(): sys.stderr.write('hello-stderr') """ ) - result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") + _result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") node = dom.get_first_by_tag("testsuite") pnode = node.get_first_by_tag("testcase") if junit_logging == "no": @@ -915,7 +915,7 @@ def test_function(arg): pass """ ) - result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") + _result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") node = dom.get_first_by_tag("testsuite") pnode = node.get_first_by_tag("testcase") if junit_logging == "no": @@ -945,7 +945,7 @@ def test_function(arg): pass """ ) - result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") + _result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") node = dom.get_first_by_tag("testsuite") pnode = node.get_first_by_tag("testcase") if junit_logging == "no": @@ -976,7 +976,7 @@ def test_function(arg): sys.stdout.write('hello-stdout call') """ ) - result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") + _result, dom = run_and_parse("-o", f"junit_logging={junit_logging}") node = dom.get_first_by_tag("testsuite") pnode = node.get_first_by_tag("testcase") if junit_logging == "no": @@ -1326,7 +1326,7 @@ def test_record_with_same_name(record_property): record_property("foo", "baz") """ ) - result, dom = run_and_parse() + _result, dom = run_and_parse() node = dom.get_first_by_tag("testsuite") tnode = node.get_first_by_tag("testcase") psnode = tnode.get_first_by_tag("properties") @@ -1402,7 +1402,7 @@ def test_record({fixture_name}, other): """ ) - result, dom = run_and_parse(family=None) + result, _dom = run_and_parse(family=None) expected_lines = [] if fixture_name == "record_xml_attribute": expected_lines.append( diff --git a/testing/test_legacypath.py b/testing/test_legacypath.py index 72854e4e5c0..80936667835 100644 --- a/testing/test_legacypath.py +++ b/testing/test_legacypath.py @@ -12,10 +12,10 @@ def test_item_fspath(pytester: pytest.Pytester) -> None: pytester.makepyfile("def test_func(): pass") - items, hookrec = pytester.inline_genitems() + items, _hookrec = pytester.inline_genitems() assert len(items) == 1 (item,) = items - items2, hookrec = pytester.inline_genitems(item.nodeid) + items2, _hookrec = pytester.inline_genitems(item.nodeid) (item2,) = items2 assert item2.name == item.name assert item2.fspath == item.fspath diff --git a/testing/test_main.py b/testing/test_main.py index 3f173ec4e9f..bfe6cad93a9 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -262,7 +262,7 @@ def test_absolute_paths_are_resolved_correctly(self, invocation_path: Path) -> N # ensure full paths given in the command-line without the drive letter resolve # to the full path correctly (#7628) - drive, full_path_without_drive = os.path.splitdrive(full_path) + _drive, full_path_without_drive = os.path.splitdrive(full_path) assert resolve_collection_argument( invocation_path, full_path_without_drive ) == CollectionArgument( @@ -300,7 +300,7 @@ def test(fix): fn = pytester.path.joinpath("project/tests/dummy_test.py") assert fn.is_file() - drive, path = os.path.splitdrive(str(fn)) + _drive, path = os.path.splitdrive(str(fn)) result = pytester.runpytest(path, "-v") result.stdout.fnmatch_lines( diff --git a/testing/test_mark.py b/testing/test_mark.py index 1e51f9db18f..9c067c3e430 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -228,7 +228,7 @@ def test_two(): """ ) rec = pytester.inline_run("-m", expr) - passed, skipped, fail = rec.listoutcomes() + passed, _skipped, _fail = rec.listoutcomes() passed_str = [x.nodeid.split("::")[-1] for x in passed] assert passed_str == expected_passed @@ -276,7 +276,7 @@ def test_three(): """ ) rec = pytester.inline_run("-m", expr) - passed, skipped, fail = rec.listoutcomes() + passed, _skipped, _fail = rec.listoutcomes() passed_str = [x.nodeid.split("::")[-1] for x in passed] assert passed_str == expected_passed @@ -306,7 +306,7 @@ def test_nointer(): """ ) rec = pytester.inline_run("-m", expr) - passed, skipped, fail = rec.listoutcomes() + passed, _skipped, _fail = rec.listoutcomes() passed_str = [x.nodeid.split("::")[-1] for x in passed] assert passed_str == expected_passed @@ -341,7 +341,7 @@ def test_2(): """ ) rec = pytester.inline_run("-k", expr) - passed, skipped, fail = rec.listoutcomes() + passed, _skipped, _fail = rec.listoutcomes() passed_str = [x.nodeid.split("::")[-1] for x in passed] assert passed_str == expected_passed @@ -373,7 +373,7 @@ def test_func(arg): """ ) rec = pytester.inline_run("-k", expr) - passed, skipped, fail = rec.listoutcomes() + passed, _skipped, _fail = rec.listoutcomes() passed_str = [x.nodeid.split("::")[-1] for x in passed] assert passed_str == expected_passed @@ -388,7 +388,7 @@ def test_func(arg): """ ) rec = pytester.inline_run() - passed, skipped, fail = rec.listoutcomes() + passed, _skipped, _fail = rec.listoutcomes() expected_id = "test_func[" + pytest.__name__ + "]" assert passed[0].nodeid.split("::")[-1] == expected_id @@ -537,7 +537,7 @@ def test_d(self): assert True """ ) - items, rec = pytester.inline_genitems(p) + items, _rec = pytester.inline_genitems(p) for item in items: print(item, item.keywords) assert [x for x in item.iter_markers() if x.name == "a"] @@ -560,7 +560,7 @@ class Test2(Base): def test_bar(self): pass """ ) - items, rec = pytester.inline_genitems(p) + items, _rec = pytester.inline_genitems(p) self.assert_markers(items, test_foo=("a", "b"), test_bar=("a",)) def test_mark_should_not_pass_to_siebling_class(self, pytester: Pytester) -> None: @@ -583,7 +583,7 @@ class TestOtherSub(TestBase): """ ) - items, rec = pytester.inline_genitems(p) + items, _rec = pytester.inline_genitems(p) base_item, sub_item, sub_item_other = items print(items, [x.nodeid for x in items]) # new api segregates @@ -611,7 +611,7 @@ class Test2(Base2): def test_bar(self): pass """ ) - items, rec = pytester.inline_genitems(p) + items, _rec = pytester.inline_genitems(p) self.assert_markers(items, test_foo=("a", "b", "c"), test_bar=("a", "b", "d")) def test_mark_closest(self, pytester: Pytester) -> None: @@ -630,7 +630,7 @@ def test_has_inherited(self): """ ) - items, rec = pytester.inline_genitems(p) + items, _rec = pytester.inline_genitems(p) has_own, has_inherited = items has_own_marker = has_own.get_closest_marker("c") has_inherited_marker = has_inherited.get_closest_marker("c") @@ -826,7 +826,7 @@ def test_method_one(self): def check(keyword, name): reprec = pytester.inline_run("-s", "-k", keyword, file_test) - passed, skipped, failed = reprec.listoutcomes() + _passed, _skipped, failed = reprec.listoutcomes() assert len(failed) == 1 assert failed[0].nodeid.split("::")[-1] == name assert len(reprec.getcalls("pytest_deselected")) == 1 @@ -869,7 +869,7 @@ def pytest_pycollect_makeitem(name): ) reprec = pytester.inline_run(p.parent, "-s", "-k", keyword) print("keyword", repr(keyword)) - passed, skipped, failed = reprec.listoutcomes() + passed, _skipped, _failed = reprec.listoutcomes() assert len(passed) == 1 assert passed[0].nodeid.endswith("test_2") dlist = reprec.getcalls("pytest_deselected") @@ -885,7 +885,7 @@ def test_one(): """ ) reprec = pytester.inline_run("-k", "mykeyword", p) - passed, skipped, failed = reprec.countoutcomes() + _passed, _skipped, failed = reprec.countoutcomes() assert failed == 1 @pytest.mark.xfail diff --git a/testing/test_nodes.py b/testing/test_nodes.py index f5f21e9775c..de7875ca427 100644 --- a/testing/test_nodes.py +++ b/testing/test_nodes.py @@ -24,10 +24,10 @@ def test_node_direct_construction_deprecated() -> None: with pytest.raises( OutcomeException, match=( - "Direct construction of _pytest.nodes.Node has been deprecated, please " - "use _pytest.nodes.Node.from_parent.\nSee " - "https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent" - " for more details." + r"Direct construction of _pytest\.nodes\.Node has been deprecated, please " + r"use _pytest\.nodes\.Node\.from_parent.\nSee " + r"https://docs\.pytest\.org/en/stable/deprecations\.html#node-construction-changed-to-node-from-parent" + r" for more details\." ), ): nodes.Node(None, session=None) # type: ignore[arg-type] diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py index 65a4117812f..0880c355557 100644 --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -1624,7 +1624,7 @@ def find_spec( return None # Setup directories without configuring sys.path. - models_py, algorithms_py = self.setup_directories( + models_py, _algorithms_py = self.setup_directories( tmp_path, monkeypatch=None, pytester=pytester ) com_root_1 = tmp_path / "src/dist1/com" diff --git a/testing/test_pluginmanager.py b/testing/test_pluginmanager.py index db85124bf0d..24700c07c80 100644 --- a/testing/test_pluginmanager.py +++ b/testing/test_pluginmanager.py @@ -436,7 +436,7 @@ def test_preparse_args(self, pytestpm: PytestPluginManager) -> None: # Handles -p without following arg (when used without argparse). pytestpm.consider_preparse(["-p"]) - with pytest.raises(UsageError, match="^plugin main cannot be disabled$"): + with pytest.raises(UsageError, match=r"^plugin main cannot be disabled$"): pytestpm.consider_preparse(["-p", "no:main"]) def test_plugin_prevent_register(self, pytestpm: PytestPluginManager) -> None: diff --git a/testing/test_pytester.py b/testing/test_pytester.py index a5ac8a91b8d..5e2e22f111b 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -799,7 +799,7 @@ def test_pytester_makefile_dot_prefixes_extension_with_warning( ) -> None: with pytest.raises( ValueError, - match="pytester.makefile expects a file extension, try .foo.bar instead of foo.bar", + match=r"pytester\.makefile expects a file extension, try \.foo\.bar instead of foo\.bar", ): pytester.makefile("foo.bar", "") diff --git a/testing/test_reports.py b/testing/test_reports.py index 5ffbde563b6..5c44ec72841 100644 --- a/testing/test_reports.py +++ b/testing/test_reports.py @@ -317,8 +317,8 @@ def check_longrepr(longrepr: ExceptionChainRepr) -> None: assert longrepr.sections == [("title", "contents", "=")] assert len(longrepr.chain) == 2 entry1, entry2 = longrepr.chain - tb1, fileloc1, desc1 = entry1 - tb2, fileloc2, desc2 = entry2 + tb1, _fileloc1, desc1 = entry1 + tb2, _fileloc2, desc2 = entry2 assert "ValueError('value error')" in str(tb1) assert "RuntimeError('runtime error')" in str(tb2) @@ -375,8 +375,8 @@ def check_longrepr(longrepr: object) -> None: assert isinstance(longrepr, ExceptionChainRepr) assert len(longrepr.chain) == 2 entry1, entry2 = longrepr.chain - tb1, fileloc1, desc1 = entry1 - tb2, fileloc2, desc2 = entry2 + tb1, fileloc1, _desc1 = entry1 + tb2, fileloc2, _desc2 = entry2 assert "RemoteTraceback" in str(tb1) assert "ValueError: value error" in str(tb2) diff --git a/testing/test_session.py b/testing/test_session.py index ba904916033..e3db9a1b690 100644 --- a/testing/test_session.py +++ b/testing/test_session.py @@ -66,7 +66,7 @@ def test_raises_doesnt(): pytest.raises(ValueError, int, "3") """ ) - passed, skipped, failed = reprec.listoutcomes() + _passed, _skipped, failed = reprec.listoutcomes() assert len(failed) == 1 out = failed[0].longrepr.reprcrash.message # type: ignore[union-attr] assert "DID NOT RAISE" in out diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 3a3b4057e45..558e3656524 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -1304,7 +1304,7 @@ def pytest_collect_file(file_path, parent): """ ) result = pytester.inline_run() - passed, skipped, failed = result.listoutcomes() + _passed, skipped, failed = result.listoutcomes() assert not failed xfailed = [r for r in skipped if hasattr(r, "wasxfail")] assert xfailed @@ -1378,7 +1378,7 @@ def pytest_collect_file(file_path, parent): """ ) result = pytester.inline_run() - passed, skipped, failed = result.listoutcomes() + _passed, skipped, failed = result.listoutcomes() assert not failed xfailed = [r for r in skipped if hasattr(r, "wasxfail")] assert xfailed @@ -1406,7 +1406,7 @@ def test_fail(): def test_importorskip() -> None: with pytest.raises( pytest.skip.Exception, - match="^could not import 'doesnotexist': No module named .*", + match=r"^could not import 'doesnotexist': No module named .*", ): pytest.importorskip("doesnotexist") diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index 016588a143d..363172110d3 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -386,7 +386,7 @@ def test_cleanup_lock_create(self, tmp_path): d = tmp_path.joinpath("test") d.mkdir() lockfile = create_cleanup_lock(d) - with pytest.raises(OSError, match="cannot create lockfile in .*"): + with pytest.raises(OSError, match=r"cannot create lockfile in .*"): create_cleanup_lock(d) lockfile.unlink() diff --git a/testing/test_unittest.py b/testing/test_unittest.py index 56224c08228..ece8183b5e3 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1374,7 +1374,7 @@ def test_cleanup_called_exactly_once(): """ ) reprec = pytester.inline_run(testpath) - passed, skipped, failed = reprec.countoutcomes() + passed, _skipped, failed = reprec.countoutcomes() assert failed == 0 assert passed == 3 @@ -1398,7 +1398,7 @@ def test_cleanup_called_exactly_once(): """ ) reprec = pytester.inline_run(testpath) - passed, skipped, failed = reprec.countoutcomes() + passed, _skipped, failed = reprec.countoutcomes() assert failed == 1 assert passed == 1 @@ -1426,7 +1426,7 @@ def test_cleanup_called_exactly_once(): """ ) reprec = pytester.inline_run(testpath) - passed, skipped, failed = reprec.countoutcomes() + passed, _skipped, _failed = reprec.countoutcomes() assert passed == 3 @@ -1449,7 +1449,7 @@ def test_cleanup_called_the_right_number_of_times(): """ ) reprec = pytester.inline_run(testpath) - passed, skipped, failed = reprec.countoutcomes() + passed, _skipped, failed = reprec.countoutcomes() assert failed == 0 assert passed == 3 @@ -1474,7 +1474,7 @@ def test_cleanup_called_the_right_number_of_times(): """ ) reprec = pytester.inline_run(testpath) - passed, skipped, failed = reprec.countoutcomes() + passed, _skipped, failed = reprec.countoutcomes() assert failed == 2 assert passed == 1 @@ -1500,7 +1500,7 @@ def test_cleanup_called_the_right_number_of_times(): """ ) reprec = pytester.inline_run(testpath) - passed, skipped, failed = reprec.countoutcomes() + passed, _skipped, failed = reprec.countoutcomes() assert failed == 2 assert passed == 1 @@ -1614,7 +1614,7 @@ def test_it(self): """ ) reprec = pytester.inline_run() - passed, skipped, failed = reprec.countoutcomes() + passed, _skipped, failed = reprec.countoutcomes() assert passed == 1 assert failed == 1 assert reprec.ret == 1 diff --git a/testing/test_warning_types.py b/testing/test_warning_types.py index 7cbc4703c26..81d8785733c 100644 --- a/testing/test_warning_types.py +++ b/testing/test_warning_types.py @@ -43,7 +43,7 @@ def test(): @pytest.mark.filterwarnings("error") def test_warn_explicit_for_annotates_errors_with_location(): - with pytest.raises(Warning, match="(?m)test\n at .*raises.py:\\d+"): + with pytest.raises(Warning, match=r"(?m)test\n at .*raises.py:\d+"): warning_types.warn_explicit_for( pytest.raises, # type: ignore[arg-type] warning_types.PytestWarning("test"), From 5d1366a4b2d337c48d7c45ea59168de6bb0e9a8f Mon Sep 17 00:00:00 2001 From: jakkdl Date: Sat, 20 Sep 2025 08:11:31 -0300 Subject: [PATCH 115/270] Fix type failures in raises.py and add tests Fix typing failures after mypy 1.18 update. --- src/_pytest/raises.py | 6 +++--- testing/python/raises_group.py | 10 ++++++++++ testing/test_monkeypatch.py | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/_pytest/raises.py b/src/_pytest/raises.py index 9066779a8af..2a53a5a148a 100644 --- a/src/_pytest/raises.py +++ b/src/_pytest/raises.py @@ -452,7 +452,7 @@ def _parse_exc( issubclass(origin_exc, BaseExceptionGroup) and exc_type in (BaseException, Any) ): - if not isinstance(exc, Exception): + if not issubclass(origin_exc, ExceptionGroup): self.is_baseexception = True return cast(type[BaseExcT_1], origin_exc) else: @@ -465,9 +465,9 @@ def _parse_exc( ) # unclear if the Type/ValueError distinction is even helpful here msg = f"expected exception must be {expected}, not " - if isinstance(exc, type): + if isinstance(exc, type): # type: ignore[unreachable] raise ValueError(msg + f"{exc.__name__!r}") - if isinstance(exc, BaseException): + if isinstance(exc, BaseException): # type: ignore[unreachable] raise TypeError(msg + f"an exception instance ({type(exc).__name__})") raise TypeError(msg + repr(type(exc).__name__)) diff --git a/testing/python/raises_group.py b/testing/python/raises_group.py index 6b9f98201dd..e911ba52cbc 100644 --- a/testing/python/raises_group.py +++ b/testing/python/raises_group.py @@ -1325,6 +1325,16 @@ def test_annotated_group() -> None: with RaisesExc(BaseExceptionGroup[BaseException]): raise BaseExceptionGroup("", [KeyboardInterrupt()]) + # assure AbstractRaises.is_baseexception is set properly + assert ( + RaisesGroup(ExceptionGroup[Exception]).expected_type() + == "ExceptionGroup(ExceptionGroup)" + ) + assert ( + RaisesGroup(BaseExceptionGroup[BaseException]).expected_type() + == "BaseExceptionGroup(BaseExceptionGroup)" + ) + def test_tuples() -> None: # raises has historically supported one of several exceptions being raised diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py index 0e992e298ec..edf3169bed5 100644 --- a/testing/test_monkeypatch.py +++ b/testing/test_monkeypatch.py @@ -417,7 +417,7 @@ def test_context() -> None: with monkeypatch.context() as m: m.setattr(functools, "partial", 3) assert not inspect.isclass(functools.partial) - assert inspect.isclass(functools.partial) # type:ignore[unreachable] + assert inspect.isclass(functools.partial) def test_context_classmethod() -> None: From b290db3838506ca03c3bda82dc7cb7c7a4b31a43 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 20 Sep 2025 10:26:45 -0300 Subject: [PATCH 116/270] test workflow: use an explicit matrix variable instead of an inline value zizmor complains that the previous approach was considered "obfuscation". Using a matrix value instead as suggested in https://github.com/pytest-dev/pytest/pull/13733#issuecomment-3314979079. --- .github/workflows/test.yml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41a0773e1af..61125eb2761 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,6 +112,7 @@ jobs: python: "3.10" os: windows-latest tox_env: "py310-pluggymain-pylib-xdist" + xfail: true - name: "windows-py310-xdist" python: "3.10" @@ -132,6 +133,7 @@ jobs: python: "3.13" os: windows-latest tox_env: "py313" + xfail: true - name: "windows-py314" python: "3.14" @@ -167,11 +169,13 @@ jobs: python: "3.10" os: ubuntu-latest tox_env: "py310-pluggymain-pylib-xdist" + xfail: true - name: "ubuntu-py310-freeze" python: "3.10" os: ubuntu-latest tox_env: "py310-freeze" + xfail: true - name: "ubuntu-py310-xdist" python: "3.10" @@ -195,6 +199,7 @@ jobs: os: ubuntu-latest tox_env: "py313-pexpect" use_coverage: true + xfail: true - name: "ubuntu-py314" python: "3.14" @@ -212,6 +217,7 @@ jobs: python: "3.10" os: macos-latest tox_env: "py310-xdist" + xfail: true - name: "macos-py312" python: "3.12" @@ -222,6 +228,7 @@ jobs: python: "3.13" os: macos-latest tox_env: "py313-xdist" + xfail: true - name: "macos-py314" python: "3.14" @@ -240,25 +247,7 @@ jobs: tox_env: "doctesting" use_coverage: true - continue-on-error: >- - ${{ - contains( - fromJSON( - '[ - "windows-py310-pluggy", - "windows-py313", - "ubuntu-py310-pluggy", - "ubuntu-py310-freeze", - "ubuntu-py313", - "macos-py310", - "macos-py313" - ]' - ), - matrix.name - ) - && true - || false - }} + continue-on-error: ${{ matrix.xfail && true || false }} steps: - uses: actions/checkout@v5 From 958981cab1dc568de4e3a30a46c526ffd7067658 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 06:51:49 +0200 Subject: [PATCH 117/270] build(deps): Bump pytest-mock in /testing/plugins_integration (#13744) Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.15.0 to 3.15.1. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.15.0...v3.15.1) --- updated-dependencies: - dependency-name: pytest-mock dependency-version: 3.15.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index f8095007751..fa874946e6c 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==7.0.0 pytest-django==4.11.1 pytest-flakes==4.0.5 pytest-html==4.1.1 -pytest-mock==3.15.0 +pytest-mock==3.15.1 pytest-rerunfailures==16.0.1 pytest-sugar==1.1.1 pytest-trio==0.8.0 From 6feed5655e9aa70caefabee0f6657acbc97ce861 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 07:04:25 +0200 Subject: [PATCH 118/270] [pre-commit.ci] pre-commit autoupdate (#13747) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.13.0 → v0.13.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.13.0...v0.13.1) - [github.com/pre-commit/mirrors-mypy: v1.18.1 → v1.18.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.18.1...v1.18.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c6cb8da92cb..8e4f73eb9d2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.13.0" + rev: "v0.13.1" hooks: - id: ruff args: ["--fix"] @@ -32,7 +32,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.18.1 + rev: v1.18.2 hooks: - id: mypy files: ^(src/|testing/|scripts/) From 969a6f9d4402982e0ae7f9d3f1a6df0adf9b74e7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 20 Sep 2025 08:44:40 -0300 Subject: [PATCH 119/270] Do not import pytest in unittest.py We should not import pytest directly in internal modules, as it might cause circular references because `import pytest` imports many other internal modules. --- src/_pytest/unittest.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index 341173ee6ac..282f7b25680 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -30,7 +30,6 @@ from _pytest.python import Function from _pytest.python import Module from _pytest.runner import CallInfo -import pytest if sys.version_info[:2] < (3, 11): @@ -141,7 +140,7 @@ def unittest_setup_class_fixture( cls = request.cls if _is_skipped(cls): reason = cls.__unittest_skip_why__ - raise pytest.skip.Exception(reason, _use_item_location=True) + raise skip.Exception(reason, _use_item_location=True) if setup is not None: try: setup() @@ -182,7 +181,7 @@ def unittest_setup_method_fixture( self = request.instance if _is_skipped(self): reason = self.__unittest_skip_why__ - raise pytest.skip.Exception(reason, _use_item_location=True) + raise skip.Exception(reason, _use_item_location=True) if setup is not None: setup(self, request.function) yield @@ -280,7 +279,7 @@ def addFailure( def addSkip(self, testcase: unittest.TestCase, reason: str) -> None: try: - raise pytest.skip.Exception(reason, _use_item_location=True) + raise skip.Exception(reason, _use_item_location=True) except skip.Exception: self._addexcinfo(sys.exc_info()) From 237ede449cdb8fb3e2d929990a1b28ef5fbb3864 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 25 Sep 2025 18:21:08 +0200 Subject: [PATCH 120/270] doc: Remove cancelled training (#13752) --- doc/en/index.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 5b139800e0d..2d9e3bed42c 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,6 @@ .. sidebar:: **Next Open Trainings and Events** - - `Testen mit pytest `_ (German), via `Letsboot `_ (3 day in-depth training), **October 29th -- 31st**, Zurich (CH) - `Professional Testing with Python `_, via `Python Academy `_ (3 day in-depth training), **March 3th -- 5th 2026**, Leipzig (DE) / Remote Also see :doc:`previous talks and blogposts ` From 2499ce217a3639c7f9485ce62525240844f81bed Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 14 Sep 2025 13:52:06 +0200 Subject: [PATCH 121/270] [refactor to use match] AssertionRewriter.run() Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- src/_pytest/assertion/rewrite.py | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index bff33ccf155..df79ae98d3b 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -703,24 +703,17 @@ def run(self, mod: ast.Module) -> None: return pos = 0 for item in mod.body: - if ( - expect_docstring - and isinstance(item, ast.Expr) - and isinstance(item.value, ast.Constant) - and isinstance(item.value.value, str) - ): - doc = item.value.value - if self.is_rewrite_disabled(doc): - return - expect_docstring = False - elif ( - isinstance(item, ast.ImportFrom) - and item.level == 0 - and item.module == "__future__" - ): - pass - else: - break + match item: + case ast.Expr(value=ast.Constant(value=str() as doc)) if ( + expect_docstring + ): + if self.is_rewrite_disabled(doc): + return + expect_docstring = False + case ast.ImportFrom(level=0, module="__future__"): + pass + case _: + break pos += 1 # Special case: for a decorated function, set the lineno to that of the # first decorator, not the `def`. Issue #4984. From ef7a432896ed8ce0dd0316597b18f2260037bf6b Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 14 Sep 2025 14:00:27 +0200 Subject: [PATCH 122/270] [refactor to use match] AssertionRewriter.visit_Compare() --- src/_pytest/assertion/rewrite.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index df79ae98d3b..4ef68f28082 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -1112,12 +1112,13 @@ def visit_Attribute(self, attr: ast.Attribute) -> tuple[ast.Name, str]: def visit_Compare(self, comp: ast.Compare) -> tuple[ast.expr, str]: self.push_format_context() # We first check if we have overwritten a variable in the previous assert - if isinstance( - comp.left, ast.Name - ) and comp.left.id in self.variables_overwrite.get(self.scope, {}): - comp.left = self.variables_overwrite[self.scope][comp.left.id] # type:ignore[assignment] - if isinstance(comp.left, ast.NamedExpr): - self.variables_overwrite[self.scope][comp.left.target.id] = comp.left # type:ignore[assignment] + match comp.left: + case ast.Name(id=name_id) if name_id in self.variables_overwrite.get( + self.scope, {} + ): + comp.left = self.variables_overwrite[self.scope][name_id] # type: ignore[assignment] + case ast.NamedExpr(target=ast.Name(id=target_id)): + self.variables_overwrite[self.scope][target_id] = comp.left # type: ignore[assignment] left_res, left_expl = self.visit(comp.left) if isinstance(comp.left, ast.Compare | ast.BoolOp): left_expl = f"({left_expl})" @@ -1129,13 +1130,14 @@ def visit_Compare(self, comp: ast.Compare) -> tuple[ast.expr, str]: syms: list[ast.expr] = [] results = [left_res] for i, op, next_operand in it: - if ( - isinstance(next_operand, ast.NamedExpr) - and isinstance(left_res, ast.Name) - and next_operand.target.id == left_res.id - ): - next_operand.target.id = self.variable() - self.variables_overwrite[self.scope][left_res.id] = next_operand # type:ignore[assignment] + match (next_operand, left_res): + case ( + ast.NamedExpr(target=ast.Name(id=target_id)), + ast.Name(id=name_id), + ) if target_id == name_id: + next_operand.target.id = self.variable() + self.variables_overwrite[self.scope][name_id] = next_operand # type: ignore[assignment] + next_res, next_expl = self.visit(next_operand) if isinstance(next_operand, ast.Compare | ast.BoolOp): next_expl = f"({next_expl})" From b4e8769da499bff9020a0726cf7b83a3b77fac84 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 14 Sep 2025 14:26:53 +0200 Subject: [PATCH 123/270] [refactor to use match] AssertionRewriter.visit_BoolOp() --- src/_pytest/assertion/rewrite.py | 25 +++++++++++-------------- testing/test_assertrewrite.py | 20 +++++++++++++++++++- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 4ef68f28082..d65d85be44b 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -1010,20 +1010,17 @@ def visit_BoolOp(self, boolop: ast.BoolOp) -> tuple[ast.Name, str]: # cond is set in a prior loop iteration below self.expl_stmts.append(ast.If(cond, fail_inner, [])) # noqa: F821 self.expl_stmts = fail_inner - # Check if the left operand is a ast.NamedExpr and the value has already been visited - if ( - isinstance(v, ast.Compare) - and isinstance(v.left, ast.NamedExpr) - and v.left.target.id - in [ - ast_expr.id - for ast_expr in boolop.values[:i] - if hasattr(ast_expr, "id") - ] - ): - pytest_temp = self.variable() - self.variables_overwrite[self.scope][v.left.target.id] = v.left # type:ignore[assignment] - v.left.target.id = pytest_temp + match v: + # Check if the left operand is an ast.NamedExpr and the value has already been visited + case ast.Compare( + left=ast.NamedExpr(target=ast.Name(id=target_id)) + ) if target_id in [ + e.id for e in boolop.values[:i] if hasattr(e, "id") + ]: + pytest_temp = self.variable() + self.variables_overwrite[self.scope][target_id] = v.left # type:ignore[assignment] + # mypy's false positive, we're checking that the 'target' attribute exists. + v.left.target.id = pytest_temp # type:ignore[attr-defined] self.push_format_context() res, expl = self.visit(v) body.append(ast.Assign([ast.Name(res_var, ast.Store())], res)) diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 18bc32dc86f..92664354470 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1552,7 +1552,9 @@ def test_simple_failure(): result.stdout.fnmatch_lines(["*E*assert (1 + 1) == 3"]) -class TestIssue10743: +class TestAssertionRewriteWalrusOperator: + """See #10743""" + def test_assertion_walrus_operator(self, pytester: Pytester) -> None: pytester.makepyfile( """ @@ -1719,6 +1721,22 @@ def test_walrus_operator_not_override_value(): result = pytester.runpytest() assert result.ret == 0 + def test_assertion_namedexpr_compare_left_overwrite( + self, pytester: Pytester + ) -> None: + pytester.makepyfile( + """ + def test_namedexpr_compare_left_overwrite(): + a = "Hello" + b = "World" + c = "Test" + assert (a := b) == c and (a := "Test") == "Test" + """ + ) + result = pytester.runpytest() + assert result.ret == 1 + result.stdout.fnmatch_lines(["*assert ('World' == 'Test'*"]) + class TestIssue11028: def test_assertion_walrus_operator_in_operand(self, pytester: Pytester) -> None: From 7308a725ef20bfd979c66555c3eb586d5d75fcb8 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 14 Sep 2025 14:29:30 +0200 Subject: [PATCH 124/270] [refactor to use match] AssertionRewriter.visit_Call() --- src/_pytest/assertion/rewrite.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index d65d85be44b..566549d66f2 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -1070,10 +1070,11 @@ def visit_Call(self, call: ast.Call) -> tuple[ast.Name, str]: arg_expls.append(expl) new_args.append(res) for keyword in call.keywords: - if isinstance( - keyword.value, ast.Name - ) and keyword.value.id in self.variables_overwrite.get(self.scope, {}): - keyword.value = self.variables_overwrite[self.scope][keyword.value.id] # type:ignore[assignment] + match keyword.value: + case ast.Name(id=id) if id in self.variables_overwrite.get( + self.scope, {} + ): + keyword.value = self.variables_overwrite[self.scope][id] # type:ignore[assignment] res, expl = self.visit(keyword.value) new_kwargs.append(ast.keyword(keyword.arg, res)) if keyword.arg: From de8220df18843a290243dd33c8960c0391778ea8 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 28 Sep 2025 00:29:20 +0000 Subject: [PATCH 125/270] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 114 +++++++++++++++---------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 09555d5b2db..70fe12c92ff 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -94,7 +94,7 @@ This list contains 1719 plugins. :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-api-cov` Pytest Plugin to provide API Coverage statistics for Python Web Frameworks Sep 11, 2025 N/A pytest>=6.0.0 :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Sep 16, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Sep 25, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -172,7 +172,7 @@ This list contains 1719 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Sep 15, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Sep 25, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -419,7 +419,7 @@ This list contains 1719 plugins. :pypi:`pytest-ditto-pyarrow` pytest-ditto plugin for pyarrow tables. Jun 09, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-django` A Django plugin for pytest. Apr 03, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Aug 30, 2025 5 - Production/Stable pytest + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Sep 27, 2025 5 - Production/Stable pytest :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A :pypi:`pytest-django-class` A pytest plugin for running django in class-scoped fixtures Aug 08, 2023 4 - Beta N/A @@ -474,7 +474,7 @@ This list contains 1719 plugins. :pypi:`pytest-donde` record pytest session characteristics per test item (coverage and duration) into a persistent file and use them in your own plugin or script. Oct 01, 2023 4 - Beta pytest >=7.3.1 :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) - :pypi:`pytest-dotenv-modern` A modern pytest plugin that loads environment variables from dotenv files Sep 14, 2025 4 - Beta pytest>=6.0.0 + :pypi:`pytest-dotenv-modern` A modern pytest plugin that loads environment variables from dotenv files Sep 27, 2025 4 - Beta pytest>=6.0.0 :pypi:`pytest-dot-only-pkcopley` A Pytest marker for only running a single test Oct 27, 2023 N/A N/A :pypi:`pytest-dparam` A more readable alternative to @pytest.mark.parametrize. Aug 27, 2024 6 - Mature pytest :pypi:`pytest-dpg` pytest-dpg is a pytest plugin for testing Dear PyGui (DPG) applications Aug 13, 2024 N/A N/A @@ -510,15 +510,15 @@ This list contains 1719 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Sep 17, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Sep 17, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Sep 17, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Sep 17, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Sep 17, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Sep 17, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Sep 17, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Sep 17, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Sep 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Sep 25, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Sep 25, 2025 5 - Production/Stable N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 09, 2023 4 - Beta pytest (==7.0.1) @@ -676,7 +676,7 @@ This list contains 1719 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Sep 19, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Sep 26, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -690,7 +690,7 @@ This list contains 1719 plugins. :pypi:`pytest-gitlabci-parallelized` Parallelize pytest across GitLab CI workers. Mar 08, 2023 N/A N/A :pypi:`pytest-gitlab-code-quality` Collects warnings while testing and generates a GitLab Code Quality Report. Sep 09, 2024 N/A pytest>=8.1.1 :pypi:`pytest-gitlab-fold` Folds output sections in GitLab CI build log Dec 31, 2023 4 - Beta pytest >=2.6.0 - :pypi:`pytest-gitscope` A pragmatic pytest plugin that runs only the tests that matter, and ship faster Sep 07, 2025 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-gitscope` A pragmatic pytest plugin that runs only the tests that matter, and ship faster Sep 24, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 20, 2025 4 - Beta pytest<=8.4.1 :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest @@ -726,7 +726,7 @@ This list contains 1719 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 20, 2025 3 - Alpha pytest==8.4.1 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 27, 2025 3 - Alpha pytest==8.4.2 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -736,7 +736,7 @@ This list contains 1719 plugins. :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 27, 2023 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Feb 28, 2023 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Nov 07, 2023 5 - Production/Stable pytest>=7.0.0 - :pypi:`pytest-html5` the best report for pytest Jul 28, 2025 N/A N/A + :pypi:`pytest-html5` the best report for pytest Sep 22, 2025 N/A N/A :pypi:`pytest-html-cn` pytest plugin for generating HTML reports Aug 19, 2024 5 - Production/Stable pytest!=6.0.0,>=5.0 :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A @@ -769,7 +769,7 @@ This list contains 1719 plugins. :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jul 25, 2025 4 - Beta pytest>=7.0.0 - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Sep 19, 2025 4 - Beta pytest + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Sep 26, 2025 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Dec 05, 2023 4 - Beta pytest :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Dec 13, 2023 5 - Production/Stable N/A @@ -953,7 +953,7 @@ This list contains 1719 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Aug 18, 2025 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Sep 10, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Sep 24, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -962,7 +962,7 @@ This list contains 1719 plugins. :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mfd-config` Pytest Plugin that handles test and topology configs and all their belongings like helper fixtures. Jul 11, 2025 N/A pytest<9,>=7.2.1 :pypi:`pytest-mfd-logging` Module for handling PyTest logging. Jul 09, 2025 N/A pytest<9,>=7.2.1 - :pypi:`pytest-mh` Pytest multihost plugin Jun 05, 2025 N/A pytest + :pypi:`pytest-mh` Pytest multihost plugin Sep 25, 2025 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-mimic` Easily record function calls while testing Apr 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) @@ -994,7 +994,7 @@ This list contains 1719 plugins. :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Aug 01, 2025 5 - Production/Stable pytest>=6.2 :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures May 16, 2023 5 - Production/Stable N/A :pypi:`pytest-mongodb-nono` pytest plugin for MongoDB Jan 07, 2025 N/A N/A - :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Jul 16, 2025 N/A N/A + :pypi:`pytest-mongodb-ry` pytest plugin for MongoDB Sep 25, 2025 N/A N/A :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Jun 25, 2023 5 - Production/Stable pytest :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A @@ -1008,7 +1008,7 @@ This list contains 1719 plugins. :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Nov 15, 2022 4 - Beta pytest (>=6) :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Sep 10, 2025 5 - Production/Stable pytest<9; extra == "test" :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A - :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jan 17, 2023 N/A pytest + :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Sep 21, 2025 N/A pytest :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 05, 2024 N/A N/A :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Nov 25, 2022 N/A N/A :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) @@ -1094,7 +1094,7 @@ This list contains 1719 plugins. :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) :pypi:`pytest-parametrization` Simpler PyTest parametrization May 22, 2022 5 - Production/Stable N/A :pypi:`pytest-parametrization-annotation` A pytest library for parametrizing tests using type hints. Dec 10, 2024 5 - Production/Stable pytest>=7 - :pypi:`pytest-parametrize` pytest decorator for parametrizing test cases in a dict-way Jun 15, 2025 5 - Production/Stable pytest<9.0.0,>=8.3.0 + :pypi:`pytest-parametrize` pytest decorator for parametrizing test cases in a dict-way Sep 25, 2025 5 - Production/Stable pytest<9.0.0,>=8.3.0 :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-parametrized` Pytest decorator for parametrizing tests with default iterables. Dec 21, 2024 5 - Production/Stable pytest :pypi:`pytest-parametrize-suite` A simple pytest extension for creating a named test suite. Jan 19, 2023 5 - Production/Stable pytest @@ -1354,7 +1354,7 @@ This list contains 1719 plugins. :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Jun 19, 2025 4 - Beta pytest>=5 :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Aug 13, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Sep 25, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 @@ -1371,7 +1371,7 @@ This list contains 1719 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 20, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 25, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. Sep 03, 2025 5 - Production/Stable pytest<9,>=7.4 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1383,7 +1383,7 @@ This list contains 1719 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 20, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 25, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1494,7 +1494,7 @@ This list contains 1719 plugins. :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A :pypi:`pytest-stepthrough` Pause and wait for Enter after each test with --step Aug 14, 2025 N/A N/A :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A - :pypi:`pytest-stf` pytest plugin for openSTF Sep 24, 2024 N/A pytest>=5.0 + :pypi:`pytest-stf` pytest plugin for openSTF Sep 23, 2025 N/A pytest>=5.0 :pypi:`pytest-stochastics` pytest plugin that allows selectively running tests several times and accepting \*some\* failures. Dec 01, 2024 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A :pypi:`pytest-storage` Pytest plugin to store test artifacts Sep 12, 2025 3 - Alpha pytest>=8.4.2 @@ -1693,7 +1693,7 @@ This list contains 1719 plugins. :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-webstage` Test web apps with pytest Sep 20, 2024 N/A pytest<9.0,>=7.0 :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A - :pypi:`pytest-when` Utility which makes mocking more readable and controllable Nov 29, 2024 N/A pytest>=7.3.1 + :pypi:`pytest-when` Utility which makes mocking more readable and controllable Sep 25, 2025 N/A pytest>=7.3.1 :pypi:`pytest-whirlwind` Testing Tornado. Jun 12, 2020 N/A N/A :pypi:`pytest-wholenodeid` pytest addon for displaying the whole node id for failures Aug 26, 2015 4 - Beta pytest (>=2.0) :pypi:`pytest-win32consoletitle` Pytest progress in console title (Win32 only) Aug 08, 2021 N/A N/A @@ -2179,7 +2179,7 @@ This list contains 1719 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Sep 16, 2025, + *last release*: Sep 25, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2725,7 +2725,7 @@ This list contains 1719 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Sep 15, 2025, + *last release*: Sep 25, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -4454,7 +4454,7 @@ This list contains 1719 plugins. A Django plugin for pytest. :pypi:`pytest-djangoapp` - *last release*: Aug 30, 2025, + *last release*: Sep 27, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -4839,7 +4839,7 @@ This list contains 1719 plugins. A py.test plugin that parses environment files before running tests :pypi:`pytest-dotenv-modern` - *last release*: Sep 14, 2025, + *last release*: Sep 27, 2025, *status*: 4 - Beta, *requires*: pytest>=6.0.0 @@ -5091,63 +5091,63 @@ This list contains 1719 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-idf` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: Sep 17, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -6253,7 +6253,7 @@ This list contains 1719 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Sep 19, 2025, + *last release*: Sep 26, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6351,7 +6351,7 @@ This list contains 1719 plugins. Folds output sections in GitLab CI build log :pypi:`pytest-gitscope` - *last release*: Sep 07, 2025, + *last release*: Sep 24, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0.0 @@ -6603,9 +6603,9 @@ This list contains 1719 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Sep 20, 2025, + *last release*: Sep 27, 2025, *status*: 3 - Alpha, - *requires*: pytest==8.4.1 + *requires*: pytest==8.4.2 Experimental package to automatically extract test plugins for Home Assistant custom components @@ -6673,7 +6673,7 @@ This list contains 1719 plugins. pytest plugin for generating HTML reports :pypi:`pytest-html5` - *last release*: Jul 28, 2025, + *last release*: Sep 22, 2025, *status*: N/A, *requires*: N/A @@ -6904,7 +6904,7 @@ This list contains 1719 plugins. A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite :pypi:`pytest-ibutsu` - *last release*: Sep 19, 2025, + *last release*: Sep 26, 2025, *status*: 4 - Beta, *requires*: pytest @@ -8192,7 +8192,7 @@ This list contains 1719 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Sep 10, 2025, + *last release*: Sep 24, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8255,7 +8255,7 @@ This list contains 1719 plugins. Module for handling PyTest logging. :pypi:`pytest-mh` - *last release*: Jun 05, 2025, + *last release*: Sep 25, 2025, *status*: N/A, *requires*: pytest @@ -8479,7 +8479,7 @@ This list contains 1719 plugins. pytest plugin for MongoDB :pypi:`pytest-mongodb-ry` - *last release*: Jul 16, 2025, + *last release*: Sep 25, 2025, *status*: N/A, *requires*: N/A @@ -8577,7 +8577,7 @@ This list contains 1719 plugins. Utility for writing multi-host tests for pytest :pypi:`pytest-multilog` - *last release*: Jan 17, 2023, + *last release*: Sep 21, 2025, *status*: N/A, *requires*: pytest @@ -9179,7 +9179,7 @@ This list contains 1719 plugins. A pytest library for parametrizing tests using type hints. :pypi:`pytest-parametrize` - *last release*: Jun 15, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9.0.0,>=8.3.0 @@ -10999,7 +10999,7 @@ This list contains 1719 plugins. implement a --failed option for pytest :pypi:`pytest-run-parallel` - *last release*: Aug 13, 2025, + *last release*: Sep 25, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 @@ -11118,7 +11118,7 @@ This list contains 1719 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Sep 20, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11202,7 +11202,7 @@ This list contains 1719 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Sep 20, 2025, + *last release*: Sep 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11979,7 +11979,7 @@ This list contains 1719 plugins. Run a test suite one failing test at a time. :pypi:`pytest-stf` - *last release*: Sep 24, 2024, + *last release*: Sep 23, 2025, *status*: N/A, *requires*: pytest>=5.0 @@ -13372,7 +13372,7 @@ This list contains 1719 plugins. Welian API Automation test framework pytest plugin :pypi:`pytest-when` - *last release*: Nov 29, 2024, + *last release*: Sep 25, 2025, *status*: N/A, *requires*: pytest>=7.3.1 From bd7d709503adbe576f0120e36849eeccebe74e5b Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 28 Sep 2025 09:23:12 +0200 Subject: [PATCH 126/270] [ruff configuration] Fix legacy alias and top-level linter settings (#13761) --- .pre-commit-config.yaml | 2 +- doc/en/example/.ruff.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8e4f73eb9d2..afb862b9de5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: "v0.13.1" hooks: - - id: ruff + - id: ruff-check args: ["--fix"] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/doc/en/example/.ruff.toml b/doc/en/example/.ruff.toml index 1cbca296f8c..feddc5c0654 100644 --- a/doc/en/example/.ruff.toml +++ b/doc/en/example/.ruff.toml @@ -1 +1 @@ -ignore = ["RUF059"] +lint.ignore = ["RUF059"] From 5c082041d51af73b707b9f87a9a0f3a3fc941161 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 06:32:21 +0200 Subject: [PATCH 127/270] build(deps): Bump anyio[trio] in /testing/plugins_integration (#13763) Bumps [anyio[trio]](https://github.com/agronholm/anyio) from 4.10.0 to 4.11.0. - [Release notes](https://github.com/agronholm/anyio/releases) - [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst) - [Commits](https://github.com/agronholm/anyio/compare/4.10.0...4.11.0) --- updated-dependencies: - dependency-name: anyio[trio] dependency-version: 4.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index fa874946e6c..a207d325e27 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,4 +1,4 @@ -anyio[trio]==4.10.0 +anyio[trio]==4.11.0 django==5.2.1 pytest-asyncio==1.2.0 pytest-bdd==8.1.0 From 184f5f1dfe3b8c987304b05bbacc2da86d8ad7d3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 21:18:25 +0000 Subject: [PATCH 128/270] [pre-commit.ci] pre-commit autoupdate (#13765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.13.1 → v0.13.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.13.1...v0.13.2) - [github.com/woodruffw/zizmor-pre-commit: v1.13.0 → v1.14.2](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.13.0...v1.14.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afb862b9de5..5aaa9f84386 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.13.1" + rev: "v0.13.2" hooks: - id: ruff-check args: ["--fix"] @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.13.0 + rev: v1.14.2 hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs From 1396ca6b0ea6e32e8c9933f1a9c7cd7ba4154c71 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 30 Sep 2025 10:04:24 +0300 Subject: [PATCH 129/270] compat: state in the module docstring that it also contains utilities Maybe it's not ideal but that's the current reality, and I wouldn't like to break tradition by renaming the file. --- src/_pytest/compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index bef8c317bb9..b8f5ebe04e7 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -1,5 +1,5 @@ # mypy: allow-untyped-defs -"""Python version compatibility code.""" +"""Python version compatibility code and random general utilities.""" from __future__ import annotations From d70cf2c34375da548d99498abb3d32c2e1203020 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 30 Sep 2025 10:06:24 +0300 Subject: [PATCH 130/270] cacheprovider: drop +x mode bit from file The file is definitely not executable. --- src/_pytest/cacheprovider.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/_pytest/cacheprovider.py diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py old mode 100755 new mode 100644 From 57e38ccddfe8eecdb64241cce0f29db667e2e513 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 30 Sep 2025 10:08:19 +0300 Subject: [PATCH 131/270] compat: assert_never is now in the stdlib Use the upstream implementation, so we can easily drop our own impl when we drop Python 3.10. --- src/_pytest/compat.py | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index b8f5ebe04e7..43ec0ebcd26 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -278,39 +278,12 @@ def get_user_id() -> int | None: return uid if uid != ERROR else None -# Perform exhaustiveness checking. -# -# Consider this example: -# -# MyUnion = Union[int, str] -# -# def handle(x: MyUnion) -> int { -# if isinstance(x, int): -# return 1 -# elif isinstance(x, str): -# return 2 -# else: -# raise Exception('unreachable') -# -# Now suppose we add a new variant: -# -# MyUnion = Union[int, str, bytes] -# -# After doing this, we must remember ourselves to go and update the handle -# function to handle the new variant. -# -# With `assert_never` we can do better: -# -# // raise Exception('unreachable') -# return assert_never(x) -# -# Now, if we forget to handle the new variant, the type-checker will emit a -# compile-time error, instead of the runtime error we would have gotten -# previously. -# -# This also work for Enums (if you use `is` to compare) and Literals. -def assert_never(value: NoReturn) -> NoReturn: - assert False, f"Unhandled value: {value} ({type(value).__name__})" +if sys.version_info >= (3, 11): + from typing import assert_never +else: + + def assert_never(value: NoReturn) -> NoReturn: + assert False, f"Unhandled value: {value} ({type(value).__name__})" class CallableBool: From 082a27e30153a840c467f9ade194602e6882d157 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 30 Sep 2025 10:12:06 +0300 Subject: [PATCH 132/270] compat: move `running_on_ci()` to compat Currently defined in `_pytest.assertion.util`, but then imported from `_pytest.terminal`, so makes sense to move it to the general utils place. --- src/_pytest/assertion/truncate.py | 4 ++-- src/_pytest/assertion/util.py | 8 +------- src/_pytest/compat.py | 6 ++++++ src/_pytest/terminal.py | 2 +- testing/test_collection.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/_pytest/assertion/truncate.py b/src/_pytest/assertion/truncate.py index 4854a62ba6b..5820e6e8a80 100644 --- a/src/_pytest/assertion/truncate.py +++ b/src/_pytest/assertion/truncate.py @@ -6,7 +6,7 @@ from __future__ import annotations -from _pytest.assertion import util +from _pytest.compat import running_on_ci from _pytest.config import Config from _pytest.nodes import Item @@ -43,7 +43,7 @@ def _get_truncation_parameters(item: Item) -> tuple[bool, int, int]: verbose = item.config.get_verbosity(Config.VERBOSITY_ASSERTIONS) - should_truncate = verbose < 2 and not util.running_on_ci() + should_truncate = verbose < 2 and not running_on_ci() should_truncate = should_truncate and (max_lines > 0 or max_chars > 0) return should_truncate, max_lines, max_chars diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index cc499f7186f..f35d83a6fe4 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -9,7 +9,6 @@ from collections.abc import Mapping from collections.abc import Sequence from collections.abc import Set as AbstractSet -import os import pprint from typing import Any from typing import Literal @@ -21,6 +20,7 @@ from _pytest._io.pprint import PrettyPrinter from _pytest._io.saferepr import saferepr from _pytest._io.saferepr import saferepr_unlimited +from _pytest.compat import running_on_ci from _pytest.config import Config @@ -613,9 +613,3 @@ def _notin_text(term: str, text: str, verbose: int = 0) -> list[str]: else: newdiff.append(line) return newdiff - - -def running_on_ci() -> bool: - """Check if we're currently running on a CI system.""" - env_vars = ["CI", "BUILD_NUMBER"] - return any(var in os.environ for var in env_vars) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 43ec0ebcd26..c00000c794d 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -304,3 +304,9 @@ def __bool__(self) -> bool: def __call__(self) -> bool: return self._value + + +def running_on_ci() -> bool: + """Check if we're currently running on a CI system.""" + env_vars = ["CI", "BUILD_NUMBER"] + return any(var in os.environ for var in env_vars) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index a95f79ba6b6..857c83bc457 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -39,7 +39,7 @@ from _pytest._io import TerminalWriter from _pytest._io.wcwidth import wcswidth import _pytest._version -from _pytest.assertion.util import running_on_ci +from _pytest.compat import running_on_ci from _pytest.config import _PluggyPlugin from _pytest.config import Config from _pytest.config import ExitCode diff --git a/testing/test_collection.py b/testing/test_collection.py index bb2fd82c898..0dcf2990ed3 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -10,7 +10,7 @@ import tempfile import textwrap -from _pytest.assertion.util import running_on_ci +from _pytest.compat import running_on_ci from _pytest.config import ExitCode from _pytest.fixtures import FixtureRequest from _pytest.main import _in_venv From 304743c97c62714312093e03540d2a7bbade73cb Mon Sep 17 00:00:00 2001 From: Jordan Macdonald Date: Tue, 30 Sep 2025 17:08:05 -0400 Subject: [PATCH 133/270] Only enable CI mode is `$CI` or `$BUILD_NUMBER` is set to a non-empty string Previously, if either env variable was defined, CI mode would be activated, even if the variable was set to the empty string. This had some unfortunate consequences: * The easy and obvious method of setting those variables, i.e. `CI="${OTHER_VAR}"`, would not work, because `$CI` would always end up being defined even if `$OTHER_VAR` was undefined. * The easy and obvious method of clearing those variables at runtime, i.e. `CI="" pytest ...`, would not work, because again `$CI` would still be defined even though it was blank. Now, at least one of those variables must be set to a non-empty string in order to enabled CI mode. Closes https://github.com/pytest-dev/pytest/issues/13766 --- AUTHORS | 1 + changelog/13766.breaking.rst | 2 ++ doc/en/explanation/ci.rst | 3 +-- doc/en/reference/reference.rst | 6 +++--- src/_pytest/compat.py | 3 ++- src/_pytest/helpconfig.py | 2 +- testing/test_assertion.py | 16 ++++++++++++++++ testing/test_faulthandler.py | 2 +- 8 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 changelog/13766.breaking.rst diff --git a/AUTHORS b/AUTHORS index 52363a177bb..07bf59c0582 100644 --- a/AUTHORS +++ b/AUTHORS @@ -227,6 +227,7 @@ Jon Parise Jon Sonesen Jonas Obrist Jordan Guymon +Jordan Macdonald Jordan Moldow Jordan Speicher Joseph Hunkeler diff --git a/changelog/13766.breaking.rst b/changelog/13766.breaking.rst new file mode 100644 index 00000000000..d7bd5a9a0ee --- /dev/null +++ b/changelog/13766.breaking.rst @@ -0,0 +1,2 @@ +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/doc/en/explanation/ci.rst b/doc/en/explanation/ci.rst index 45fe658d14f..6f6734f395b 100644 --- a/doc/en/explanation/ci.rst +++ b/doc/en/explanation/ci.rst @@ -17,8 +17,7 @@ adapt some of its behaviours. How CI is detected ------------------ -Pytest knows it is in a CI environment when either one of these environment variables are set, -regardless of their value: +Pytest knows it is in a CI environment when either one of these environment variables are set to a non-empty value: * `CI`: used by many CI systems. * `BUILD_NUMBER`: used by Jenkins. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 7ec1b110baf..443530a2006 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1165,11 +1165,11 @@ Environment variables that can be used to change pytest's behavior. .. envvar:: CI -When set (regardless of value), pytest acknowledges that is running in a CI process. Alternative to ``BUILD_NUMBER`` variable. See also :ref:`ci-pipelines`. +When set to a non-empty value, pytest acknowledges that is running in a CI process. See also :ref:`ci-pipelines`. .. envvar:: BUILD_NUMBER -When set (regardless of value), pytest acknowledges that is running in a CI process. Alternative to CI variable. See also :ref:`ci-pipelines`. +When set to a non-empty value, pytest acknowledges that is running in a CI process. Alternative to :envvar:`CI`. See also :ref:`ci-pipelines`. .. envvar:: PYTEST_ADDOPTS @@ -2408,7 +2408,7 @@ All the command-line flags can be obtained by running ``pytest --help``:: Plugins that must be present for pytest to run Environment variables: - CI When set (regardless of value), pytest knows it is running in a CI process and does not truncate summary info + CI When set to a non-empty value, pytest knows it is running in a CI process and does not truncate summary info BUILD_NUMBER Equivalent to CI PYTEST_ADDOPTS Extra command line options PYTEST_PLUGINS Comma-separated plugins to load during startup diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index c00000c794d..2f5a4c863f9 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -308,5 +308,6 @@ def __call__(self) -> bool: def running_on_ci() -> bool: """Check if we're currently running on a CI system.""" + # Only enable CI mode if one of these env variables is defined and non-empty. env_vars = ["CI", "BUILD_NUMBER"] - return any(var in os.environ for var in env_vars) + return any(os.environ.get(var) for var in env_vars) diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index a531c75d28b..b2f6e5dd0ca 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -221,7 +221,7 @@ def showhelp(config: Config) -> None: vars = [ ( "CI", - "When set (regardless of value), pytest knows it is running in a " + "When set to a non-empty value, pytest knows it is running in a " "CI process and does not truncate summary info", ), ("BUILD_NUMBER", "Equivalent to CI"), diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 2c2830eb929..5179b13b0e9 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -567,6 +567,11 @@ def test_full_diff(): result = pytester.runpytest() result.stdout.fnmatch_lines(["E Full diff:"]) + # Setting CI to empty string is same as having it undefined + monkeypatch.setenv("CI", "") + result = pytester.runpytest() + result.stdout.fnmatch_lines(["E Use -v to get more diff"]) + monkeypatch.delenv("CI", raising=False) result = pytester.runpytest() result.stdout.fnmatch_lines(["E Use -v to get more diff"]) @@ -1465,6 +1470,17 @@ def test_many_lines(): result = pytester.runpytest("-vv") result.stdout.fnmatch_lines(["* 6*"]) + # Setting CI to empty string is same as having it undefined + monkeypatch.setenv("CI", "") + result = pytester.runpytest() + result.stdout.fnmatch_lines( + [ + "*+ 1*", + "*+ 3*", + f"*truncated ({expected_truncated_lines} lines hidden)*use*-vv*", + ] + ) + monkeypatch.setenv("CI", "1") result = pytester.runpytest() result.stdout.fnmatch_lines(["* 6*"]) diff --git a/testing/test_faulthandler.py b/testing/test_faulthandler.py index b308e89adbd..2362f9e1eaf 100644 --- a/testing/test_faulthandler.py +++ b/testing/test_faulthandler.py @@ -79,7 +79,7 @@ def test_disabled(): pytest.param( True, marks=pytest.mark.skipif( - "CI" in os.environ + bool(os.environ.get("CI")) and sys.platform == "linux" and sys.version_info >= (3, 14), reason="sometimes crashes on CI because of truncated outputs (#7022)", From 99cd7a2597d5571338cd38536e699a9eb080fa20 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 13 Sep 2025 21:17:06 +0300 Subject: [PATCH 134/270] terminal: notify terminal emulator about test session progress Use OSC 9;4 ANSI sequences terminal progress to notify the terminal emulator about progress, so it can display it to the user (e.g. on the terminal tab). Fix #13072. Co-Authored-By: Anna Tasiopoulou --- AUTHORS | 1 + changelog/13072.feature.rst | 8 +++ src/_pytest/terminal.py | 93 ++++++++++++++++++++++++++++ testing/test_terminal.py | 117 ++++++++++++++++++++++++++++++++++++ 4 files changed, 219 insertions(+) create mode 100644 changelog/13072.feature.rst diff --git a/AUTHORS b/AUTHORS index f93de06c10d..da7ca493f5e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -39,6 +39,7 @@ Andrzej Klajnert Andrzej Ostrowski Andy Freeland Anita Hammer +Anna Tasiopoulou Anthon van der Neut Anthony Shaw Anthony Sottile diff --git a/changelog/13072.feature.rst b/changelog/13072.feature.rst new file mode 100644 index 00000000000..6f9fd11e540 --- /dev/null +++ b/changelog/13072.feature.rst @@ -0,0 +1,8 @@ +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/src/_pytest/terminal.py b/src/_pytest/terminal.py index d4d5c4e800c..7b047b01a0c 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -295,6 +295,10 @@ def mywriter(tags, args): config.trace.root.setprocessor("pytest:config", mywriter) + if reporter.isatty(): + plugin = TerminalProgressPlugin(reporter) + config.pluginmanager.register(plugin, "terminalprogress") + def getreportopt(config: Config) -> str: reportchars: str = config.option.reportchars @@ -1652,3 +1656,92 @@ def _get_raw_skip_reason(report: TestReport) -> str: elif reason == "Skipped": reason = "" return reason + + +class TerminalProgressPlugin: + """Terminal progress reporting plugin using OSC 9;4 ANSI sequences. + + Emits OSC 9;4 sequences to indicate test progress to terminal + tabs/windows/etc. + + Not all terminal emulators support this feature. + + Ref: https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC + """ + + def __init__(self, tr: TerminalReporter) -> None: + self._tr = tr + self._session: Session | None = None + self._has_failures = False + + def _emit_progress( + self, + state: Literal["remove", "normal", "error", "indeterminate", "paused"], + progress: int | None = None, + ) -> None: + """Emit OSC 9;4 sequence for indicating progress to the terminal. + + :param state: + Progress state to set. + :param progress: + Progress value 0-100. Required for "normal", optional for "error" + and "paused", otherwise ignored. + """ + assert progress is None or 0 <= progress <= 100 + + # OSC 9;4 sequence: ESC ] 9 ; 4 ; state ; progress ST + # ST can be ESC \ or BEL. ESC \ seems better supported. + match state: + case "remove": + sequence = "\x1b]9;4;0;\x1b\\" + case "normal": + assert progress is not None + sequence = f"\x1b]9;4;1;{progress}\x1b\\" + case "error": + if progress is not None: + sequence = f"\x1b]9;4;2;{progress}\x1b\\" + else: + sequence = "\x1b]9;4;2;\x1b\\" + case "indeterminate": + sequence = "\x1b]9;4;3;\x1b\\" + case "paused": + if progress is not None: + sequence = f"\x1b]9;4;4;{progress}\x1b\\" + else: + sequence = "\x1b]9;4;4;\x1b\\" + + self._tr.write_raw(sequence, flush=True) + + @hookimpl + def pytest_sessionstart(self, session: Session) -> None: + self._session = session + # Show indeterminate progress during collection. + self._emit_progress("indeterminate") + + @hookimpl + def pytest_collection_finish(self) -> None: + assert self._session is not None + if self._session.testscollected > 0: + # Switch from indeterminate to 0% progress. + self._emit_progress("normal", 0) + + @hookimpl + def pytest_runtest_logreport(self, report: TestReport) -> None: + if report.failed: + self._has_failures = True + + # Let's consider the "call" phase for progress. + if report.when != "call": + return + + # Calculate and emit progress. + assert self._session is not None + collected = self._session.testscollected + if collected > 0: + reported = self._tr.reported_progress + progress = min(reported * 100 // collected, 100) + self._emit_progress("error" if self._has_failures else "normal", progress) + + @hookimpl + def pytest_sessionfinish(self) -> None: + self._emit_progress("remove") diff --git a/testing/test_terminal.py b/testing/test_terminal.py index bacce108b42..44ce7aff563 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -10,7 +10,10 @@ import textwrap from types import SimpleNamespace from typing import cast +from typing import Literal from typing import NamedTuple +from unittest.mock import Mock +from unittest.mock import patch import pluggy @@ -30,6 +33,7 @@ from _pytest.terminal import _get_raw_skip_reason from _pytest.terminal import _plugin_nameversions from _pytest.terminal import getreportopt +from _pytest.terminal import TerminalProgressPlugin from _pytest.terminal import TerminalReporter import pytest @@ -3297,3 +3301,116 @@ def test_x(a): r".*test_foo.py::test_x\[a::b/\] .*FAILED.*", ] ) + + +class TestTerminalProgressPlugin: + """Tests for the TerminalProgressPlugin.""" + + @pytest.fixture + def mock_file(self) -> StringIO: + return StringIO() + + @pytest.fixture + def mock_tr(self, mock_file: StringIO) -> pytest.TerminalReporter: + tr = Mock(spec=pytest.TerminalReporter) + + def write_raw(s: str, *, flush: bool = False) -> None: + mock_file.write(s) + + tr.write_raw = write_raw + tr._progress_nodeids_reported = set() + return tr + + def test_plugin_registration(self, pytester: pytest.Pytester) -> None: + """Test that the plugin is registered correctly on TTY output.""" + # The plugin module should be registered as a default plugin. + with patch.object(sys.stdout, "isatty", return_value=True): + config = pytester.parseconfigure() + plugin = config.pluginmanager.get_plugin("terminalprogress") + assert plugin is not None + + def test_disabled_for_non_tty(self, pytester: pytest.Pytester) -> None: + """Test that plugin is disabled for non-TTY output.""" + with patch.object(sys.stdout, "isatty", return_value=False): + config = pytester.parseconfigure() + plugin = config.pluginmanager.get_plugin("terminalprogress") + assert plugin is None + + @pytest.mark.parametrize( + ["state", "progress", "expected"], + [ + ("indeterminate", None, "\x1b]9;4;3;\x1b\\"), + ("normal", 50, "\x1b]9;4;1;50\x1b\\"), + ("error", 75, "\x1b]9;4;2;75\x1b\\"), + ("paused", None, "\x1b]9;4;4;\x1b\\"), + ("paused", 80, "\x1b]9;4;4;80\x1b\\"), + ("remove", None, "\x1b]9;4;0;\x1b\\"), + ], + ) + def test_emit_progress_sequences( + self, + mock_file: StringIO, + mock_tr: pytest.TerminalReporter, + state: Literal["remove", "normal", "error", "indeterminate", "paused"], + progress: int | None, + expected: str, + ) -> None: + """Test that progress sequences are emitted correctly.""" + plugin = TerminalProgressPlugin(mock_tr) + plugin._emit_progress(state, progress) + assert expected in mock_file.getvalue() + + def test_session_lifecycle( + self, mock_file: StringIO, mock_tr: pytest.TerminalReporter + ) -> None: + """Test progress updates during session lifecycle.""" + plugin = TerminalProgressPlugin(mock_tr) + + session = Mock(spec=pytest.Session) + session.testscollected = 3 + + # Session start - should emit indeterminate progress. + plugin.pytest_sessionstart(session) + assert "\x1b]9;4;3;\x1b\\" in mock_file.getvalue() + mock_file.truncate(0) + mock_file.seek(0) + + # Collection finish - should emit 0% progress. + plugin.pytest_collection_finish() + assert "\x1b]9;4;1;0\x1b\\" in mock_file.getvalue() + mock_file.truncate(0) + mock_file.seek(0) + + # First test - 33% progress. + report1 = pytest.TestReport( + nodeid="test_1", + location=("test.py", 0, "test_1"), + when="call", + outcome="passed", + keywords={}, + longrepr=None, + ) + mock_tr.reported_progress = 1 # type: ignore[misc] + plugin.pytest_runtest_logreport(report1) + assert "\x1b]9;4;1;33\x1b\\" in mock_file.getvalue() + mock_file.truncate(0) + mock_file.seek(0) + + # Second test with failure - 66% in error state. + report2 = pytest.TestReport( + nodeid="test_2", + location=("test.py", 1, "test_2"), + when="call", + outcome="failed", + keywords={}, + longrepr=None, + ) + mock_tr.reported_progress = 2 # type: ignore[misc] + plugin.pytest_runtest_logreport(report2) + assert "\x1b]9;4;2;66\x1b\\" in mock_file.getvalue() + mock_file.truncate(0) + mock_file.seek(0) + + # Session finish - should remove progress. + plugin.pytest_sessionfinish() + assert "\x1b]9;4;0;\x1b\\" in mock_file.getvalue() From 72ae3dbf9608a70df683d081cf53146a8d79f1ea Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 1 Oct 2025 11:36:00 +0300 Subject: [PATCH 135/270] fixtures: fix fixture closure calculation to properly consider overridden fixtures Fix #13773. --- changelog/13773.bugfix.rst | 1 + src/_pytest/fixtures.py | 15 ++++- testing/python/fixtures.py | 129 +++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 changelog/13773.bugfix.rst diff --git a/changelog/13773.bugfix.rst b/changelog/13773.bugfix.rst new file mode 100644 index 00000000000..e3a9ff4b7a1 --- /dev/null +++ b/changelog/13773.bugfix.rst @@ -0,0 +1 @@ +Fixed the static fixture closure calculation to properly consider transitive dependencies requested by overridden fixtures. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 91f1b3a67f6..b0ce620c13a 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1645,9 +1645,18 @@ def getfixtureclosure( fixturedefs = self.getfixturedefs(argname, parentnode) if fixturedefs: arg2fixturedefs[argname] = fixturedefs - for arg in fixturedefs[-1].argnames: - if arg not in fixturenames_closure: - fixturenames_closure.append(arg) + + # Add dependencies from this fixture. + # If it overrides a fixture with the same name and requests + # it, also add dependencies from the overridden fixtures in + # the chain. See also similar dealing in _get_active_fixturedef(). + for fixturedef in reversed(fixturedefs): # pragma: no cover + for arg in fixturedef.argnames: + if arg not in fixturenames_closure: + fixturenames_closure.append(arg) + if argname not in fixturedef.argnames: + # Overrides, but doesn't request super. + break def sort_by_scope(arg_name: str) -> Scope: try: diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 8b97d35c21e..d673eac7742 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -5069,3 +5069,132 @@ def test_method(self, /, fix): ) result = pytester.runpytest() result.assert_outcomes(passed=1) + + +def test_fixture_closure_with_overrides(pytester: Pytester) -> None: + """Test that an item's static fixture closure properly includes transitive + dependencies through overridden fixtures (#13773).""" + pytester.makeconftest( + """ + import pytest + + @pytest.fixture + def db(): pass + + @pytest.fixture + def app(db): pass + """ + ) + pytester.makepyfile( + """ + import pytest + + # Overrides conftest-level `app` and requests it. + @pytest.fixture + def app(app): pass + + class TestClass: + # Overrides module-level `app` and requests it. + @pytest.fixture + def app(self, app): pass + + def test_something(self, request, app): + # Both dynamic and static fixture closures should include 'db'. + assert 'db' in request.fixturenames + assert 'db' in request.node.fixturenames + # No dynamic dependencies, should be equal. + assert set(request.fixturenames) == set(request.node.fixturenames) + """ + ) + result = pytester.runpytest("-v") + result.assert_outcomes(passed=1) + + +@pytest.mark.xfail(reason="not currently handled correctly") +def test_fixture_closure_with_overrides_and_intermediary(pytester: Pytester) -> None: + """Test that an item's static fixture closure properly includes transitive + dependencies through overridden fixtures (#13773). + + A more complicated case than test_fixture_closure_with_overrides, adds an + intermediary so the override chain is not direct. + """ + pytester.makeconftest( + """ + import pytest + + @pytest.fixture + def db(): pass + + @pytest.fixture + def app(db): pass + + @pytest.fixture + def intermediate(app): pass + """ + ) + pytester.makepyfile( + """ + import pytest + + # Overrides conftest-level `app` and requests it. + @pytest.fixture + def app(intermediate): pass + + class TestClass: + # Overrides module-level `app` and requests it. + @pytest.fixture + def app(self, app): pass + + def test_something(self, request, app): + # Both dynamic and static fixture closures should include 'db'. + assert 'db' in request.fixturenames + assert 'db' in request.node.fixturenames + # No dynamic dependencies, should be equal. + assert set(request.fixturenames) == set(request.node.fixturenames) + """ + ) + result = pytester.runpytest("-v") + result.assert_outcomes(passed=1) + + +def test_fixture_closure_with_broken_override_chain(pytester: Pytester) -> None: + """Test that an item's static fixture closure properly includes transitive + dependencies through overridden fixtures (#13773). + + A more complicated case than test_fixture_closure_with_overrides, one of the + fixtures in the chain doesn't call its super, so it shouldn't be included. + """ + pytester.makeconftest( + """ + import pytest + + @pytest.fixture + def db(): pass + + @pytest.fixture + def app(db): pass + """ + ) + pytester.makepyfile( + """ + import pytest + + # Overrides conftest-level `app` and *doesn't* request it. + @pytest.fixture + def app(): pass + + class TestClass: + # Overrides module-level `app` and requests it. + @pytest.fixture + def app(self, app): pass + + def test_something(self, request, app): + # Both dynamic and static fixture closures should include 'db'. + assert 'db' not in request.fixturenames + assert 'db' not in request.node.fixturenames + # No dynamic dependencies, should be equal. + assert set(request.fixturenames) == set(request.node.fixturenames) + """ + ) + result = pytester.runpytest("-v") + result.assert_outcomes(passed=1) From d241a1940ff2d9a2726d466d8a32355036bdb128 Mon Sep 17 00:00:00 2001 From: slackline <776695+slackline@users.noreply.github.com> Date: Thu, 2 Oct 2025 12:19:48 +0000 Subject: [PATCH 136/270] Docs: fix file patterns formatting (#13764) Co-authored-by: Florian Bruhin --- doc/en/getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 4089e0e5867..d349e28ac07 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -73,7 +73,7 @@ The ``[100%]`` refers to the overall progress of running all test cases. After i Run multiple tests ---------------------------------------------------------- -``pytest`` will run all files of the form test_*.py or \*_test.py in the current directory and its subdirectories. More generally, it follows :ref:`standard test discovery rules `. +``pytest`` will run all files of the form ``test_*.py`` or ``*_test.py`` in the current directory and its subdirectories. More generally, it follows :ref:`standard test discovery rules `. Assert that a certain exception is raised From 527b46d86cbe18998a7e47cb19d43eda78569398 Mon Sep 17 00:00:00 2001 From: Stu-ops Date: Thu, 2 Oct 2025 18:11:08 +0530 Subject: [PATCH 137/270] test_unittest: skip asynctest for Python 3.11+ (#13777) asynctest is not supported for Python 3.11+ because `@asyncio.coroutine` was removed in Python 3.11. Running the test suite with `tox -e py312-asynctest` gives this error: ``` class _AwaitEvent: def __init__(self, mock): self._mock = mock self._condition = None > @asyncio.coroutine ^^^^^^^^^^^^^^^^^ E AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'? ``` --- testing/test_unittest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/test_unittest.py b/testing/test_unittest.py index ece8183b5e3..d6757077847 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1322,10 +1322,12 @@ def test_async_support(pytester: Pytester) -> None: reprec.assertoutcome(failed=1, passed=2) +@pytest.mark.skipif( + sys.version_info >= (3, 11), reason="asynctest is not compatible with Python 3.11+" +) def test_asynctest_support(pytester: Pytester) -> None: """Check asynctest support (#7110)""" pytest.importorskip("asynctest") - pytester.copy_example("unittest/test_unittest_asynctest.py") reprec = pytester.inline_run() reprec.assertoutcome(failed=1, passed=2) From ebd0d3538e869e3ccf976ee32bd8a107311154ee Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 2 Oct 2025 11:02:37 +0300 Subject: [PATCH 138/270] Change PytestRemovedIn9Warning to error by default Per our backward compatibility policy. Fix #13779 --- changelog/13779.breaking.rst | 22 ++++++++++++++++++++++ src/_pytest/deprecated.py | 3 +-- src/_pytest/warning_types.py | 6 ++++++ src/_pytest/warnings.py | 3 +-- src/pytest/__init__.py | 2 ++ testing/acceptance_test.py | 6 +++--- testing/test_warnings.py | 3 ++- 7 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 changelog/13779.breaking.rst diff --git a/changelog/13779.breaking.rst b/changelog/13779.breaking.rst new file mode 100644 index 00000000000..f7e44c27dfa --- /dev/null +++ b/changelog/13779.breaking.rst @@ -0,0 +1,22 @@ +**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/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index a605c24e58f..24e6462506b 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -27,8 +27,7 @@ } -# This can be* removed pytest 8, but it's harmless and common, so no rush to remove. -# * If you're in the future: "could have been". +# This could have been removed pytest 8, but it's harmless and common, so no rush to remove. YIELD_FIXTURE = PytestDeprecationWarning( "@pytest.yield_fixture is deprecated.\n" "Use @pytest.fixture instead; they are the same." diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 5e78debb682..93071b4a1b2 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -56,6 +56,12 @@ class PytestRemovedIn9Warning(PytestDeprecationWarning): __module__ = "pytest" +class PytestRemovedIn10Warning(PytestDeprecationWarning): + """Warning class for features that will be removed in pytest 10.""" + + __module__ = "pytest" + + @final class PytestExperimentalApiWarning(PytestWarning, FutureWarning): """Warning category used to denote experiments in pytest. diff --git a/src/_pytest/warnings.py b/src/_pytest/warnings.py index 806681a5020..1dbf0025a31 100644 --- a/src/_pytest/warnings.py +++ b/src/_pytest/warnings.py @@ -41,8 +41,7 @@ def catch_warnings_for_item( warnings.filterwarnings("always", category=DeprecationWarning) warnings.filterwarnings("always", category=PendingDeprecationWarning) - # To be enabled in pytest 9.0.0. - # warnings.filterwarnings("error", category=pytest.PytestRemovedIn9Warning) + warnings.filterwarnings("error", category=pytest.PytestRemovedIn9Warning) apply_warning_filters(config_filters, cmdline_filters) diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index 297b524bcc2..31d56deede4 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -82,6 +82,7 @@ from _pytest.warning_types import PytestExperimentalApiWarning from _pytest.warning_types import PytestFDWarning from _pytest.warning_types import PytestRemovedIn9Warning +from _pytest.warning_types import PytestRemovedIn10Warning from _pytest.warning_types import PytestReturnNotNoneWarning from _pytest.warning_types import PytestUnhandledThreadExceptionWarning from _pytest.warning_types import PytestUnknownMarkWarning @@ -133,6 +134,7 @@ "PytestFDWarning", "PytestPluginManager", "PytestRemovedIn9Warning", + "PytestRemovedIn10Warning", "PytestReturnNotNoneWarning", "PytestUnhandledThreadExceptionWarning", "PytestUnknownMarkWarning", diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 544b2cd3f0f..b9384008483 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1324,7 +1324,7 @@ def test_foo(async_fixture): pass """ ) - result = pytester.runpytest() + result = pytester.runpytest("-Wdefault::pytest.PytestRemovedIn9Warning") result.stdout.fnmatch_lines( [ "*== warnings summary ==*", @@ -1354,7 +1354,7 @@ def test_foo(async_fixture): ... """ ) - result = pytester.runpytest() + result = pytester.runpytest("-Wdefault::pytest.PytestRemovedIn9Warning") result.stdout.fnmatch_lines( [ "*== warnings summary ==*", @@ -1388,7 +1388,7 @@ def test_foo(async_fixture): pass """ ) - result = pytester.runpytest() + result = pytester.runpytest("-Wdefault::pytest.PytestRemovedIn9Warning") result.stdout.fnmatch_lines( [ "*== warnings summary ==*", diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 399ca586927..467753b6a6e 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -562,7 +562,8 @@ def test_invalid_regex_in_filterwarning(self, pytester: Pytester) -> None: ) -@pytest.mark.skip("not relevant until pytest 9.0") +# In 9.1, uncomment below and change RemovedIn9 -> RemovedIn10. +# @pytest.mark.skip("not relevant until pytest 10.0") @pytest.mark.parametrize("change_default", [None, "ini", "cmdline"]) def test_removed_in_x_warning_as_error(pytester: Pytester, change_default) -> None: """This ensures that PytestRemovedInXWarnings raised by pytest are turned into errors. From 7cfe8aa2758c154c9355ca61e3de32a50ec78663 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 5 Oct 2025 03:58:23 +0000 Subject: [PATCH 139/270] [automated] Update plugin list (#13787) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 114 ++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 41 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 70fe12c92ff..ddf873634e7 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =2.7.3) :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Apr 13, 2023 N/A pytest :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest + :pypi:`pytest-allure-host` Publish Allure static reports to private S3 behind CloudFront with history preservation Sep 30, 2025 3 - Alpha N/A :pypi:`pytest-allure-id2history` Overwrite allure history id with testcase full name and testcase id if testcase has id, exclude parameters. May 14, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-allure-intersection` Oct 27, 2022 N/A pytest (<5) :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest @@ -94,7 +95,7 @@ This list contains 1719 plugins. :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-api-cov` Pytest Plugin to provide API Coverage statistics for Python Web Frameworks Sep 11, 2025 N/A pytest>=6.0.0 :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Sep 25, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Sep 28, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -161,8 +162,9 @@ This list contains 1719 plugins. :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bandit-xayon` A bandit plugin for pytest Oct 17, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Jan 31, 2024 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-bashdoctest` A pytest plugin for testing bash command examples in markdown documentation Oct 03, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-batch-regression` A pytest plugin to repeat the entire test suite in batches. May 08, 2024 N/A pytest>=6.0.0 - :pypi:`pytest-bazel` A pytest runner with bazel support May 11, 2025 4 - Beta pytest + :pypi:`pytest-bazel` A pytest runner with bazel support Oct 01, 2025 4 - Beta pytest :pypi:`pytest-bdd` BDD for pytest Dec 05, 2024 6 - Mature pytest>=7.0.0 :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Nov 22, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) :pypi:`pytest-bdd-ng` BDD for pytest Nov 26, 2024 4 - Beta pytest>=5.2 @@ -191,7 +193,7 @@ This list contains 1719 plugins. :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A - :pypi:`pytest-b-logger` BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. Sep 16, 2025 N/A pytest + :pypi:`pytest-b-logger` BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. Oct 02, 2025 N/A pytest :pypi:`pytest-blue` A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. Sep 05, 2022 N/A N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A :pypi:`pytest-boardfarm3` Integrate boardfarm as a pytest plugin. Sep 15, 2025 N/A pytest @@ -256,7 +258,7 @@ This list contains 1719 plugins. :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest<9,>=7.0 :pypi:`pytest-checklist` Pytest plugin to track and report unit/function coverage. May 23, 2025 N/A N/A :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest - :pypi:`pytest-checkpoint` Restore a checkpoint in pytest Mar 30, 2025 N/A pytest>=8.0.0 + :pypi:`pytest-checkpoint` Restore a checkpoint in pytest Oct 04, 2025 N/A pytest>=8.0.0 :pypi:`pytest-ch-framework` My pytest framework Apr 17, 2024 N/A pytest==8.0.1 :pypi:`pytest-chic-report` Simple pytest plugin for generating and sending report to messengers. Nov 01, 2024 N/A pytest>=6.0 :pypi:`pytest-chinesereport` Apr 16, 2025 4 - Beta pytest>=3.5.0 @@ -317,7 +319,7 @@ This list contains 1719 plugins. :pypi:`pytest-contexts` A plugin to run tests written with the Contexts framework using pytest May 19, 2021 4 - Beta N/A :pypi:`pytest-continuous` A pytest plugin to run tests continuously until failure or interruption. Apr 23, 2024 N/A N/A :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 Mar 22, 2023 5 - Production/Stable pytest (>=3.9.0) - :pypi:`pytest-copie` The pytest plugin for your copier templates 📒 Apr 09, 2025 3 - Alpha pytest + :pypi:`pytest-copie` The pytest plugin for your copier templates 📒 Sep 29, 2025 3 - Alpha pytest :pypi:`pytest-copier` A pytest plugin to help testing Copier templates Dec 11, 2023 4 - Beta pytest>=7.3.2 :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A @@ -419,7 +421,7 @@ This list contains 1719 plugins. :pypi:`pytest-ditto-pyarrow` pytest-ditto plugin for pyarrow tables. Jun 09, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-django` A Django plugin for pytest. Apr 03, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Sep 27, 2025 5 - Production/Stable pytest + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Sep 28, 2025 5 - Production/Stable pytest :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A :pypi:`pytest-django-class` A pytest plugin for running django in class-scoped fixtures Aug 08, 2023 4 - Beta N/A @@ -676,7 +678,7 @@ This list contains 1719 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Sep 26, 2025 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Sep 30, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A @@ -726,7 +728,7 @@ This list contains 1719 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 27, 2025 3 - Alpha pytest==8.4.2 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 04, 2025 3 - Alpha pytest==8.4.2 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -864,7 +866,7 @@ This list contains 1719 plugins. :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :pypi:`pytest-kubernetes` Feb 04, 2025 N/A pytest<9.0.0,>=8.3.0 - :pypi:`pytest_kustomize` Parse and validate kustomize output Jul 09, 2025 N/A N/A + :pypi:`pytest_kustomize` Parse and validate kustomize output Oct 02, 2025 N/A N/A :pypi:`pytest-kuunda` pytest plugin to help with test data setup for PySpark tests Feb 25, 2024 4 - Beta pytest >=6.2.0 :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 27, 2024 5 - Production/Stable pytest<9,>=3.6 @@ -895,6 +897,7 @@ This list contains 1719 plugins. :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-litter` Pytest plugin which verifies that tests do not modify file trees. Nov 23, 2023 4 - Beta pytest >=6.1 :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest + :pypi:`pytest-llm` pytest-llm: A pytest plugin for testing LLM outputs with success rate thresholds. Oct 03, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-llmeval` A pytest plugin to evaluate/benchmark LLM prompts Mar 19, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-lobster` Pytest to generate lobster tracing files Jul 26, 2025 N/A pytest>=7.0 :pypi:`pytest-local-badge` Generate local badges (shields) reporting your test suite status. Jan 15, 2023 N/A pytest (>=6.1.0) @@ -953,7 +956,7 @@ This list contains 1719 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Aug 18, 2025 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Sep 24, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Oct 03, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -1035,7 +1038,7 @@ This list contains 1719 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Sep 18, 2025 N/A pytest<9.0.0,>=8.2.0 + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Oct 03, 2025 N/A pytest<9.0.0,>=8.2.0 :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest_nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Aug 05, 2024 N/A N/A @@ -1054,12 +1057,13 @@ This list contains 1719 plugins. :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Feb 26, 2024 5 - Production/Stable N/A :pypi:`pytest-oar` PyTest plugin for the OAR testing framework May 12, 2025 N/A pytest>=6.0.1 - :pypi:`pytest-oarepo` Jul 02, 2025 N/A pytest>=7.1.2; extra == "base" + :pypi:`pytest-oarepo` Oct 02, 2025 N/A pytest>=7.1.2; extra == "base" :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odc` A pytest plugin for simplifying ODC database tests Aug 04, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-odoo` py.test plugin to run Odoo tests May 20, 2025 5 - Production/Stable pytest>=8 :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A + :pypi:`pytest-oduit` py.test plugin to run Odoo tests Oct 02, 2025 5 - Production/Stable pytest>=8 :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A :pypi:`pytest-offline` Mar 09, 2023 1 - Planning pytest (>=7.0.0,<8.0.0) :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 May 16, 2023 N/A N/A @@ -1147,7 +1151,7 @@ This list contains 1719 plugins. :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Jul 02, 2025 N/A N/A - :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Sep 16, 2025 3 - Alpha pytest + :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Oct 01, 2025 3 - Alpha pytest :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) @@ -1210,7 +1214,7 @@ This list contains 1719 plugins. :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Oct 24, 2024 5 - Production/Stable pytest + :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Sep 30, 2025 5 - Production/Stable pytest :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test Oct 17, 2024 5 - Production/Stable pytest :pypi:`pytest-pyreport` PyReport is a lightweight reporting plugin for Pytest that provides concise HTML report May 05, 2024 N/A pytest :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Jan 26, 2024 4 - Beta pytest >=7.0.0 @@ -1220,14 +1224,14 @@ This list contains 1719 plugins. :pypi:`pytest-pytestdb` Add your description here Sep 14, 2025 N/A N/A :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pytestrail-internal` Pytest plugin for interaction with TestRail, Pytest plugin for TestRail (internal fork from: https://github.com/tolstislon/pytest-pytestrail with PR #25 fix) Jun 12, 2025 4 - Beta pytest>=3.8.0 - :pypi:`pytest-pythonhashseed` Pytest plugin to set PYTHONHASHSEED env var. Feb 25, 2024 4 - Beta pytest>=3.0.0 + :pypi:`pytest-pythonhashseed` Pytest plugin to set PYTHONHASHSEED env var. Sep 28, 2025 4 - Beta pytest>=3.0.0 :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-python-test-engineer-sort` Sort plugin for Pytest May 13, 2024 N/A pytest>=6.2.0 :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-pyvenv` A package for create venv in tests Feb 27, 2024 N/A pytest ; extra == 'test' :pypi:`pytest-pyvista` Pytest-pyvista package. Jul 07, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-qanova` A pytest plugin to collect test information Sep 05, 2024 3 - Alpha pytest - :pypi:`pytest-qaseio` Pytest plugin for Qase.io integration Jul 25, 2025 5 - Production/Stable pytest<9.0.0,>=7.2.2 + :pypi:`pytest-qaseio` Pytest plugin for Qase.io integration Oct 01, 2025 5 - Production/Stable pytest<9.0.0,>=7.2.2 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Feb 14, 2023 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 14, 2024 5 - Production/Stable pytest>=6.0 @@ -1283,7 +1287,7 @@ This list contains 1719 plugins. :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance May 05, 2025 3 - Alpha pytest :pypi:`pytest-report` Creates json report that is compatible with atom.io's linter message format May 11, 2016 4 - Beta N/A :pypi:`pytest-reporter` Generate Pytest reports with templates Feb 28, 2024 4 - Beta pytest - :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest May 06, 2025 4 - Beta N/A + :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Oct 02, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jul 16, 2025 N/A N/A :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Aug 08, 2025 N/A pytest>=8.4.0 @@ -1322,7 +1326,7 @@ This list contains 1719 plugins. :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Sep 09, 2025 5 - Production/Stable pytest :pypi:`pytest-result-log` A pytest plugin that records the start, end, and result information of each use case in a log file Jan 10, 2024 N/A pytest>=7.2.0 :pypi:`pytest-result-notify` Default template for PDM package Apr 27, 2025 N/A pytest>=8.3.5 - :pypi:`pytest-results` Easily spot regressions in your tests. Sep 10, 2025 4 - Beta pytest + :pypi:`pytest-results` Easily spot regressions in your tests. Sep 30, 2025 4 - Beta pytest :pypi:`pytest-result-sender` Apr 20, 2023 N/A pytest>=7.3.1 :pypi:`pytest-result-sender-jms` Default template for PDM package May 22, 2025 N/A pytest>=8.3.5 :pypi:`pytest-result-sender-lj` Default template for PDM package Dec 17, 2024 N/A pytest>=8.3.4 @@ -1371,7 +1375,7 @@ This list contains 1719 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Oct 03, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. Sep 03, 2025 5 - Production/Stable pytest<9,>=7.4 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1383,7 +1387,7 @@ This list contains 1719 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 03, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -2017,6 +2021,13 @@ This list contains 1719 plugins. pytest plugin to test case doc string dls instructions + :pypi:`pytest-allure-host` + *last release*: Sep 30, 2025, + *status*: 3 - Alpha, + *requires*: N/A + + Publish Allure static reports to private S3 behind CloudFront with history preservation + :pypi:`pytest-allure-id2history` *last release*: May 14, 2024, *status*: 4 - Beta, @@ -2179,7 +2190,7 @@ This list contains 1719 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Sep 25, 2025, + *last release*: Sep 28, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2647,6 +2658,13 @@ This list contains 1719 plugins. pytest plugin for URL based testing + :pypi:`pytest-bashdoctest` + *last release*: Oct 03, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0.0 + + A pytest plugin for testing bash command examples in markdown documentation + :pypi:`pytest-batch-regression` *last release*: May 08, 2024, *status*: N/A, @@ -2655,7 +2673,7 @@ This list contains 1719 plugins. A pytest plugin to repeat the entire test suite in batches. :pypi:`pytest-bazel` - *last release*: May 11, 2025, + *last release*: Oct 01, 2025, *status*: 4 - Beta, *requires*: pytest @@ -2858,7 +2876,7 @@ This list contains 1719 plugins. pytest plugin to mark a test as blocker and skip all other tests :pypi:`pytest-b-logger` - *last release*: Sep 16, 2025, + *last release*: Oct 02, 2025, *status*: N/A, *requires*: pytest @@ -3313,7 +3331,7 @@ This list contains 1719 plugins. pytest plugin to test Check_MK checks :pypi:`pytest-checkpoint` - *last release*: Mar 30, 2025, + *last release*: Oct 04, 2025, *status*: N/A, *requires*: pytest>=8.0.0 @@ -3740,7 +3758,7 @@ This list contains 1719 plugins. The pytest plugin for your Cookiecutter templates. 🍪 :pypi:`pytest-copie` - *last release*: Apr 09, 2025, + *last release*: Sep 29, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -4454,7 +4472,7 @@ This list contains 1719 plugins. A Django plugin for pytest. :pypi:`pytest-djangoapp` - *last release*: Sep 27, 2025, + *last release*: Sep 28, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -6253,7 +6271,7 @@ This list contains 1719 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Sep 26, 2025, + *last release*: Sep 30, 2025, *status*: N/A, *requires*: pytest>=3.6 @@ -6603,7 +6621,7 @@ This list contains 1719 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Sep 27, 2025, + *last release*: Oct 04, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.2 @@ -7569,7 +7587,7 @@ This list contains 1719 plugins. :pypi:`pytest_kustomize` - *last release*: Jul 09, 2025, + *last release*: Oct 02, 2025, *status*: N/A, *requires*: N/A @@ -7785,6 +7803,13 @@ This list contains 1719 plugins. Live results for pytest + :pypi:`pytest-llm` + *last release*: Oct 03, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=7.0.0 + + pytest-llm: A pytest plugin for testing LLM outputs with success rate thresholds. + :pypi:`pytest-llmeval` *last release*: Mar 19, 2025, *status*: 4 - Beta, @@ -8192,7 +8217,7 @@ This list contains 1719 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Sep 24, 2025, + *last release*: Oct 03, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8766,7 +8791,7 @@ This list contains 1719 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Sep 18, 2025, + *last release*: Oct 03, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.2.0 @@ -8899,7 +8924,7 @@ This list contains 1719 plugins. PyTest plugin for the OAR testing framework :pypi:`pytest-oarepo` - *last release*: Jul 02, 2025, + *last release*: Oct 02, 2025, *status*: N/A, *requires*: pytest>=7.1.2; extra == "base" @@ -8940,6 +8965,13 @@ This list contains 1719 plugins. Project description + :pypi:`pytest-oduit` + *last release*: Oct 02, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=8 + + py.test plugin to run Odoo tests + :pypi:`pytest-oerp` *last release*: Feb 28, 2012, *status*: 3 - Alpha, @@ -9550,7 +9582,7 @@ This list contains 1719 plugins. Easy pytest visual regression testing using playwright :pypi:`pytest-pl-grader` - *last release*: Sep 16, 2025, + *last release*: Oct 01, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -9991,7 +10023,7 @@ This list contains 1719 plugins. Pytest fixture "q" for pyq :pypi:`pytest-pyramid` - *last release*: Oct 24, 2024, + *last release*: Sep 30, 2025, *status*: 5 - Production/Stable, *requires*: pytest @@ -10061,7 +10093,7 @@ This list contains 1719 plugins. Pytest plugin for interaction with TestRail, Pytest plugin for TestRail (internal fork from: https://github.com/tolstislon/pytest-pytestrail with PR #25 fix) :pypi:`pytest-pythonhashseed` - *last release*: Feb 25, 2024, + *last release*: Sep 28, 2025, *status*: 4 - Beta, *requires*: pytest>=3.0.0 @@ -10110,7 +10142,7 @@ This list contains 1719 plugins. A pytest plugin to collect test information :pypi:`pytest-qaseio` - *last release*: Jul 25, 2025, + *last release*: Oct 01, 2025, *status*: 5 - Production/Stable, *requires*: pytest<9.0.0,>=7.2.2 @@ -10502,7 +10534,7 @@ This list contains 1719 plugins. Generate Pytest reports with templates :pypi:`pytest-reporter-html1` - *last release*: May 06, 2025, + *last release*: Oct 02, 2025, *status*: 4 - Beta, *requires*: N/A @@ -10775,7 +10807,7 @@ This list contains 1719 plugins. Default template for PDM package :pypi:`pytest-results` - *last release*: Sep 10, 2025, + *last release*: Sep 30, 2025, *status*: 4 - Beta, *requires*: pytest @@ -11118,7 +11150,7 @@ This list contains 1719 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Sep 25, 2025, + *last release*: Oct 03, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11202,7 +11234,7 @@ This list contains 1719 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Sep 25, 2025, + *last release*: Oct 03, 2025, *status*: 5 - Production/Stable, *requires*: N/A From 8606fdcd3b334780085c52dab5480c6eab53c64f Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 6 Oct 2025 10:10:51 +0300 Subject: [PATCH 140/270] testing: add some more tests for fixture closure Explicitly test a couple more scenarios. One of the tests doesn't currently pass so marked xfail. --- testing/python/fixtures.py | 107 +++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index d673eac7742..2f830275108 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -5198,3 +5198,110 @@ def test_something(self, request, app): ) result = pytester.runpytest("-v") result.assert_outcomes(passed=1) + + +def test_fixture_closure_handles_circular_dependencies(pytester: Pytester) -> None: + """Test that getfixtureclosure properly handles circular dependencies. + + The test will error in the runtest phase due to the fixture loop, + but the closure computation still completes. + """ + pytester.makepyfile( + """ + import pytest + + # Direct circular dependency. + @pytest.fixture + def fix_a(fix_b): pass + + @pytest.fixture + def fix_b(fix_a): pass + + # Indirect circular dependency through multiple fixtures. + @pytest.fixture + def fix_x(fix_y): pass + + @pytest.fixture + def fix_y(fix_z): pass + + @pytest.fixture + def fix_z(fix_x): pass + + def test_circular_deps(fix_a, fix_x): + pass + """ + ) + items, _hookrec = pytester.inline_genitems() + assert isinstance(items[0], Function) + assert items[0].fixturenames == ["fix_a", "fix_x", "fix_b", "fix_y", "fix_z"] + + +def test_fixture_closure_handles_diamond_dependencies(pytester: Pytester) -> None: + """Test that getfixtureclosure properly handles diamond dependencies.""" + pytester.makepyfile( + """ + import pytest + + @pytest.fixture + def db(): pass + + @pytest.fixture + def user(db): pass + + @pytest.fixture + def session(db): pass + + @pytest.fixture + def app(user, session): pass + + def test_diamond_deps(request, app): + assert request.node.fixturenames == ["request", "app", "user", "session", "db"] + assert request.fixturenames == ["request", "app", "user", "session", "db"] + """ + ) + result = pytester.runpytest("-v") + result.assert_outcomes(passed=1) + + +@pytest.mark.xfail(reason="not currently handled correctly") +def test_fixture_closure_with_complex_override_and_shared_deps( + pytester: Pytester, +) -> None: + """Test that shared dependencies in override chains are processed only once.""" + pytester.makeconftest( + """ + import pytest + + @pytest.fixture + def db(): pass + + @pytest.fixture + def cache(): pass + + @pytest.fixture + def settings(): pass + + @pytest.fixture + def app(db, cache, settings): pass + """ + ) + pytester.makepyfile( + """ + import pytest + + # Override app, but also directly use cache and settings. + # This creates multiple paths to the same fixtures. + @pytest.fixture + def app(app, cache, settings): pass + + class TestClass: + # Another override that uses both app and cache. + @pytest.fixture + def app(self, app, cache): pass + + def test_shared_deps(self, request, app): + assert request.node.fixturenames == ["request", "app", "db", "cache", "settings"] + """ + ) + result = pytester.runpytest("-v") + result.assert_outcomes(passed=1) From 3f831e600ad1d4cfa35a928485de4659cdbe5a26 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 6 Oct 2025 10:11:28 +0300 Subject: [PATCH 141/270] fixtures: fix closure computation with indirect override chains Continuation of 72ae3dbf9608a70df683d081cf53146a8d79f1ea. The previous fix was a minimal change to make the existing code at least consider fixtures overrides, and handles the common case (direct override chains), but still wasn't correct, as it didn't handle override chains involving an intermediary (not the overridden) fixture. To make this work, the algorithm needs to change. Now instead of a simple breadth-first search, we do a depth-first search, which more closely simulates the runtime behavior, and allows us the to check the "stack" of fixtures so we can use the correct fixture index (depth in the override chain). This is more expensive but should be OK. Refs #13773. --- src/_pytest/fixtures.py | 59 ++++++++++++++++++++++++-------------- testing/python/fixtures.py | 32 ++++++++++++++++++--- 2 files changed, 65 insertions(+), 26 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index b0ce620c13a..1f583a610f0 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1634,29 +1634,44 @@ def getfixtureclosure( fixturenames_closure = list(initialnames) arg2fixturedefs: dict[str, Sequence[FixtureDef[Any]]] = {} - lastlen = -1 - while lastlen != len(fixturenames_closure): - lastlen = len(fixturenames_closure) - for argname in fixturenames_closure: - if argname in ignore_args: - continue - if argname in arg2fixturedefs: - continue + + # Track the index for each fixture name in the simulated stack. + # Needed for handling override chains correctly, similar to _get_active_fixturedef. + # Using negative indices: -1 is the most specific (last), -2 is second to last, etc. + current_indices: dict[str, int] = {} + + def process_argname(argname: str) -> None: + # Optimization: already processed this argname. + if current_indices.get(argname) == -1: + return + + if argname not in fixturenames_closure: + fixturenames_closure.append(argname) + + if argname in ignore_args: + return + + fixturedefs = arg2fixturedefs.get(argname) + if not fixturedefs: fixturedefs = self.getfixturedefs(argname, parentnode) - if fixturedefs: - arg2fixturedefs[argname] = fixturedefs - - # Add dependencies from this fixture. - # If it overrides a fixture with the same name and requests - # it, also add dependencies from the overridden fixtures in - # the chain. See also similar dealing in _get_active_fixturedef(). - for fixturedef in reversed(fixturedefs): # pragma: no cover - for arg in fixturedef.argnames: - if arg not in fixturenames_closure: - fixturenames_closure.append(arg) - if argname not in fixturedef.argnames: - # Overrides, but doesn't request super. - break + if not fixturedefs: + # Fixture not defined or not visible (will error during runtest). + return + arg2fixturedefs[argname] = fixturedefs + + index = current_indices.get(argname, -1) + if -index > len(fixturedefs): + # Exhausted the override chain (will error during runtest). + return + fixturedef = fixturedefs[index] + + current_indices[argname] = index - 1 + for dep in fixturedef.argnames: + process_argname(dep) + current_indices[argname] = index + + for name in initialnames: + process_argname(name) def sort_by_scope(arg_name: str) -> Scope: try: diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 2f830275108..ce0e5f87050 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -5110,7 +5110,6 @@ def test_something(self, request, app): result.assert_outcomes(passed=1) -@pytest.mark.xfail(reason="not currently handled correctly") def test_fixture_closure_with_overrides_and_intermediary(pytester: Pytester) -> None: """Test that an item's static fixture closure properly includes transitive dependencies through overridden fixtures (#13773). @@ -5255,15 +5254,14 @@ def session(db): pass def app(user, session): pass def test_diamond_deps(request, app): - assert request.node.fixturenames == ["request", "app", "user", "session", "db"] - assert request.fixturenames == ["request", "app", "user", "session", "db"] + assert request.node.fixturenames == ["request", "app", "user", "db", "session"] + assert request.fixturenames == ["request", "app", "user", "db", "session"] """ ) result = pytester.runpytest("-v") result.assert_outcomes(passed=1) -@pytest.mark.xfail(reason="not currently handled correctly") def test_fixture_closure_with_complex_override_and_shared_deps( pytester: Pytester, ) -> None: @@ -5305,3 +5303,29 @@ def test_shared_deps(self, request, app): ) result = pytester.runpytest("-v") result.assert_outcomes(passed=1) + + +def test_fixture_closure_with_parametrize_ignore(pytester: Pytester) -> None: + """Test that getfixtureclosure properly handles parametrization argnames + which override a fixture.""" + pytester.makepyfile( + """ + import pytest + + @pytest.fixture + def fix1(fix2): pass + + @pytest.fixture + def fix2(fix3): pass + + @pytest.fixture + def fix3(): pass + + @pytest.mark.parametrize('fix2', ['2']) + def test_it(request, fix1): + assert request.node.fixturenames == ["request", "fix1", "fix2"] + assert request.fixturenames == ["request", "fix1", "fix2"] + """ + ) + result = pytester.runpytest("-v") + result.assert_outcomes(passed=1) From 8d6858667f05def82972efd9bf2125078c20e8ff Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 6 Oct 2025 13:34:44 +0300 Subject: [PATCH 142/270] testing: avoid cast in test_mark_expression Should do it properly, not a big difference. --- testing/test_mark_expression.py | 36 +++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/testing/test_mark_expression.py b/testing/test_mark_expression.py index 884c4b5af88..30ae84f59c7 100644 --- a/testing/test_mark_expression.py +++ b/testing/test_mark_expression.py @@ -1,8 +1,5 @@ from __future__ import annotations -from collections.abc import Callable -from typing import cast - from _pytest.mark import MarkMatcher from _pytest.mark.expression import Expression from _pytest.mark.expression import MatcherCall @@ -10,15 +7,15 @@ import pytest -def evaluate(input: str, matcher: Callable[[str], bool]) -> bool: - return Expression.compile(input).evaluate(cast(MatcherCall, matcher)) +def evaluate(input: str, matcher: MatcherCall) -> bool: + return Expression.compile(input).evaluate(matcher) def test_empty_is_false() -> None: - assert not evaluate("", lambda ident: False) - assert not evaluate("", lambda ident: True) - assert not evaluate(" ", lambda ident: False) - assert not evaluate("\t", lambda ident: False) + assert not evaluate("", lambda ident, /, **kwargs: False) + assert not evaluate("", lambda ident, /, **kwargs: True) + assert not evaluate(" ", lambda ident, /, **kwargs: False) + assert not evaluate("\t", lambda ident, /, **kwargs: False) @pytest.mark.parametrize( @@ -51,7 +48,9 @@ def test_empty_is_false() -> None: ), ) def test_basic(expr: str, expected: bool) -> None: - matcher = {"true": True, "false": False}.__getitem__ + def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: + return {"true": True, "false": False}[name] + assert evaluate(expr, matcher) is expected @@ -67,7 +66,9 @@ def test_basic(expr: str, expected: bool) -> None: ), ) def test_syntax_oddities(expr: str, expected: bool) -> None: - matcher = {"true": True, "false": False}.__getitem__ + def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: + return {"true": True, "false": False}[name] + assert evaluate(expr, matcher) is expected @@ -77,7 +78,9 @@ def test_backslash_not_treated_specially() -> None: user will never need to insert a literal newline, only \n (two chars). So mark expressions themselves do not support escaping, instead they treat backslashes as regular identifier characters.""" - matcher = {r"\nfoo\n"}.__contains__ + + def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: + return {r"\nfoo\n"}.__contains__(name) assert evaluate(r"\nfoo\n", matcher) assert not evaluate(r"foo", matcher) @@ -135,7 +138,7 @@ def test_backslash_not_treated_specially() -> None: ) def test_syntax_errors(expr: str, column: int, message: str) -> None: with pytest.raises(ParseError) as excinfo: - evaluate(expr, lambda ident: True) + evaluate(expr, lambda ident, /, **kwargs: True) assert excinfo.value.column == column assert excinfo.value.message == message @@ -172,7 +175,10 @@ def test_syntax_errors(expr: str, column: int, message: str) -> None: ), ) def test_valid_idents(ident: str) -> None: - assert evaluate(ident, {ident: True}.__getitem__) + def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: + return name == ident + + assert evaluate(ident, matcher) @pytest.mark.parametrize( @@ -199,7 +205,7 @@ def test_valid_idents(ident: str) -> None: ) def test_invalid_idents(ident: str) -> None: with pytest.raises(ParseError): - evaluate(ident, lambda ident: True) + evaluate(ident, lambda ident, /, **kwargs: True) @pytest.mark.parametrize( From 262ef8f8e1228845a72120c06887b16a44721905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Mon, 6 Oct 2025 14:32:15 +0200 Subject: [PATCH 143/270] DEP: bump minimal requirements for iniconfig (1.0.0 -> 1.0.1) and packaging (20.0.0 -> 22.0.0) --- changelog/13791.packaging.rst | 2 ++ pyproject.toml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelog/13791.packaging.rst diff --git a/changelog/13791.packaging.rst b/changelog/13791.packaging.rst new file mode 100644 index 00000000000..d16065e85a5 --- /dev/null +++ b/changelog/13791.packaging.rst @@ -0,0 +1,2 @@ +Minimum requirements on ``iniconfig`` and ``packaging`` were bumped +to ``1.0.1`` and ``22.0.0``, respectively. diff --git a/pyproject.toml b/pyproject.toml index 12c51078a8c..091676409ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,8 +48,8 @@ dynamic = [ dependencies = [ "colorama>=0.4; sys_platform=='win32'", "exceptiongroup>=1; python_version<'3.11'", - "iniconfig>=1", - "packaging>=20", + "iniconfig>=1.0.1", + "packaging>=22", "pluggy>=1.5,<2", "pygments>=2.7.2", "tomli>=1; python_version<'3.11'", From 83da3437182eb6aa180bf578935d69127deda900 Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Mon, 6 Oct 2025 15:36:17 +0200 Subject: [PATCH 144/270] Make it possible for faulthandler to terminate the pytest process on timeout (#13679) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make it possible for faulthandler to terminate the pytest process on timeout * Add myself to AUTHORS and add changelog entry. * Update the documentation * Skip flakky CI tests * Revert "Skip flakky CI tests" This reverts commit be4f0bad8425d43d7e212e1514776edab0efc571. * Pass the CI env in tox.ini and use it to conditionally skip tests on CI * Revert "Pass the CI env in tox.ini and use it to conditionally skip tests on CI" This reverts commit 000876ec177917d963e6c549728196a30b3f9f29. * Revert "Revert "Skip flakky CI tests"" This reverts commit 5066d988dbd37a7fbaf4e55463ae2ad8ce5294c4. * Apply suggestions from code review Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) * Better way to tell mypy that faulthandler_exit_on_timeout is always a bool instance * skip test only on CI * Trigger CI * Skip the new test on ubuntu-py314 * Actually skip the new test on ubuntu-py314 * Trigger CI * Trigger CI --------- Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- AUTHORS | 1 + changelog/13678.feature.rst | 3 +++ doc/en/reference/reference.rst | 22 ++++++++++++++++++++ src/_pytest/faulthandler.py | 20 +++++++++++++++--- testing/test_faulthandler.py | 37 ++++++++++++++++++++++++++++++++++ 5 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 changelog/13678.feature.rst diff --git a/AUTHORS b/AUTHORS index a5ea37307fe..0387a3154b3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -342,6 +342,7 @@ Oleg Sushchenko Oleksandr Zavertniev Olga Matoula Oliver Bestwalter +Olivier Grisel Omar Kohl Omer Hadari Ondřej Súkup diff --git a/changelog/13678.feature.rst b/changelog/13678.feature.rst new file mode 100644 index 00000000000..63c7dfa399f --- /dev/null +++ b/changelog/13678.feature.rst @@ -0,0 +1,3 @@ +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/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 443530a2006..a2d275fdcfe 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1484,6 +1484,25 @@ passed multiple times. The expected format is ``name=value``. For example:: For more information please refer to :ref:`faulthandler`. + +.. confval:: faulthandler_exit_on_timeout + + Exit the pytest process after the per-test timeout is reached by passing + `exit=True` to the :func:`faulthandler.dump_traceback_later` function. This + is particularly useful to avoid wasting CI resources for test suites that + are prone to putting the main Python interpreter into a deadlock state. + + This option is set to 'false' by default. + + .. code-block:: ini + + # content of pytest.ini + [pytest] + faulthandler_timeout=5 + faulthandler_exit_on_timeout=true + + For more information please refer to :ref:`faulthandler`. + .. confval:: filterwarnings @@ -2401,6 +2420,9 @@ All the command-line flags can be obtained by running ``pytest --help``:: faulthandler_timeout (string): Dump the traceback of all threads if a test takes more than TIMEOUT seconds to finish + faulthandler_exit_on_timeout (bool): + Exit the test process if a test takes more than + faulthandler_timeout seconds to finish addopts (args): Extra command line options minversion (string): Minimally required pytest version pythonpath (paths): Add paths to sys.path diff --git a/src/_pytest/faulthandler.py b/src/_pytest/faulthandler.py index 79efc1d1704..080cf583813 100644 --- a/src/_pytest/faulthandler.py +++ b/src/_pytest/faulthandler.py @@ -16,11 +16,18 @@ def pytest_addoption(parser: Parser) -> None: - help = ( + help_timeout = ( "Dump the traceback of all threads if a test takes " "more than TIMEOUT seconds to finish" ) - parser.addini("faulthandler_timeout", help, default=0.0) + help_exit_on_timeout = ( + "Exit the test process if a test takes more than " + "faulthandler_timeout seconds to finish" + ) + parser.addini("faulthandler_timeout", help_timeout, default=0.0) + parser.addini( + "faulthandler_exit_on_timeout", help_exit_on_timeout, type="bool", default=False + ) def pytest_configure(config: Config) -> None: @@ -72,14 +79,21 @@ def get_timeout_config_value(config: Config) -> float: return float(config.getini("faulthandler_timeout") or 0.0) +def get_exit_on_timeout_config_value(config: Config) -> bool: + exit_on_timeout = config.getini("faulthandler_exit_on_timeout") + assert isinstance(exit_on_timeout, bool) + return exit_on_timeout + + @pytest.hookimpl(wrapper=True, trylast=True) def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: timeout = get_timeout_config_value(item.config) + exit_on_timeout = get_exit_on_timeout_config_value(item.config) if timeout > 0: import faulthandler stderr = item.config.stash[fault_handler_stderr_fd_key] - faulthandler.dump_traceback_later(timeout, file=stderr) + faulthandler.dump_traceback_later(timeout, file=stderr, exit=exit_on_timeout) try: return (yield) finally: diff --git a/testing/test_faulthandler.py b/testing/test_faulthandler.py index 2362f9e1eaf..67ca221f3f2 100644 --- a/testing/test_faulthandler.py +++ b/testing/test_faulthandler.py @@ -118,6 +118,43 @@ def test_timeout(): assert result.ret == 0 +@pytest.mark.keep_ci_var +@pytest.mark.skipif( + "CI" in os.environ and sys.platform == "linux" and sys.version_info >= (3, 14), + reason="sometimes crashes on CI because of truncated outputs (#7022)", +) +@pytest.mark.parametrize("exit_on_timeout", [True, False]) +def test_timeout_and_exit(pytester: Pytester, exit_on_timeout: bool) -> None: + """Test option to force exit pytest process after a certain timeout.""" + pytester.makepyfile( + """ + import os, time + def test_long_sleep_and_raise(): + time.sleep(1 if "CI" in os.environ else 0.1) + raise AssertionError( + "This test should have been interrupted before reaching this point." + ) + """ + ) + pytester.makeini( + f""" + [pytest] + faulthandler_timeout = 0.01 + faulthandler_exit_on_timeout = {"true" if exit_on_timeout else "false"} + """ + ) + result = pytester.runpytest_subprocess() + tb_output = "most recent call first" + result.stderr.fnmatch_lines([f"*{tb_output}*"]) + if exit_on_timeout: + result.stdout.no_fnmatch_line("*1 failed*") + result.stdout.no_fnmatch_line("*AssertionError*") + else: + result.stdout.fnmatch_lines(["*1 failed*"]) + result.stdout.fnmatch_lines(["*AssertionError*"]) + assert result.ret == 1 + + @pytest.mark.parametrize("hook_name", ["pytest_enter_pdb", "pytest_exception_interact"]) def test_cancel_timeout_on_hook(monkeypatch, hook_name) -> None: """Make sure that we are cancelling any scheduled traceback dumping due From b1e100dc4e6bc7f7b9cad115a85906184d897612 Mon Sep 17 00:00:00 2001 From: Tanuj Rai Date: Mon, 6 Oct 2025 22:29:27 +0530 Subject: [PATCH 145/270] Docs: mention pytest.approx in assert and getting-started documentation (#13788) Fixes #13662 --- doc/en/getting-started.rst | 20 ++++++++++++++++++++ doc/en/how-to/assert.rst | 27 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index d349e28ac07..24501f53a69 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -199,6 +199,26 @@ This is outlined below: Note that attributes added at class level are *class attributes*, so they will be shared between tests. +Compare floating-point values with pytest.approx +-------------------------------------------------------------- + +``pytest`` also provides a number of utilities to make writing tests easier. +For example, you can use :func:`pytest.approx` to compare floating-point +values that may have small rounding errors: + +.. code-block:: python + + # content of test_approx.py + import pytest + + + def test_sum(): + assert (0.1 + 0.2) == pytest.approx(0.3) + +This avoids the need for manual tolerance checks or using +``math.isclose`` and works with scalars, lists, and NumPy arrays. + + Request a unique temporary directory for functional tests -------------------------------------------------------------- diff --git a/doc/en/how-to/assert.rst b/doc/en/how-to/assert.rst index 8e368c35f7a..4dfceda0fad 100644 --- a/doc/en/how-to/assert.rst +++ b/doc/en/how-to/assert.rst @@ -66,6 +66,33 @@ See :ref:`assert-details` for more information on assertion introspection. .. _`assertraises`: +Assertions about approximate equality +------------------------------------- + +When comparing floating point values (or arrays of floats), small rounding +errors are common. Instead of using ``assert abs(a - b) < tol`` or +``numpy.isclose``, you can use :func:`pytest.approx`: + +.. code-block:: python + + import pytest + import numpy as np + + + def test_floats(): + assert (0.1 + 0.2) == pytest.approx(0.3) + + + def test_arrays(): + a = np.array([1.0, 2.0, 3.0]) + b = np.array([0.9999, 2.0001, 3.0]) + assert a == pytest.approx(b) + +``pytest.approx`` works with scalars, lists, dictionaries, and NumPy arrays. +It also supports comparisons involving NaNs. + +See :func:`pytest.approx` for details. + Assertions about expected exceptions ------------------------------------------ From dad0be9135b0846607c8dd7210a70c9c045fc3f1 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Oct 2025 00:32:05 +0300 Subject: [PATCH 146/270] testing: fix warning from test I'm not sure what's going on but the tested warning from the test somehow leaks into the actual top pytest. Run the test in a subprocess to fix this. --- testing/test_warnings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 467753b6a6e..4800a916eac 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -440,7 +440,7 @@ def test(): pass """ ) - result = pytester.runpytest("-W", "ignore::bizbaz.Bizbaz") + result = pytester.runpytest_subprocess("-W", "ignore::bizbaz.Bizbaz") result.stdout.fnmatch_lines( [ f"*== {WARNINGS_SUMMARY_HEADER} ==*", From 64d7e2ce0864b68e353e48c25aaa80c7fdab470a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 6 Oct 2025 13:36:12 +0300 Subject: [PATCH 147/270] mark/expression: documentation/naming tweaks Make the module a little nicer ahead of possibly exposing it publicly. --- src/_pytest/mark/expression.py | 63 +++++++++++++++++++++++++-------- testing/test_mark_expression.py | 5 +-- 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/src/_pytest/mark/expression.py b/src/_pytest/mark/expression.py index 743a46bcc17..4581ce204ed 100644 --- a/src/_pytest/mark/expression.py +++ b/src/_pytest/mark/expression.py @@ -16,8 +16,8 @@ - Empty expression evaluates to False. - ident evaluates to True or False according to a provided matcher function. -- or/and/not evaluate according to the usual boolean semantics. - ident with parentheses and keyword arguments evaluates to True or False according to a provided matcher function. +- or/and/not evaluate according to the usual boolean semantics. """ from __future__ import annotations @@ -31,6 +31,8 @@ import keyword import re import types +from typing import Final +from typing import final from typing import Literal from typing import NoReturn from typing import overload @@ -65,7 +67,7 @@ class Token: class ParseError(Exception): - """The expression contains invalid syntax. + """The :class:`Expression` contains invalid syntax. :param column: The column in the line where the error occurred (1-based). :param message: A description of the error. @@ -261,13 +263,36 @@ def all_kwargs(s: Scanner) -> list[ast.keyword]: return ret -class MatcherCall(Protocol): +class ExpressionMatcher(Protocol): + """A callable which, given an identifier and optional kwargs, should return + whether it matches in an :class:`Expression` evaluation. + + Should be prepared to handle arbitrary strings as input. + + If no kwargs are provided, the expression of the form `foo`. + If kwargs are provided, the expression is of the form `foo(1, b=True, "s")`. + + If the expression is not supported (e.g. don't want to accept the kwargs + syntax variant), should raise :class:`~pytest.UsageError`. + + Example:: + + def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: + # Match `cat`. + if name == "cat" and not kwargs: + return True + # Match `dog(barks=True)`. + if name == "dog" and kwargs == {"barks": False}: + return True + return False + """ + def __call__(self, name: str, /, **kwargs: str | int | bool | None) -> bool: ... @dataclasses.dataclass class MatcherNameAdapter: - matcher: MatcherCall + matcher: ExpressionMatcher name: str def __bool__(self) -> bool: @@ -280,7 +305,7 @@ def __call__(self, **kwargs: str | int | bool | None) -> bool: class MatcherAdapter(Mapping[str, MatcherNameAdapter]): """Adapts a matcher function to a locals mapping as required by eval().""" - def __init__(self, matcher: MatcherCall) -> None: + def __init__(self, matcher: ExpressionMatcher) -> None: self.matcher = matcher def __getitem__(self, key: str) -> MatcherNameAdapter: @@ -293,39 +318,47 @@ def __len__(self) -> int: raise NotImplementedError() +@final class Expression: """A compiled match expression as used by -k and -m. The expression can be evaluated against different matchers. """ - __slots__ = ("code",) + __slots__ = ("_code", "input") - def __init__(self, code: types.CodeType) -> None: - self.code = code + def __init__(self, input: str, code: types.CodeType) -> None: + #: The original input line, as a string. + self.input: Final = input + self._code: Final = code @classmethod def compile(cls, input: str) -> Expression: """Compile a match expression. :param input: The input expression - one line. + + :raises ParseError: If the expression is malformed. """ astexpr = expression(Scanner(input)) - code: types.CodeType = compile( + code = compile( astexpr, filename="", mode="eval", ) - return Expression(code) + return Expression(input, code) - def evaluate(self, matcher: MatcherCall) -> bool: + def evaluate(self, matcher: ExpressionMatcher) -> bool: """Evaluate the match expression. :param matcher: - Given an identifier, should return whether it matches or not. - Should be prepared to handle arbitrary strings as input. + A callback which determines whether an identifier matches or not. + See the :class:`ExpressionMatcher` protocol for details and example. :returns: Whether the expression matches or not. + + :raises UsageError: + If the matcher doesn't support the expression. Cannot happen if the + matcher supports all expressions. """ - ret: bool = bool(eval(self.code, {"__builtins__": {}}, MatcherAdapter(matcher))) - return ret + return bool(eval(self._code, {"__builtins__": {}}, MatcherAdapter(matcher))) diff --git a/testing/test_mark_expression.py b/testing/test_mark_expression.py index 30ae84f59c7..821417b6a81 100644 --- a/testing/test_mark_expression.py +++ b/testing/test_mark_expression.py @@ -2,12 +2,12 @@ from _pytest.mark import MarkMatcher from _pytest.mark.expression import Expression -from _pytest.mark.expression import MatcherCall +from _pytest.mark.expression import ExpressionMatcher from _pytest.mark.expression import ParseError import pytest -def evaluate(input: str, matcher: MatcherCall) -> bool: +def evaluate(input: str, matcher: ExpressionMatcher) -> bool: return Expression.compile(input).evaluate(matcher) @@ -211,6 +211,7 @@ def test_invalid_idents(ident: str) -> None: @pytest.mark.parametrize( "expr, expected_error_msg", ( + ("mark()", "expected identifier; got right parenthesis"), ("mark(True=False)", "unexpected reserved python keyword `True`"), ("mark(def=False)", "unexpected reserved python keyword `def`"), ("mark(class=False)", "unexpected reserved python keyword `class`"), From d77cbfac04a99cca1520a0d3e77d4dd71cb274e4 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 6 Oct 2025 14:03:40 +0300 Subject: [PATCH 148/270] mark/expression: use SyntaxError instead of custom ParseError If we are going to expose Expression, better to use a general exception, this way we can avoid exposing an extra type. --- src/_pytest/mark/__init__.py | 7 +++-- src/_pytest/mark/expression.py | 53 +++++++++++++-------------------- testing/test_mark_expression.py | 13 ++++---- 3 files changed, 31 insertions(+), 42 deletions(-) diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index cd59069559e..841d7811fdd 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -10,7 +10,6 @@ from typing import TYPE_CHECKING from .expression import Expression -from .expression import ParseError from .structures import _HiddenParam from .structures import EMPTY_PARAMETERSET_OPTION from .structures import get_empty_parameterset_mark @@ -274,8 +273,10 @@ def deselect_by_mark(items: list[Item], config: Config) -> None: def _parse_expression(expr: str, exc_message: str) -> Expression: try: return Expression.compile(expr) - except ParseError as e: - raise UsageError(f"{exc_message}: {expr}: {e}") from None + except SyntaxError as e: + raise UsageError( + f"{exc_message}: {e.text}: at column {e.offset}: {e.msg}" + ) from None def pytest_collection_modifyitems(items: list[Item], config: Config) -> None: diff --git a/src/_pytest/mark/expression.py b/src/_pytest/mark/expression.py index 4581ce204ed..3bdbd03c2b5 100644 --- a/src/_pytest/mark/expression.py +++ b/src/_pytest/mark/expression.py @@ -41,10 +41,13 @@ __all__ = [ "Expression", - "ParseError", + "ExpressionMatcher", ] +FILE_NAME: Final = "" + + class TokenType(enum.Enum): LPAREN = "left parenthesis" RPAREN = "right parenthesis" @@ -66,25 +69,11 @@ class Token: pos: int -class ParseError(Exception): - """The :class:`Expression` contains invalid syntax. - - :param column: The column in the line where the error occurred (1-based). - :param message: A description of the error. - """ - - def __init__(self, column: int, message: str) -> None: - self.column = column - self.message = message - - def __str__(self) -> str: - return f"at column {self.column}: {self.message}" - - class Scanner: - __slots__ = ("current", "tokens") + __slots__ = ("current", "input", "tokens") def __init__(self, input: str) -> None: + self.input = input self.tokens = self.lex(input) self.current = next(self.tokens) @@ -108,15 +97,15 @@ def lex(self, input: str) -> Iterator[Token]: elif (quote_char := input[pos]) in ("'", '"'): end_quote_pos = input.find(quote_char, pos + 1) if end_quote_pos == -1: - raise ParseError( - pos + 1, + raise SyntaxError( f'closing quote "{quote_char}" is missing', + (FILE_NAME, 1, pos + 1, input), ) value = input[pos : end_quote_pos + 1] if (backslash_pos := input.find("\\")) != -1: - raise ParseError( - backslash_pos + 1, + raise SyntaxError( r'escaping with "\" not supported in marker expression', + (FILE_NAME, 1, backslash_pos + 1, input), ) yield Token(TokenType.STRING, value, pos) pos += len(value) @@ -134,9 +123,9 @@ def lex(self, input: str) -> Iterator[Token]: yield Token(TokenType.IDENT, value, pos) pos += len(value) else: - raise ParseError( - pos + 1, + raise SyntaxError( f'unexpected character "{input[pos]}"', + (FILE_NAME, 1, pos + 1, input), ) yield Token(TokenType.EOF, "", pos) @@ -159,12 +148,12 @@ def accept(self, type: TokenType, *, reject: bool = False) -> Token | None: return None def reject(self, expected: Sequence[TokenType]) -> NoReturn: - raise ParseError( - self.current.pos + 1, + raise SyntaxError( "expected {}; got {}".format( " OR ".join(type.value for type in expected), self.current.type.value, ), + (FILE_NAME, 1, self.current.pos + 1, self.input), ) @@ -225,14 +214,14 @@ def not_expr(s: Scanner) -> ast.expr: def single_kwarg(s: Scanner) -> ast.keyword: keyword_name = s.accept(TokenType.IDENT, reject=True) if not keyword_name.value.isidentifier(): - raise ParseError( - keyword_name.pos + 1, + raise SyntaxError( f"not a valid python identifier {keyword_name.value}", + (FILE_NAME, 1, keyword_name.pos + 1, s.input), ) if keyword.iskeyword(keyword_name.value): - raise ParseError( - keyword_name.pos + 1, + raise SyntaxError( f"unexpected reserved python keyword `{keyword_name.value}`", + (FILE_NAME, 1, keyword_name.pos + 1, s.input), ) s.accept(TokenType.EQUAL, reject=True) @@ -247,9 +236,9 @@ def single_kwarg(s: Scanner) -> ast.keyword: elif value_token.value in BUILTIN_MATCHERS: value = BUILTIN_MATCHERS[value_token.value] else: - raise ParseError( - value_token.pos + 1, + raise SyntaxError( f'unexpected character/s "{value_token.value}"', + (FILE_NAME, 1, value_token.pos + 1, s.input), ) ret = ast.keyword(keyword_name.value, ast.Constant(value)) @@ -338,7 +327,7 @@ def compile(cls, input: str) -> Expression: :param input: The input expression - one line. - :raises ParseError: If the expression is malformed. + :raises SyntaxError: If the expression is malformed. """ astexpr = expression(Scanner(input)) code = compile( diff --git a/testing/test_mark_expression.py b/testing/test_mark_expression.py index 821417b6a81..1b93130349b 100644 --- a/testing/test_mark_expression.py +++ b/testing/test_mark_expression.py @@ -3,7 +3,6 @@ from _pytest.mark import MarkMatcher from _pytest.mark.expression import Expression from _pytest.mark.expression import ExpressionMatcher -from _pytest.mark.expression import ParseError import pytest @@ -84,7 +83,7 @@ def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: assert evaluate(r"\nfoo\n", matcher) assert not evaluate(r"foo", matcher) - with pytest.raises(ParseError): + with pytest.raises(SyntaxError): evaluate("\nfoo\n", matcher) @@ -137,10 +136,10 @@ def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: ), ) def test_syntax_errors(expr: str, column: int, message: str) -> None: - with pytest.raises(ParseError) as excinfo: + with pytest.raises(SyntaxError) as excinfo: evaluate(expr, lambda ident, /, **kwargs: True) - assert excinfo.value.column == column - assert excinfo.value.message == message + assert excinfo.value.offset == column + assert excinfo.value.msg == message @pytest.mark.parametrize( @@ -204,7 +203,7 @@ def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: ), ) def test_invalid_idents(ident: str) -> None: - with pytest.raises(ParseError): + with pytest.raises(SyntaxError): evaluate(ident, lambda ident, /, **kwargs: True) @@ -241,7 +240,7 @@ def test_invalid_idents(ident: str) -> None: def test_invalid_kwarg_name_or_value( expr: str, expected_error_msg: str, mark_matcher: MarkMatcher ) -> None: - with pytest.raises(ParseError, match=expected_error_msg): + with pytest.raises(SyntaxError, match=expected_error_msg): assert evaluate(expr, mark_matcher) From 6a1685baa93019c3a35d72bec3fab1b21617a8ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:52:59 +0000 Subject: [PATCH 149/270] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 5.2.1 to 5.2.7. - [Commits](https://github.com/django/django/compare/5.2.1...5.2.7) --- updated-dependencies: - dependency-name: django dependency-version: 5.2.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index a207d325e27..1f958931379 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[trio]==4.11.0 -django==5.2.1 +django==5.2.7 pytest-asyncio==1.2.0 pytest-bdd==8.1.0 pytest-cov==7.0.0 From 77a45fe392ade0d1b52dabca8702997ccba4d5f4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 06:03:49 +0000 Subject: [PATCH 150/270] [pre-commit.ci] pre-commit autoupdate (#13795) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.13.2 → v0.13.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.13.2...v0.13.3) - [github.com/RobertCraigie/pyright-python: v1.1.405 → v1.1.406](https://github.com/RobertCraigie/pyright-python/compare/v1.1.405...v1.1.406) - [github.com/tox-dev/pyproject-fmt: v2.6.0 → v2.7.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.6.0...v2.7.0) Co-authored-by: Pierre Sassoulas --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5aaa9f84386..d2aa0069f62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.13.2" + rev: "v0.13.3" hooks: - id: ruff-check args: ["--fix"] @@ -48,7 +48,7 @@ repos: # on <3.11 - exceptiongroup>=1.0.0rc8 - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.405 + rev: v1.1.406 hooks: - id: pyright files: ^(src/|scripts/) @@ -66,7 +66,7 @@ repos: # Manual because passing pyright is a work in progress. stages: [manual] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.6.0" + rev: "v2.7.0" hooks: - id: pyproject-fmt # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version From df4af6a62b14f3b713cc10a6e1f4069136fc9f2a Mon Sep 17 00:00:00 2001 From: Reilly Brogan Date: Thu, 25 Apr 2024 14:48:23 -0500 Subject: [PATCH 151/270] testing: fix a failing test when `TERM=dumb` Dumb terminals are incapable of handling color, so this test would fail when ran in such an environment. --- AUTHORS | 1 + changelog/12244.contrib.rst | 1 + testing/io/test_terminalwriter.py | 1 + 3 files changed, 3 insertions(+) create mode 100644 changelog/12244.contrib.rst diff --git a/AUTHORS b/AUTHORS index 0387a3154b3..9cd26e10fb9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -383,6 +383,7 @@ Reza Mousavi Raquel Alegre Ravi Chandra Reagan Lee +Reilly Brogan Rob Arrow Robert Holt Roberto Aldera diff --git a/changelog/12244.contrib.rst b/changelog/12244.contrib.rst new file mode 100644 index 00000000000..e39dad1cfbf --- /dev/null +++ b/changelog/12244.contrib.rst @@ -0,0 +1 @@ +Fixed self-test failures when `TERM=dumb`. diff --git a/testing/io/test_terminalwriter.py b/testing/io/test_terminalwriter.py index 1f38d6f15d9..9aa89da0e41 100644 --- a/testing/io/test_terminalwriter.py +++ b/testing/io/test_terminalwriter.py @@ -224,6 +224,7 @@ def test_NO_COLOR_and_FORCE_COLOR( def test_empty_NO_COLOR_and_FORCE_COLOR_ignored(monkeypatch: MonkeyPatch) -> None: + monkeypatch.setenv("TERM", "xterm-256color") monkeypatch.setitem(os.environ, "NO_COLOR", "") monkeypatch.setitem(os.environ, "FORCE_COLOR", "") assert_color(True, True) From f48ded362adcb01c8394b265adc5d82cf9a174da Mon Sep 17 00:00:00 2001 From: Mulat Mekonen Date: Tue, 7 Oct 2025 00:26:31 +0300 Subject: [PATCH 152/270] Skip symlink sibling test on Windows without symlink support #13771 --- AUTHORS | 1 + changelog/13771.contrib.rst | 1 + testing/test_collection.py | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/13771.contrib.rst diff --git a/AUTHORS b/AUTHORS index 0387a3154b3..4f5cf6ed8dd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -320,6 +320,7 @@ Mike Hoyle (hoylemd) Mike Lundy Milan Lesnek Miro Hrončok +Mulat Mekonen mrbean-bremen Nathan Goldbaum Nathan Rousseau diff --git a/changelog/13771.contrib.rst b/changelog/13771.contrib.rst new file mode 100644 index 00000000000..fa5cc8afee5 --- /dev/null +++ b/changelog/13771.contrib.rst @@ -0,0 +1 @@ +Skip `test_do_not_collect_symlink_siblings` on Windows environments without symlink support to avoid false negatives. diff --git a/testing/test_collection.py b/testing/test_collection.py index aeed1ee6b61..40568a9bdf4 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1871,7 +1871,8 @@ def test_do_not_collect_symlink_siblings( """ # Use tmp_path because it creates a symlink with the name "current" next to the directory it creates. symlink_path = tmp_path.parent / (tmp_path.name[:-1] + "current") - assert symlink_path.is_symlink() is True + if not symlink_path.is_symlink(): # pragma: no cover + pytest.skip("Symlinks not supported in this environment") # Create test file. tmp_path.joinpath("test_foo.py").write_text("def test(): pass", encoding="UTF-8") From 18c0f75cb1e90647125bd47bece689cf5fb3eb4b Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Oct 2025 22:34:15 +0300 Subject: [PATCH 153/270] testing: add a test demonstrating why `prune_dependency_tree` is needed Currently the `prune_dependency_tree` method is not semantically covered; if the call to it is commented out, all tests still pass. Add a test that would fail, to prevent regressions and show why it's (annoyingly) needed. --- testing/python/fixtures.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index d673eac7742..10941c3f9e3 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -5071,6 +5071,42 @@ def test_method(self, /, fix): result.assert_outcomes(passed=1) +def test_parametrization_dependency_pruning(pytester: Pytester) -> None: + """Test that when a fixture is dynamically shadowed by parameterization, it + is properly pruned and not executed.""" + pytester.makepyfile( + """ + import pytest + + + # This fixture should never run because shadowed_fixture is parametrized. + @pytest.fixture + def boom(): + raise RuntimeError("BOOM!") + + + # This fixture is shadowed by metafunc.parametrize in pytest_generate_tests. + @pytest.fixture + def shadowed_fixture(boom): + return "fixture_value" + + + # Dynamically parametrize shadowed_fixture, replacing the fixture with direct values. + def pytest_generate_tests(metafunc): + if "shadowed_fixture" in metafunc.fixturenames: + metafunc.parametrize("shadowed_fixture", ["param1", "param2"]) + + + # This test should receive shadowed_fixture as a parametrized value, and + # boom should not explode. + def test_shadowed(shadowed_fixture): + assert shadowed_fixture in ["param1", "param2"] + """ + ) + result = pytester.runpytest() + result.assert_outcomes(passed=2) + + def test_fixture_closure_with_overrides(pytester: Pytester) -> None: """Test that an item's static fixture closure properly includes transitive dependencies through overridden fixtures (#13773).""" From 631dd86ea08fe5d3330f530074331b6f81354c9c Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 9 Oct 2025 00:10:00 +0300 Subject: [PATCH 154/270] fixtures: make the FixtureValue TypeVar covariant This TypeVar represents the return value of the fixture function, so should be covariant. --- src/_pytest/fixtures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index b0ce620c13a..205b71c9200 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -82,7 +82,7 @@ # The value of the fixture -- return/yield of the fixture function (type variable). -FixtureValue = TypeVar("FixtureValue") +FixtureValue = TypeVar("FixtureValue", covariant=True) # The type of the fixture function (type variable). FixtureFunction = TypeVar("FixtureFunction", bound=Callable[..., object]) # The type of a fixture function (type alias generic in fixture value). From 6d17c8508a5b0218816868682a432ad5acfea192 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 9 Oct 2025 00:03:35 +0300 Subject: [PATCH 155/270] fixtures: replace PseudoFixtureDef with RequestFixtureDef which is a real FixtureDef Remove some special cases from the code, and make the types more regular. --- src/_pytest/fixtures.py | 47 +++++++++++++++++++++++--------------- testing/python/fixtures.py | 4 ++-- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 205b71c9200..2f56eb6b932 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -106,12 +106,6 @@ ) -@dataclasses.dataclass(frozen=True) -class PseudoFixtureDef(Generic[FixtureValue]): - cached_result: _FixtureCachedResult[FixtureValue] - _scope: Scope - - def pytest_sessionstart(session: Session) -> None: session._fixturemanager = FixtureManager(session) @@ -420,7 +414,7 @@ def scope(self) -> _ScopeName: @abc.abstractmethod def _check_scope( self, - requested_fixturedef: FixtureDef[object] | PseudoFixtureDef[object], + requested_fixturedef: FixtureDef[object], requested_scope: Scope, ) -> None: raise NotImplementedError() @@ -559,12 +553,9 @@ def _iter_chain(self) -> Iterator[SubRequest]: yield current current = current._parent_request - def _get_active_fixturedef( - self, argname: str - ) -> FixtureDef[object] | PseudoFixtureDef[object]: + def _get_active_fixturedef(self, argname: str) -> FixtureDef[object]: if argname == "request": - cached_result = (self, [0], None) - return PseudoFixtureDef(cached_result, Scope.Function) + return RequestFixtureDef(self) # If we already finished computing a fixture by this name in this item, # return it. @@ -696,7 +687,7 @@ def _scope(self) -> Scope: def _check_scope( self, - requested_fixturedef: FixtureDef[object] | PseudoFixtureDef[object], + requested_fixturedef: FixtureDef[object], requested_scope: Scope, ) -> None: # TopRequest always has function scope so always valid. @@ -775,11 +766,9 @@ def node(self): def _check_scope( self, - requested_fixturedef: FixtureDef[object] | PseudoFixtureDef[object], + requested_fixturedef: FixtureDef[object], requested_scope: Scope, ) -> None: - if isinstance(requested_fixturedef, PseudoFixtureDef): - return if self._scope > requested_scope: # Try to report something helpful. argname = requested_fixturedef.argname @@ -968,7 +957,6 @@ def _eval_scope_callable( return result -@final class FixtureDef(Generic[FixtureValue]): """A container for a fixture definition. @@ -1083,8 +1071,7 @@ def execute(self, request: SubRequest) -> FixtureValue: # down first. This is generally handled by SetupState, but still currently # needed when this fixture is not parametrized but depends on a parametrized # fixture. - if not isinstance(fixturedef, PseudoFixtureDef): - requested_fixtures_that_should_finalize_us.append(fixturedef) + requested_fixtures_that_should_finalize_us.append(fixturedef) # Check for (and return) cached value/exception. if self.cached_result is not None: @@ -1136,6 +1123,28 @@ def __repr__(self) -> str: return f"" +class RequestFixtureDef(FixtureDef[FixtureRequest]): + """A custom FixtureDef for the special "request" fixture. + + A new one is generated on-demand whenever "request" is requested. + """ + + def __init__(self, request: FixtureRequest) -> None: + super().__init__( + config=request.config, + baseid=None, + argname="request", + func=lambda: request, + scope=Scope.Function, + params=None, + _ispytest=True, + ) + self.cached_result = (request, [0], None) + + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + pass + + def resolve_fixture_function( fixturedef: FixtureDef[FixtureValue], request: FixtureRequest ) -> _FixtureFunc[FixtureValue]: diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 10941c3f9e3..5644b9567b7 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -750,7 +750,7 @@ def test_request_garbage(self, pytester: Pytester) -> None: """ import sys import pytest - from _pytest.fixtures import PseudoFixtureDef + from _pytest.fixtures import RequestFixtureDef import gc @pytest.fixture(autouse=True) @@ -763,7 +763,7 @@ def something(request): try: gc.collect() - leaked = [x for _ in gc.garbage if isinstance(_, PseudoFixtureDef)] + leaked = [x for _ in gc.garbage if isinstance(_, RequestFixtureDef)] assert leaked == [] finally: gc.set_debug(original) From 288d5739cd3a252ea5fc19039cc24029a7a0d3b6 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Fri, 10 Oct 2025 10:44:45 +0000 Subject: [PATCH 156/270] Merge pull request #13797 from sgaist/add-warning-on-pytest-ini-and-pyproject-presence feat: add warning when pytest.ini and pyproject.toml are present --- AUTHORS | 1 + changelog/13330.improvement.rst | 3 ++ src/_pytest/config/__init__.py | 3 +- src/_pytest/config/findpaths.py | 34 ++++++++---- src/_pytest/terminal.py | 7 ++- testing/test_config.py | 24 ++++----- testing/test_terminal.py | 94 +++++++++++++++++++++++++++++++++ 7 files changed, 143 insertions(+), 23 deletions(-) create mode 100644 changelog/13330.improvement.rst diff --git a/AUTHORS b/AUTHORS index cb8420e4a02..9539e8dc4f4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -403,6 +403,7 @@ Sadra Barikbin Saiprasad Kale Samuel Colvin Samuel Dion-Girardeau +Samuel Gaist Samuel Jirovec Samuel Searles-Bryant Samuel Therrien (Avasam) diff --git a/changelog/13330.improvement.rst b/changelog/13330.improvement.rst new file mode 100644 index 00000000000..58350ea30ef --- /dev/null +++ b/changelog/13330.improvement.rst @@ -0,0 +1,3 @@ +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/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 38fb1ee6d27..a34953480de 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1242,7 +1242,7 @@ def _initini(self, args: Sequence[str]) -> None: ns, unknown_args = self._parser.parse_known_and_unknown_args( args, namespace=copy.copy(self.option) ) - rootpath, inipath, inicfg = determine_setup( + rootpath, inipath, inicfg, ignored_config_files = determine_setup( inifile=ns.inifilename, args=ns.file_or_dir + unknown_args, rootdir_cmd_arg=ns.rootdir or None, @@ -1250,6 +1250,7 @@ def _initini(self, args: Sequence[str]) -> None: ) self._rootpath = rootpath self._inipath = inipath + self._ignored_config_files = ignored_config_files self.inicfg = inicfg self._parser.extra_info["rootdir"] = str(self.rootpath) self._parser.extra_info["inifile"] = str(self.inipath) diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index 763803adbe7..3f08c8121a9 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -91,9 +91,11 @@ def make_scalar(v: object) -> str | list[str]: def locate_config( invocation_dir: Path, args: Iterable[Path], -) -> tuple[Path | None, Path | None, ConfigDict]: +) -> tuple[Path | None, Path | None, ConfigDict, Sequence[str]]: """Search in the list of arguments for a valid ini-file for pytest, - and return a tuple of (rootdir, inifile, cfg-dict).""" + and return a tuple of (rootdir, inifile, cfg-dict, ignored-config-files), where + ignored-config-files is a list of config basenames found that contain + pytest configuration but were ignored.""" config_names = [ "pytest.ini", ".pytest.ini", @@ -105,6 +107,8 @@ def locate_config( if not args: args = [invocation_dir] found_pyproject_toml: Path | None = None + ignored_config_files: list[str] = [] + for arg in args: argpath = absolutepath(arg) for base in (argpath, *argpath.parents): @@ -115,10 +119,18 @@ def locate_config( found_pyproject_toml = p ini_config = load_config_dict_from_file(p) if ini_config is not None: - return base, p, ini_config + index = config_names.index(config_name) + for remainder in config_names[index + 1 :]: + p2 = base / remainder + if ( + p2.is_file() + and load_config_dict_from_file(p2) is not None + ): + ignored_config_files.append(remainder) + return base, p, ini_config, ignored_config_files if found_pyproject_toml is not None: - return found_pyproject_toml.parent, found_pyproject_toml, {} - return None, None, {} + return found_pyproject_toml.parent, found_pyproject_toml, {}, [] + return None, None, {}, [] def get_common_ancestor( @@ -178,7 +190,7 @@ def determine_setup( args: Sequence[str], rootdir_cmd_arg: str | None, invocation_dir: Path, -) -> tuple[Path, Path | None, ConfigDict]: +) -> tuple[Path, Path | None, ConfigDict, Sequence[str]]: """Determine the rootdir, inifile and ini configuration values from the command line arguments. @@ -193,6 +205,8 @@ def determine_setup( """ rootdir = None dirs = get_dirs_from_args(args) + ignored_config_files: Sequence[str] = [] + if inifile: inipath_ = absolutepath(inifile) inipath: Path | None = inipath_ @@ -201,7 +215,9 @@ def determine_setup( rootdir = inipath_.parent else: ancestor = get_common_ancestor(invocation_dir, dirs) - rootdir, inipath, inicfg = locate_config(invocation_dir, [ancestor]) + rootdir, inipath, inicfg, ignored_config_files = locate_config( + invocation_dir, [ancestor] + ) if rootdir is None and rootdir_cmd_arg is None: for possible_rootdir in (ancestor, *ancestor.parents): if (possible_rootdir / "setup.py").is_file(): @@ -209,7 +225,7 @@ def determine_setup( break else: if dirs != [ancestor]: - rootdir, inipath, inicfg = locate_config(invocation_dir, dirs) + rootdir, inipath, inicfg, _ = locate_config(invocation_dir, dirs) if rootdir is None: rootdir = get_common_ancestor( invocation_dir, [invocation_dir, ancestor] @@ -223,7 +239,7 @@ def determine_setup( f"Directory '{rootdir}' not found. Check your '--rootdir' option." ) assert rootdir is not None - return rootdir, inipath, inicfg or {} + return rootdir, inipath, inicfg or {}, ignored_config_files def is_fs_root(p: Path) -> bool: diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 71ea4b1bab9..ed62c9e345e 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -879,7 +879,12 @@ def pytest_report_header(self, config: Config) -> list[str]: result = [f"rootdir: {config.rootpath}"] if config.inipath: - result.append("configfile: " + bestrelpath(config.rootpath, config.inipath)) + warning = "" + if config._ignored_config_files: + warning = f" (WARNING: ignoring pytest config in {', '.join(config._ignored_config_files)}!)" + result.append( + "configfile: " + bestrelpath(config.rootpath, config.inipath) + warning + ) if config.args_source == Config.ArgsSource.TESTPATHS: testpaths: list[str] = config.getini("testpaths") diff --git a/testing/test_config.py b/testing/test_config.py index f2cc139dffa..b3f55e7d25e 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -56,7 +56,7 @@ def test_getcfg_and_config( ), encoding="utf-8", ) - _, _, cfg = locate_config(Path.cwd(), [sub]) + _, _, cfg, _ = locate_config(Path.cwd(), [sub]) assert cfg["name"] == "value" config = pytester.parseconfigure(str(sub)) assert config.inicfg["name"] == "value" @@ -1635,7 +1635,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: b = a / "b" b.mkdir() for args in ([str(tmp_path)], [str(a)], [str(b)]): - rootpath, parsed_inipath, _ = determine_setup( + rootpath, parsed_inipath, *_ = determine_setup( inifile=None, args=args, rootdir_cmd_arg=None, @@ -1643,7 +1643,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: ) assert rootpath == tmp_path assert parsed_inipath == inipath - rootpath, parsed_inipath, ini_config = determine_setup( + rootpath, parsed_inipath, ini_config, _ = determine_setup( inifile=None, args=[str(b), str(a)], rootdir_cmd_arg=None, @@ -1660,7 +1660,7 @@ def test_pytestini_overrides_empty_other(self, tmp_path: Path, name: str) -> Non a = tmp_path / "a" a.mkdir() (a / name).touch() - rootpath, parsed_inipath, _ = determine_setup( + rootpath, parsed_inipath, *_ = determine_setup( inifile=None, args=[str(a)], rootdir_cmd_arg=None, @@ -1674,7 +1674,7 @@ def test_setuppy_fallback(self, tmp_path: Path) -> None: a.mkdir() (a / "setup.cfg").touch() (tmp_path / "setup.py").touch() - rootpath, inipath, inicfg = determine_setup( + rootpath, inipath, inicfg, _ = determine_setup( inifile=None, args=[str(a)], rootdir_cmd_arg=None, @@ -1686,7 +1686,7 @@ def test_setuppy_fallback(self, tmp_path: Path) -> None: def test_nothing(self, tmp_path: Path, monkeypatch: MonkeyPatch) -> None: monkeypatch.chdir(tmp_path) - rootpath, inipath, inicfg = determine_setup( + rootpath, inipath, inicfg, _ = determine_setup( inifile=None, args=[str(tmp_path)], rootdir_cmd_arg=None, @@ -1713,7 +1713,7 @@ def test_with_specific_inifile( p = tmp_path / name p.touch() p.write_text(contents, encoding="utf-8") - rootpath, inipath, ini_config = determine_setup( + rootpath, inipath, ini_config, _ = determine_setup( inifile=str(p), args=[str(tmp_path)], rootdir_cmd_arg=None, @@ -1761,7 +1761,7 @@ def test_with_arg_outside_cwd_without_inifile( a.mkdir() b = tmp_path / "b" b.mkdir() - rootpath, inifile, _ = determine_setup( + rootpath, inifile, *_ = determine_setup( inifile=None, args=[str(a), str(b)], rootdir_cmd_arg=None, @@ -1777,7 +1777,7 @@ def test_with_arg_outside_cwd_with_inifile(self, tmp_path: Path) -> None: b.mkdir() inipath = a / "pytest.ini" inipath.touch() - rootpath, parsed_inipath, _ = determine_setup( + rootpath, parsed_inipath, *_ = determine_setup( inifile=None, args=[str(a), str(b)], rootdir_cmd_arg=None, @@ -1791,7 +1791,7 @@ def test_with_non_dir_arg( self, dirs: Sequence[str], tmp_path: Path, monkeypatch: MonkeyPatch ) -> None: monkeypatch.chdir(tmp_path) - rootpath, inipath, _ = determine_setup( + rootpath, inipath, *_ = determine_setup( inifile=None, args=dirs, rootdir_cmd_arg=None, @@ -1807,7 +1807,7 @@ def test_with_existing_file_in_subdir( a.mkdir() (a / "exists").touch() monkeypatch.chdir(tmp_path) - rootpath, inipath, _ = determine_setup( + rootpath, inipath, *_ = determine_setup( inifile=None, args=["a/exist"], rootdir_cmd_arg=None, @@ -1826,7 +1826,7 @@ def test_with_config_also_in_parent_directory( (tmp_path / "myproject" / "tests").mkdir() monkeypatch.chdir(tmp_path / "myproject") - rootpath, inipath, _ = determine_setup( + rootpath, inipath, *_ = determine_setup( inifile=None, args=["tests/"], rootdir_cmd_arg=None, diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 44ce7aff563..e6b77ae5546 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -2893,6 +2893,100 @@ def test_format_trimmed() -> None: assert _format_trimmed(" ({}) ", msg, len(msg) + 3) == " (unconditional ...) " +def test_warning_when_init_trumps_pyproject_toml( + pytester: Pytester, monkeypatch: MonkeyPatch +) -> None: + """Regression test for #7814.""" + tests = pytester.path.joinpath("tests") + tests.mkdir() + pytester.makepyprojecttoml( + f""" + [tool.pytest.ini_options] + testpaths = ['{tests}'] + """ + ) + pytester.makefile(".ini", pytest="") + result = pytester.runpytest() + result.stdout.fnmatch_lines( + [ + "configfile: pytest.ini (WARNING: ignoring pytest config in pyproject.toml!)", + ] + ) + + +def test_warning_when_init_trumps_multiple_files( + pytester: Pytester, monkeypatch: MonkeyPatch +) -> None: + """Regression test for #7814.""" + tests = pytester.path.joinpath("tests") + tests.mkdir() + pytester.makepyprojecttoml( + f""" + [tool.pytest.ini_options] + testpaths = ['{tests}'] + """ + ) + pytester.makefile(".ini", pytest="") + pytester.makeini( + """ + # tox.ini + [pytest] + minversion = 6.0 + addopts = -ra -q + testpaths = + tests + integration + """ + ) + result = pytester.runpytest() + result.stdout.fnmatch_lines( + [ + "configfile: pytest.ini (WARNING: ignoring pytest config in pyproject.toml, tox.ini!)", + ] + ) + + +def test_no_warning_when_init_but_pyproject_toml_has_no_entry( + pytester: Pytester, monkeypatch: MonkeyPatch +) -> None: + """Regression test for #7814.""" + tests = pytester.path.joinpath("tests") + tests.mkdir() + pytester.makepyprojecttoml( + f""" + [tool] + testpaths = ['{tests}'] + """ + ) + pytester.makefile(".ini", pytest="") + result = pytester.runpytest() + result.stdout.fnmatch_lines( + [ + "configfile: pytest.ini", + ] + ) + + +def test_no_warning_on_terminal_with_a_single_config_file( + pytester: Pytester, monkeypatch: MonkeyPatch +) -> None: + """Regression test for #7814.""" + tests = pytester.path.joinpath("tests") + tests.mkdir() + pytester.makepyprojecttoml( + f""" + [tool.pytest.ini_options] + testpaths = ['{tests}'] + """ + ) + result = pytester.runpytest() + result.stdout.fnmatch_lines( + [ + "configfile: pyproject.toml", + ] + ) + + class TestFineGrainedTestCase: DEFAULT_FILE_CONTENTS = """ import pytest From 661682c25a9ff844a66ebd9b95d9925b8c4b65c8 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 11 Oct 2025 18:20:18 -0300 Subject: [PATCH 157/270] Handle --version eagerly to avoid loading the entire infrastructure (#13575) Currently, handling `--version` in `pytest_cmdline_main` requires loading the entire infrastructure, which can be slow depending on the installed plugins. This change introduces a marginal behavioral difference, though it should not cause any issues in practice. Fixes #13574 --- changelog/13574.improvement.rst | 7 +++++++ src/_pytest/config/__init__.py | 22 ++++++++++++++-------- src/_pytest/helpconfig.py | 30 +++++++++++++++--------------- testing/test_capture.py | 2 +- testing/test_config.py | 14 ++++---------- testing/test_helpconfig.py | 22 +++++++++++----------- 6 files changed, 52 insertions(+), 45 deletions(-) create mode 100644 changelog/13574.improvement.rst diff --git a/changelog/13574.improvement.rst b/changelog/13574.improvement.rst new file mode 100644 index 00000000000..7820cd03fac --- /dev/null +++ b/changelog/13574.improvement.rst @@ -0,0 +1,7 @@ +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/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index a34953480de..afa7e25d84a 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -149,11 +149,17 @@ def main( :returns: An exit code. """ + # Handle a single `--version` argument early to avoid starting up the entire pytest infrastructure. + new_args = sys.argv[1:] if args is None else args + if isinstance(new_args, Sequence) and new_args.count("--version") == 1: + sys.stdout.write(f"pytest {__version__}\n") + return ExitCode.OK + old_pytest_version = os.environ.get("PYTEST_VERSION") try: os.environ["PYTEST_VERSION"] = __version__ try: - config = _prepareconfig(args, plugins) + config = _prepareconfig(new_args, plugins) except ConftestImportFailure as e: exc_info = ExceptionInfo.from_exception(e.cause) tw = TerminalWriter(sys.stderr) @@ -317,12 +323,10 @@ def get_plugin_manager() -> PytestPluginManager: def _prepareconfig( - args: list[str] | os.PathLike[str] | None = None, + args: list[str] | os.PathLike[str], plugins: Sequence[str | _PluggyPlugin] | None = None, ) -> Config: - if args is None: - args = sys.argv[1:] - elif isinstance(args, os.PathLike): + if isinstance(args, os.PathLike): args = [os.fspath(args)] elif not isinstance(args, list): msg = ( # type:ignore[unreachable] @@ -1145,13 +1149,15 @@ def pytest_cmdline_parse( try: self.parse(args) except UsageError: - # Handle --version and --help here in a minimal fashion. + # Handle `--version --version` and `--help` here in a minimal fashion. # This gets done via helpconfig normally, but its # pytest_cmdline_main is not called in case of errors. if getattr(self.option, "version", False) or "--version" in args: - from _pytest.helpconfig import showversion + from _pytest.helpconfig import show_version_verbose - showversion(self) + # Note that `--version` (single argument) is handled early by `Config.main()`, so the only + # way we are reaching this point is via `--version --version`. + show_version_verbose(self) elif ( getattr(self.option, "help", False) or "--help" in args or "-h" in args ): diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index b2f6e5dd0ca..da5d06f83b0 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -140,28 +140,28 @@ def unset_tracing() -> None: return config -def showversion(config: Config) -> None: - if config.option.version > 1: - sys.stdout.write( - f"This is pytest version {pytest.__version__}, imported from {pytest.__file__}\n" - ) - plugininfo = getpluginversioninfo(config) - if plugininfo: - for line in plugininfo: - sys.stdout.write(line + "\n") - else: - sys.stdout.write(f"pytest {pytest.__version__}\n") +def show_version_verbose(config: Config) -> None: + """Show verbose pytest version installation, including plugins.""" + sys.stdout.write( + f"This is pytest version {pytest.__version__}, imported from {pytest.__file__}\n" + ) + plugininfo = getpluginversioninfo(config) + if plugininfo: + for line in plugininfo: + sys.stdout.write(line + "\n") def pytest_cmdline_main(config: Config) -> int | ExitCode | None: - if config.option.version > 0: - showversion(config) - return 0 + # Note: a single `--version` argument is handled directly by `Config.main()` to avoid starting up the entire + # pytest infrastructure just to display the version (#13574). + if config.option.version > 1: + show_version_verbose(config) + return ExitCode.OK elif config.option.help: config._do_configure() showhelp(config) config._ensure_unconfigure() - return 0 + return ExitCode.OK return None diff --git a/testing/test_capture.py b/testing/test_capture.py index ffbc440e3bf..11fd18f08ff 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -868,7 +868,7 @@ def bad_snap(self): FDCapture.snap = bad_snap """ ) - result = pytester.runpytest_subprocess("-p", "pytest_xyz", "--version") + result = pytester.runpytest_subprocess("-p", "pytest_xyz") result.stderr.fnmatch_lines( ["*in bad_snap", " raise Exception('boom')", "Exception: boom"] ) diff --git a/testing/test_config.py b/testing/test_config.py index b3f55e7d25e..9efac8739b7 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -612,20 +612,14 @@ def pytest_addoption(parser): assert config.getini("custom") == "1" def test_absolute_win32_path(self, pytester: Pytester) -> None: - temp_ini_file = pytester.makefile( - ".ini", - custom=""" - [pytest] - addopts = --version - """, - ) + temp_ini_file = pytester.makeini("[pytest]") from os.path import normpath temp_ini_file_norm = normpath(str(temp_ini_file)) ret = pytest.main(["-c", temp_ini_file_norm]) - assert ret == ExitCode.OK + assert ret == ExitCode.NO_TESTS_COLLECTED ret = pytest.main(["--config-file", temp_ini_file_norm]) - assert ret == ExitCode.OK + assert ret == ExitCode.NO_TESTS_COLLECTED class TestConfigAPI: @@ -2121,7 +2115,7 @@ def pytest_addoption(parser): result = pytester.runpytest("--version") result.stdout.fnmatch_lines([f"pytest {pytest.__version__}"]) - assert result.ret == ExitCode.USAGE_ERROR + assert result.ret == ExitCode.OK def test_help_formatter_uses_py_get_terminal_width(monkeypatch: MonkeyPatch) -> None: diff --git a/testing/test_helpconfig.py b/testing/test_helpconfig.py index dc7e709b65d..455ed5276a8 100644 --- a/testing/test_helpconfig.py +++ b/testing/test_helpconfig.py @@ -10,21 +10,21 @@ def test_version_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None: monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD") monkeypatch.delenv("PYTEST_PLUGINS", raising=False) result = pytester.runpytest("--version", "--version") - assert result.ret == 0 + assert result.ret == ExitCode.OK result.stdout.fnmatch_lines([f"*pytest*{pytest.__version__}*imported from*"]) if pytestconfig.pluginmanager.list_plugin_distinfo(): result.stdout.fnmatch_lines(["*registered third-party plugins:", "*at*"]) -def test_version_less_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None: - monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD") - monkeypatch.delenv("PYTEST_PLUGINS", raising=False) - result = pytester.runpytest("--version") - assert result.ret == 0 - result.stdout.fnmatch_lines([f"pytest {pytest.__version__}"]) +def test_version_less_verbose(pytester: Pytester) -> None: + """Single ``--version`` parameter should display only the pytest version, without loading plugins (#13574).""" + pytester.makeconftest("print('This should not be printed')") + result = pytester.runpytest_subprocess("--version") + assert result.ret == ExitCode.OK + assert result.stdout.str().strip() == f"pytest {pytest.__version__}" -def test_versions(): +def test_versions() -> None: """Regression check for the public version attributes in pytest.""" assert isinstance(pytest.__version__, str) assert isinstance(pytest.version_tuple, tuple) @@ -32,7 +32,7 @@ def test_versions(): def test_help(pytester: Pytester) -> None: result = pytester.runpytest("--help") - assert result.ret == 0 + assert result.ret == ExitCode.OK result.stdout.fnmatch_lines( """ -m MARKEXPR Only run tests matching given mark expression. For @@ -73,7 +73,7 @@ def pytest_addoption(parser): """ ) result = pytester.runpytest("--help") - assert result.ret == 0 + assert result.ret == ExitCode.OK lines = [ " required_plugins (args):", " Plugins that must be present for pytest to run*", @@ -91,7 +91,7 @@ def pytest_hello(xyz): """ ) result = pytester.runpytest() - assert result.ret != 0 + assert result.ret != ExitCode.OK result.stdout.fnmatch_lines(["*unknown hook*pytest_hello*"]) From b0e4c841ae4c03e33100503c2b595f48f657f1e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Oct 2025 10:41:31 +0200 Subject: [PATCH 158/270] [automated] Update plugin list (#13803) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 188 +++++++++++++++++++------------ 1 file changed, 114 insertions(+), 74 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index ddf873634e7..b3e2cafffbc 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =2.7.3) :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Apr 13, 2023 N/A pytest :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest - :pypi:`pytest-allure-host` Publish Allure static reports to private S3 behind CloudFront with history preservation Sep 30, 2025 3 - Alpha N/A + :pypi:`pytest-allure-host` Publish Allure static reports to private S3 behind CloudFront with history preservation Oct 10, 2025 3 - Alpha N/A :pypi:`pytest-allure-id2history` Overwrite allure history id with testcase full name and testcase id if testcase has id, exclude parameters. May 14, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-allure-intersection` Oct 27, 2022 N/A pytest (<5) :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest @@ -174,7 +174,7 @@ This list contains 1723 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Sep 25, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Oct 09, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -193,7 +193,7 @@ This list contains 1723 plugins. :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A - :pypi:`pytest-b-logger` BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. Oct 02, 2025 N/A pytest + :pypi:`pytest-b-logger` BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports. Oct 10, 2025 N/A pytest :pypi:`pytest-blue` A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. Sep 05, 2022 N/A N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A :pypi:`pytest-boardfarm3` Integrate boardfarm as a pytest plugin. Sep 15, 2025 N/A pytest @@ -250,7 +250,7 @@ This list contains 1723 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Sep 15, 2025 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Oct 07, 2025 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-checkdocs` check the README when running tests Apr 30, 2024 5 - Production/Stable pytest!=8.1.*,>=6; extra == "testing" :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Dec 04, 2023 5 - Production/Stable pytest >=2.9.2 :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -297,7 +297,7 @@ This list contains 1723 plugins. :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Jul 10, 2025 5 - Production/Stable pytest>=3.8 + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Oct 07, 2025 5 - Production/Stable pytest>=3.8 :pypi:`pytest-collect-appoint-info` set your encoding Aug 03, 2023 N/A pytest :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A @@ -358,7 +358,7 @@ This list contains 1723 plugins. :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-dashboard` Jun 02, 2025 N/A pytest<8.0.0,>=7.4.3 :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A - :pypi:`pytest-databases` Reusable database fixtures for any and all databases. Sep 11, 2025 4 - Beta pytest + :pypi:`pytest-databases` Reusable database fixtures for any and all databases. Oct 06, 2025 4 - Beta pytest :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest :pypi:`pytest-datadir` pytest plugin for test data directories and files Jul 30, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Apr 06, 2023 5 - Production/Stable pytest (>=7.1) @@ -369,6 +369,8 @@ This list contains 1723 plugins. :pypi:`pytest-datafiles` py.test plugin to create a 'tmp_path' containing predefined files/directories. Feb 24, 2023 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-datafixtures` Data fixtures for pytest made simple. May 15, 2025 5 - Production/Stable N/A :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest + :pypi:`pytest-dataguard` Data validation and integrity testing for your datasets using pytest. Oct 08, 2025 N/A pytest>=8.4.2 + :pypi:`pytest-data-loader` Pytest plugin for loading test data for data-driven testing (DDT) Oct 10, 2025 4 - Beta pytest<9,>=7.0.0 :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Jul 31, 2024 5 - Production/Stable pytest :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Sep 01, 2023 5 - Production/Stable N/A @@ -531,7 +533,7 @@ This list contains 1723 plugins. :pypi:`pytest_energy_reporter` An energy estimation reporter for pytest Mar 28, 2024 3 - Alpha pytest<9.0.0,>=8.1.1 :pypi:`pytest-enhanced-reports` Enhanced test reports for pytest Dec 15, 2022 N/A N/A :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A - :pypi:`pytest-env` pytest plugin that allows you to add environment variables. Sep 17, 2024 5 - Production/Stable pytest>=8.3.3 + :pypi:`pytest-env` pytest plugin that allows you to add environment variables. Oct 09, 2025 5 - Production/Stable pytest>=8.4.2 :pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A :pypi:`pytest-env-info` Push information about the running pytest into envvars Nov 25, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-environment` Pytest Environment Mar 17, 2024 1 - Planning N/A @@ -704,7 +706,7 @@ This list contains 1723 plugins. :pypi:`pytest-gradescope` A pytest plugin for Gradescope integration Apr 29, 2025 N/A N/A :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A - :pypi:`pytest-greener` Pytest plugin for Greener Aug 23, 2025 N/A pytest<9.0.0,>=8.3.3 + :pypi:`pytest-greener` Pytest plugin for Greener Oct 05, 2025 N/A pytest<9.0.0,>=8.3.3 :pypi:`pytest-group-by-class` A Pytest plugin for running a subset of your tests by splitting them in to groups of classes. Jun 27, 2023 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) @@ -728,7 +730,7 @@ This list contains 1723 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 04, 2025 3 - Alpha pytest==8.4.2 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 11, 2025 3 - Alpha pytest==8.4.2 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -738,7 +740,7 @@ This list contains 1723 plugins. :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 27, 2023 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Feb 28, 2023 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Nov 07, 2023 5 - Production/Stable pytest>=7.0.0 - :pypi:`pytest-html5` the best report for pytest Sep 22, 2025 N/A N/A + :pypi:`pytest-html5` the best report for pytest Oct 11, 2025 N/A N/A :pypi:`pytest-html-cn` pytest plugin for generating HTML reports Aug 19, 2024 5 - Production/Stable pytest!=6.0.0,>=5.0 :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-html-merger` Pytest HTML reports merging utility Jul 12, 2024 N/A N/A @@ -759,7 +761,7 @@ This list contains 1723 plugins. :pypi:`pytest-httpchain-models` Pydantic models for pytest-httpchain Aug 16, 2025 N/A N/A :pypi:`pytest-httpchain-templates` Templating support for pytest-httpchain Aug 16, 2025 N/A N/A :pypi:`pytest-httpchain-userfunc` User functions support for pytest-httpchain Aug 16, 2025 N/A N/A - :pypi:`pytest-httpdbg` A pytest plugin to record HTTP(S) requests with stack trace. Jul 25, 2025 4 - Beta pytest>=7.0.0 + :pypi:`pytest-httpdbg` A pytest plugin to record HTTP(S) requests with stack trace. Oct 06, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest_httpserver` pytest-httpserver is a httpserver for pytest Apr 10, 2025 3 - Alpha N/A @@ -789,7 +791,7 @@ This list contains 1723 plugins. :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A :pypi:`pytest-info-plugin` Get executed interface information in pytest interface automation framework Sep 14, 2023 N/A N/A :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A - :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Sep 06, 2025 4 - Beta pytest~=8.3 + :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Oct 11, 2025 4 - Beta pytest~=8.3 :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-initry` Plugin for sending automation test data from Pytest to the initry Apr 30, 2024 N/A pytest<9.0.0,>=8.1.1 @@ -810,7 +812,7 @@ This list contains 1723 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest May 22, 2023 N/A pytest (>=5.2) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-interface-tester` Pytest plugin for checking charm relation interface protocol compliance. Feb 13, 2025 4 - Beta pytest + :pypi:`pytest-interface-tester` Pytest plugin for checking charm relation interface protocol compliance. Oct 09, 2025 4 - Beta pytest :pypi:`pytest-invenio` Pytest fixtures for Invenio. Jul 09, 2025 5 - Production/Stable pytest<9.0.0,>=6 :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-iovis` A Pytest plugin to enable Jupyter Notebook testing with Papermill Nov 06, 2024 4 - Beta pytest>=7.1.0 @@ -833,7 +835,7 @@ This list contains 1723 plugins. :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 15, 2025 3 - Alpha N/A :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Jul 09, 2024 N/A pytest>=7.2.0 - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 24, 2025 4 - Beta pytest>=6.2.4 + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Oct 11, 2025 4 - Beta pytest>=6.2.4 :pypi:`pytest-job-selection` A pytest plugin for load balancing test suites Jan 30, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) @@ -956,7 +958,7 @@ This list contains 1723 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Aug 18, 2025 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Oct 03, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Oct 07, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -1030,7 +1032,7 @@ This list contains 1723 plugins. :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) :pypi:`pytest-neos` Pytest plugin for neos Sep 10, 2024 5 - Production/Stable pytest<8.0,>=7.2; extra == "dev" :pypi:`pytest-netconf` A pytest plugin that provides a mock NETCONF (RFC6241/RFC6242) server for local testing. Jan 06, 2025 N/A N/A - :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Sep 01, 2025 N/A pytest>=3.5.0 + :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Oct 09, 2025 N/A pytest>=3.5.0 :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) @@ -1038,7 +1040,7 @@ This list contains 1723 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Oct 03, 2025 N/A pytest<9.0.0,>=8.2.0 + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Oct 08, 2025 N/A pytest<9.0.0,>=8.2.0 :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest_nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Aug 05, 2024 N/A N/A @@ -1063,11 +1065,12 @@ This list contains 1723 plugins. :pypi:`pytest-odc` A pytest plugin for simplifying ODC database tests Aug 04, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-odoo` py.test plugin to run Odoo tests May 20, 2025 5 - Production/Stable pytest>=8 :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A - :pypi:`pytest-oduit` py.test plugin to run Odoo tests Oct 02, 2025 5 - Production/Stable pytest>=8 + :pypi:`pytest-oduit` py.test plugin to run Odoo tests Oct 06, 2025 5 - Production/Stable pytest>=8 :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A :pypi:`pytest-offline` Mar 09, 2023 1 - Planning pytest (>=7.0.0,<8.0.0) :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 May 16, 2023 N/A N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A + :pypi:`pytest-once` xdist-safe 'run once' fixture decorator for pytest (setup/teardown across workers) Oct 10, 2025 3 - Alpha pytest>=8.4.0 :pypi:`pytest-only` Use @pytest.mark.only to run a single test May 27, 2024 5 - Production/Stable pytest<9,>=3.6.0 :pypi:`pytest-oof` A Pytest plugin providing structured, programmatic access to a test run's results Dec 11, 2023 4 - Beta N/A :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A @@ -1145,7 +1148,7 @@ This list contains 1723 plugins. :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Sep 08, 2025 N/A pytest<9.0.0,>=6.2.4 :pypi:`pytest_playwright_async` ASYNC Pytest plugin for Playwright Sep 28, 2024 N/A N/A :pypi:`pytest-playwright-asyncio` A pytest wrapper with async fixtures for Playwright to automate web browsers Sep 08, 2025 N/A pytest<9.0.0,>=6.2.4 - :pypi:`pytest-playwright-axe` An axe-core integration for accessibility testing using Playwright Python. Mar 27, 2025 4 - Beta N/A + :pypi:`pytest-playwright-axe` An axe-core integration for accessibility testing using Playwright Python. Oct 10, 2025 5 - Production/Stable N/A :pypi:`pytest-playwright-enhanced` A pytest plugin for playwright python Mar 24, 2024 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A @@ -1155,7 +1158,7 @@ This list contains 1723 plugins. :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Sep 14, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Oct 10, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1179,7 +1182,7 @@ This list contains 1723 plugins. :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Jun 04, 2025 5 - Production/Stable pytest>=7 :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A - :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Feb 25, 2025 5 - Production/Stable pytest>=8.3.2 + :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Oct 09, 2025 5 - Production/Stable pytest>=8.4.2 :pypi:`pytest-priority` pytest plugin for add priority for tests Aug 19, 2024 N/A pytest :pypi:`pytest-proceed` Oct 01, 2024 N/A pytest :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) @@ -1229,7 +1232,7 @@ This list contains 1723 plugins. :pypi:`pytest-python-test-engineer-sort` Sort plugin for Pytest May 13, 2024 N/A pytest>=6.2.0 :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-pyvenv` A package for create venv in tests Feb 27, 2024 N/A pytest ; extra == 'test' - :pypi:`pytest-pyvista` Pytest-pyvista package. Jul 07, 2025 4 - Beta pytest>=3.5.0 + :pypi:`pytest-pyvista` Pytest-pyvista package. Oct 06, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-qanova` A pytest plugin to collect test information Sep 05, 2024 3 - Alpha pytest :pypi:`pytest-qaseio` Pytest plugin for Qase.io integration Oct 01, 2025 5 - Production/Stable pytest<9.0.0,>=7.2.2 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) @@ -1258,7 +1261,7 @@ This list contains 1723 plugins. :pypi:`pytest-ranking` A Pytest plugin for faster fault detection via regression test prioritization Apr 08, 2025 4 - Beta pytest>=7.4.3 :pypi:`pytest-rca-report` Interactive RCA report generator for pytest runs, with AI-based analysis and visual dashboard Aug 04, 2025 N/A N/A :pypi:`pytest-readme` Test your README.md file Aug 01, 2025 5 - Production/Stable pytest - :pypi:`pytest-reana` Pytest fixtures for REANA. Sep 04, 2024 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Oct 10, 2025 3 - Alpha N/A :pypi:`pytest-recap` Capture your test sessions. Recap the results. Jun 16, 2025 N/A pytest>=6.2.0 :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Jul 25, 2025 N/A N/A :pypi:`pytest-recording` A pytest plugin powered by VCR.py to record and replay HTTP traffic May 08, 2025 4 - Beta pytest>=3.5.0 @@ -1272,7 +1275,7 @@ This list contains 1723 plugins. :pypi:`pytest-regex` Select pytest tests with regular expressions May 29, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Sep 05, 2025 5 - Production/Stable pytest>=6.2.0 - :pypi:`pytest-regtest` pytest plugin for snapshot regression testing Jul 21, 2025 N/A pytest>7.2 + :pypi:`pytest-regtest` pytest plugin for snapshot regression testing Oct 11, 2025 N/A pytest>7.2 :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relative-path` Handle relative path in pytest options or ini configs Aug 30, 2024 N/A pytest :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Mar 29, 2024 5 - Production/Stable pytest>=7 @@ -1287,7 +1290,7 @@ This list contains 1723 plugins. :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance May 05, 2025 3 - Alpha pytest :pypi:`pytest-report` Creates json report that is compatible with atom.io's linter message format May 11, 2016 4 - Beta N/A :pypi:`pytest-reporter` Generate Pytest reports with templates Feb 28, 2024 4 - Beta pytest - :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Oct 02, 2025 4 - Beta N/A + :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Oct 10, 2025 4 - Beta N/A :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Apr 26, 2025 N/A N/A :pypi:`pytest-reporter-plus` Lightweight enhanced HTML reporter for Pytest Jul 16, 2025 N/A N/A :pypi:`pytest-report-extras` Pytest plugin to enhance pytest-html and allure reports by adding comments, screenshots, webpage sources and attachments. Aug 08, 2025 N/A pytest>=8.4.0 @@ -1312,7 +1315,7 @@ This list contains 1723 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerun-all` Rerun testsuite for a certain time or iterations Jul 30, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-rerunclassfailures` pytest rerun class failures plugin Apr 24, 2024 5 - Production/Stable pytest>=7.2 - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 02, 2025 5 - Production/Stable pytest!=8.2.2,>=7.4 + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Oct 10, 2025 5 - Production/Stable pytest!=8.2.2,>=7.4 :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Dec 22, 2024 4 - Beta pytest :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Jul 29, 2025 N/A pytest~=7.0 @@ -1326,7 +1329,7 @@ This list contains 1723 plugins. :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Sep 09, 2025 5 - Production/Stable pytest :pypi:`pytest-result-log` A pytest plugin that records the start, end, and result information of each use case in a log file Jan 10, 2024 N/A pytest>=7.2.0 :pypi:`pytest-result-notify` Default template for PDM package Apr 27, 2025 N/A pytest>=8.3.5 - :pypi:`pytest-results` Easily spot regressions in your tests. Sep 30, 2025 4 - Beta pytest + :pypi:`pytest-results` Easily spot regressions in your tests. Oct 08, 2025 4 - Beta pytest :pypi:`pytest-result-sender` Apr 20, 2023 N/A pytest>=7.3.1 :pypi:`pytest-result-sender-jms` Default template for PDM package May 22, 2025 N/A pytest>=8.3.5 :pypi:`pytest-result-sender-lj` Default template for PDM package Dec 17, 2024 N/A pytest>=8.3.4 @@ -1348,7 +1351,7 @@ This list contains 1723 plugins. :pypi:`pytest-rmysql` This is a plugin which is able to connet MySQL easyly. Aug 17, 2025 N/A pytest>=8.4.1 :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Nov 09, 2022 5 - Production/Stable pytest - :pypi:`pytest-robotframework` a pytest plugin that can run both python and robotframework tests while generating robot reports for them Aug 17, 2025 N/A pytest<9,>=7 + :pypi:`pytest-robotframework` a pytest plugin that can run both python and robotframework tests while generating robot reports for them Oct 06, 2025 N/A pytest<9,>=7 :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) @@ -1361,7 +1364,7 @@ This list contains 1723 plugins. :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Sep 25, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest - :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 + :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Oct 10, 2025 5 - Production/Stable pytest>=5.0.0 :pypi:`pytest-runtime-yoyo` run case mark timeout Jun 12, 2023 N/A pytest (>=7.2.0) :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A @@ -1375,7 +1378,7 @@ This list contains 1723 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Oct 03, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Oct 10, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. Sep 03, 2025 5 - Production/Stable pytest<9,>=7.4 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1387,7 +1390,7 @@ This list contains 1723 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 03, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 10, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1416,6 +1419,7 @@ This list contains 1723 plugins. :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Aug 14, 2023 5 - Production/Stable pytest >=3.5.1 :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-shutil` A goodie-bag of unix shell and environment tools for py.test Nov 29, 2024 5 - Production/Stable pytest + :pypi:`pytest-sigil` Proper fixture resource cleanup by handling signals Oct 08, 2025 N/A pytest<9.0.0,>=8.0.0 :pypi:`pytest-simbind` Pytest plugin to operate with objects generated by Simbind tool. Mar 28, 2024 N/A pytest>=7.0.0 :pypi:`pytest-simplehttpserver` Simple pytest fixture to spin up an HTTP server Jun 24, 2021 4 - Beta N/A :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A @@ -1436,7 +1440,7 @@ This list contains 1723 plugins. :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A :pypi:`pytest-smart-debugger-backend` Backend server for Pytest Smart Debugger Sep 17, 2025 N/A N/A :pypi:`pytest-smell` Automated bad smell detection tool for Pytest Jun 26, 2022 N/A N/A - :pypi:`pytest-smoke` Pytest plugin for smoke testing May 23, 2025 4 - Beta pytest<9,>=7.0.0 + :pypi:`pytest-smoke` Pytest plugin for smoke testing Oct 08, 2025 4 - Beta pytest<9,>=7.0.0 :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-smtp4dev` Plugin for smtp4dev API Jun 27, 2023 5 - Production/Stable N/A :pypi:`pytest-smtpd` An SMTP server for testing built on aiosmtpd May 15, 2023 N/A pytest @@ -1462,7 +1466,7 @@ This list contains 1723 plugins. :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. May 21, 2025 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A - :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. Sep 08, 2025 N/A pytest; extra == "test" + :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. Oct 08, 2025 N/A pytest; extra == "test" :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Apr 10, 2024 N/A pytest>7.0 :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jan 22, 2023 3 - Alpha pytest>=7 :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Apr 13, 2024 4 - Beta pytest>=8.1.1 @@ -1638,7 +1642,7 @@ This list contains 1723 plugins. :pypi:`pytest-tutorials` Mar 11, 2023 N/A N/A :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Sep 10, 2024 5 - Production/Stable pytest>=2.3 - :pypi:`pytest-ty` A pytest plugin to run the ty type checker Jun 25, 2025 3 - Alpha pytest>=7.0.0 + :pypi:`pytest-ty` A pytest plugin to run the ty type checker Oct 10, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typed-schema-shot` Pytest plugin for automatic JSON Schema generation and validation from examples Jun 14, 2025 N/A pytest :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1674,6 +1678,7 @@ This list contains 1723 plugins. :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Nov 23, 2023 4 - Beta pytest :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests Nov 29, 2024 5 - Production/Stable pytest + :pypi:`pytest-verify` A pytest plugin for snapshot verification with optional visual diff viewer. Oct 11, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test Nov 29, 2024 5 - Production/Stable pytest :pypi:`pytest-visual` Nov 28, 2024 4 - Beta pytest>=7.0.0 @@ -2022,7 +2027,7 @@ This list contains 1723 plugins. pytest plugin to test case doc string dls instructions :pypi:`pytest-allure-host` - *last release*: Sep 30, 2025, + *last release*: Oct 10, 2025, *status*: 3 - Alpha, *requires*: N/A @@ -2743,7 +2748,7 @@ This list contains 1723 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Sep 25, 2025, + *last release*: Oct 09, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -2876,7 +2881,7 @@ This list contains 1723 plugins. pytest plugin to mark a test as blocker and skip all other tests :pypi:`pytest-b-logger` - *last release*: Oct 02, 2025, + *last release*: Oct 10, 2025, *status*: N/A, *requires*: pytest @@ -3275,7 +3280,7 @@ This list contains 1723 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Sep 15, 2025, + *last release*: Oct 07, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0.0 @@ -3604,7 +3609,7 @@ This list contains 1723 plugins. pytest plugin to run pycodestyle :pypi:`pytest-codspeed` - *last release*: Jul 10, 2025, + *last release*: Oct 07, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=3.8 @@ -4031,7 +4036,7 @@ This list contains 1723 plugins. Useful functions for managing data for pytest fixtures :pypi:`pytest-databases` - *last release*: Sep 11, 2025, + *last release*: Oct 06, 2025, *status*: 4 - Beta, *requires*: pytest @@ -4107,6 +4112,20 @@ This list contains 1723 plugins. pytest plugin to provide data from files loaded automatically + :pypi:`pytest-dataguard` + *last release*: Oct 08, 2025, + *status*: N/A, + *requires*: pytest>=8.4.2 + + Data validation and integrity testing for your datasets using pytest. + + :pypi:`pytest-data-loader` + *last release*: Oct 10, 2025, + *status*: 4 - Beta, + *requires*: pytest<9,>=7.0.0 + + Pytest plugin for loading test data for data-driven testing (DDT) + :pypi:`pytest-dataplugin` *last release*: Sep 16, 2017, *status*: 1 - Planning, @@ -5242,9 +5261,9 @@ This list contains 1723 plugins. Improvements for pytest (rejected upstream) :pypi:`pytest-env` - *last release*: Sep 17, 2024, + *last release*: Oct 09, 2025, *status*: 5 - Production/Stable, - *requires*: pytest>=8.3.3 + *requires*: pytest>=8.4.2 pytest plugin that allows you to add environment variables. @@ -6453,7 +6472,7 @@ This list contains 1723 plugins. Green progress dots :pypi:`pytest-greener` - *last release*: Aug 23, 2025, + *last release*: Oct 05, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.3.3 @@ -6621,7 +6640,7 @@ This list contains 1723 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Oct 04, 2025, + *last release*: Oct 11, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.2 @@ -6691,7 +6710,7 @@ This list contains 1723 plugins. pytest plugin for generating HTML reports :pypi:`pytest-html5` - *last release*: Sep 22, 2025, + *last release*: Oct 11, 2025, *status*: N/A, *requires*: N/A @@ -6838,7 +6857,7 @@ This list contains 1723 plugins. User functions support for pytest-httpchain :pypi:`pytest-httpdbg` - *last release*: Jul 25, 2025, + *last release*: Oct 06, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -7048,7 +7067,7 @@ This list contains 1723 plugins. display more node ininformation. :pypi:`pytest-infrahouse` - *last release*: Sep 06, 2025, + *last release*: Oct 11, 2025, *status*: 4 - Beta, *requires*: pytest~=8.3 @@ -7195,7 +7214,7 @@ This list contains 1723 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-interface-tester` - *last release*: Feb 13, 2025, + *last release*: Oct 09, 2025, *status*: 4 - Beta, *requires*: pytest @@ -7356,7 +7375,7 @@ This list contains 1723 plugins. Plugin skips (xfail) tests if unresolved Jira issue(s) linked :pypi:`pytest-jira-xray` - *last release*: May 24, 2025, + *last release*: Oct 11, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.4 @@ -8217,7 +8236,7 @@ This list contains 1723 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Oct 03, 2025, + *last release*: Oct 07, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8735,7 +8754,7 @@ This list contains 1723 plugins. A pytest plugin that provides a mock NETCONF (RFC6241/RFC6242) server for local testing. :pypi:`pytest-netdut` - *last release*: Sep 01, 2025, + *last release*: Oct 09, 2025, *status*: N/A, *requires*: pytest>=3.5.0 @@ -8791,7 +8810,7 @@ This list contains 1723 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Oct 03, 2025, + *last release*: Oct 08, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.2.0 @@ -8966,7 +8985,7 @@ This list contains 1723 plugins. Project description :pypi:`pytest-oduit` - *last release*: Oct 02, 2025, + *last release*: Oct 06, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=8 @@ -9000,6 +9019,13 @@ This list contains 1723 plugins. The ultimate pytest output plugin + :pypi:`pytest-once` + *last release*: Oct 10, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=8.4.0 + + xdist-safe 'run once' fixture decorator for pytest (setup/teardown across workers) + :pypi:`pytest-only` *last release*: May 27, 2024, *status*: 5 - Production/Stable, @@ -9540,8 +9566,8 @@ This list contains 1723 plugins. A pytest wrapper with async fixtures for Playwright to automate web browsers :pypi:`pytest-playwright-axe` - *last release*: Mar 27, 2025, - *status*: 4 - Beta, + *last release*: Oct 10, 2025, + *status*: 5 - Production/Stable, *requires*: N/A An axe-core integration for accessibility testing using Playwright Python. @@ -9610,7 +9636,7 @@ This list contains 1723 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Sep 14, 2025, + *last release*: Oct 10, 2025, *status*: N/A, *requires*: pytest @@ -9778,9 +9804,9 @@ This list contains 1723 plugins. Minitest-style test colors :pypi:`pytest-print` - *last release*: Feb 25, 2025, + *last release*: Oct 09, 2025, *status*: 5 - Production/Stable, - *requires*: pytest>=8.3.2 + *requires*: pytest>=8.4.2 pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) @@ -10128,9 +10154,9 @@ This list contains 1723 plugins. A package for create venv in tests :pypi:`pytest-pyvista` - *last release*: Jul 07, 2025, + *last release*: Oct 06, 2025, *status*: 4 - Beta, - *requires*: pytest>=3.5.0 + *requires*: pytest>=6.2.0 Pytest-pyvista package. @@ -10331,7 +10357,7 @@ This list contains 1723 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Sep 04, 2024, + *last release*: Oct 10, 2025, *status*: 3 - Alpha, *requires*: N/A @@ -10429,7 +10455,7 @@ This list contains 1723 plugins. Easy to use fixtures to write regression tests. :pypi:`pytest-regtest` - *last release*: Jul 21, 2025, + *last release*: Oct 11, 2025, *status*: N/A, *requires*: pytest>7.2 @@ -10534,7 +10560,7 @@ This list contains 1723 plugins. Generate Pytest reports with templates :pypi:`pytest-reporter-html1` - *last release*: Oct 02, 2025, + *last release*: Oct 10, 2025, *status*: 4 - Beta, *requires*: N/A @@ -10709,7 +10735,7 @@ This list contains 1723 plugins. pytest rerun class failures plugin :pypi:`pytest-rerunfailures` - *last release*: Sep 02, 2025, + *last release*: Oct 10, 2025, *status*: 5 - Production/Stable, *requires*: pytest!=8.2.2,>=7.4 @@ -10807,7 +10833,7 @@ This list contains 1723 plugins. Default template for PDM package :pypi:`pytest-results` - *last release*: Sep 30, 2025, + *last release*: Oct 08, 2025, *status*: 4 - Beta, *requires*: pytest @@ -10961,7 +10987,7 @@ This list contains 1723 plugins. pytest plugin for ROAST configuration override and fixtures :pypi:`pytest-robotframework` - *last release*: Aug 17, 2025, + *last release*: Oct 06, 2025, *status*: N/A, *requires*: pytest<9,>=7 @@ -11052,8 +11078,8 @@ This list contains 1723 plugins. Checks type annotations on runtime while running tests. :pypi:`pytest-runtime-xfail` - *last release*: Aug 26, 2021, - *status*: N/A, + *last release*: Oct 10, 2025, + *status*: 5 - Production/Stable, *requires*: pytest>=5.0.0 Call runtime_xfail() to mark running test as xfail. @@ -11150,7 +11176,7 @@ This list contains 1723 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Oct 03, 2025, + *last release*: Oct 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11234,7 +11260,7 @@ This list contains 1723 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Oct 03, 2025, + *last release*: Oct 10, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11436,6 +11462,13 @@ This list contains 1723 plugins. A goodie-bag of unix shell and environment tools for py.test + :pypi:`pytest-sigil` + *last release*: Oct 08, 2025, + *status*: N/A, + *requires*: pytest<9.0.0,>=8.0.0 + + Proper fixture resource cleanup by handling signals + :pypi:`pytest-simbind` *last release*: Mar 28, 2024, *status*: N/A, @@ -11577,7 +11610,7 @@ This list contains 1723 plugins. Automated bad smell detection tool for Pytest :pypi:`pytest-smoke` - *last release*: May 23, 2025, + *last release*: Oct 08, 2025, *status*: 4 - Beta, *requires*: pytest<9,>=7.0.0 @@ -11759,7 +11792,7 @@ This list contains 1723 plugins. py.test plugin to spawn process and communicate with them. :pypi:`pytest-spec` - *last release*: Sep 08, 2025, + *last release*: Oct 08, 2025, *status*: N/A, *requires*: pytest; extra == "test" @@ -12991,7 +13024,7 @@ This list contains 1723 plugins. A twisted plugin for pytest. :pypi:`pytest-ty` - *last release*: Jun 25, 2025, + *last release*: Oct 10, 2025, *status*: 3 - Alpha, *requires*: pytest>=7.0.0 @@ -13242,6 +13275,13 @@ This list contains 1723 plugins. More descriptive output for parametrized py.test tests + :pypi:`pytest-verify` + *last release*: Oct 11, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=7.0 + + A pytest plugin for snapshot verification with optional visual diff viewer. + :pypi:`pytest-vimqf` *last release*: Feb 08, 2021, *status*: 4 - Beta, From 44e9309c8cee525014f93b6b3ba8b77900e58483 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 12 Oct 2025 16:33:40 +0300 Subject: [PATCH 159/270] config: set `__module__ = "pytest"` on `UsageError` and `ExitCode` These types occasionally get displayed by their qualified name, let's make it nicer using the user-facing path. --- src/_pytest/config/__init__.py | 2 ++ src/_pytest/config/exceptions.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index afa7e25d84a..8d9282ab37b 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -110,6 +110,8 @@ class ExitCode(enum.IntEnum): #: pytest couldn't find tests. NO_TESTS_COLLECTED = 5 + __module__ = "pytest" + class ConftestImportFailure(Exception): def __init__( diff --git a/src/_pytest/config/exceptions.py b/src/_pytest/config/exceptions.py index 90108eca904..d84a9ea67e0 100644 --- a/src/_pytest/config/exceptions.py +++ b/src/_pytest/config/exceptions.py @@ -7,6 +7,8 @@ class UsageError(Exception): """Error in pytest usage or invocation.""" + __module__ = "pytest" + class PrintHelp(Exception): """Raised when pytest should print its help to skip the rest of the From 3f4e668de4e29c14a3af3e46daf7eb23eb40a7f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 03:05:55 +0000 Subject: [PATCH 160/270] build(deps): Bump hynek/build-and-inspect-python-package Bumps [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package) from 2.13.0 to 2.14.0. - [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases) - [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md) - [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/c52c3a4710070b50470d903818a7b25115dcd076...efb823f52190ad02594531168b7a2d5790e66516) --- updated-dependencies: - dependency-name: hynek/build-and-inspect-python-package dependency-version: 2.14.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7be666f3a39..00d7b4125a1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,7 +31,7 @@ jobs: persist-credentials: false - name: Build and Check Package - uses: hynek/build-and-inspect-python-package@c52c3a4710070b50470d903818a7b25115dcd076 + uses: hynek/build-and-inspect-python-package@efb823f52190ad02594531168b7a2d5790e66516 with: attest-build-provenance-github: 'true' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61125eb2761..6b27572aae0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,7 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Build and Check Package - uses: hynek/build-and-inspect-python-package@c52c3a4710070b50470d903818a7b25115dcd076 + uses: hynek/build-and-inspect-python-package@efb823f52190ad02594531168b7a2d5790e66516 build: needs: [package] From 9d74e035e44befe2c550c1ff982608a5ab9b8e82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 07:08:14 +0200 Subject: [PATCH 161/270] build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#13805) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 16.0.1 to 16.1. - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/16.0.1...16.1) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-version: '16.1' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 1f958931379..1e808409c46 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -7,7 +7,7 @@ pytest-django==4.11.1 pytest-flakes==4.0.5 pytest-html==4.1.1 pytest-mock==3.15.1 -pytest-rerunfailures==16.0.1 +pytest-rerunfailures==16.1 pytest-sugar==1.1.1 pytest-trio==0.8.0 pytest-twisted==1.14.3 From 8fb067f9329e0a9fd94293b538c2c27c040c0b09 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 13 Oct 2025 08:50:57 +0300 Subject: [PATCH 162/270] monkeypatch: deprecate call to `fixup_namespace_packages` in `syspath_prepend` Fix #13807. --- changelog/13807.deprecation.rst | 3 +++ doc/en/deprecations.rst | 35 +++++++++++++++++++++++++++++++++ src/_pytest/deprecated.py | 8 ++++++++ src/_pytest/monkeypatch.py | 20 +++++++++++++++++++ testing/test_monkeypatch.py | 25 +++++++++++++++-------- 5 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 changelog/13807.deprecation.rst diff --git a/changelog/13807.deprecation.rst b/changelog/13807.deprecation.rst new file mode 100644 index 00000000000..59bd62214e1 --- /dev/null +++ b/changelog/13807.deprecation.rst @@ -0,0 +1,3 @@ +: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/doc/en/deprecations.rst b/doc/en/deprecations.rst index 6897fb28fc1..e129dd931a9 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -15,6 +15,41 @@ Below is a complete list of all pytest features which are considered deprecated. :class:`~pytest.PytestWarning` or subclasses, which can be filtered using :ref:`standard warning filters `. +.. _monkeypatch-fixup-namespace-packages: + +``monkeypatch.syspath_prepend`` with legacy namespace packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 9.0 + +When using :meth:`monkeypatch.syspath_prepend() `, +pytest automatically calls ``pkg_resources.fixup_namespace_packages()`` if ``pkg_resources`` is imported. +This is only needed for legacy namespace packages that use ``pkg_resources.declare_namespace()``. + +Legacy namespace packages are deprecated in favor of native namespace packages (:pep:`420`). +If you are using ``pkg_resources.declare_namespace()`` in your ``__init__.py`` files, +you should migrate to native namespace packages by removing the ``__init__.py`` files from your namespace packages. + +This deprecation warning will only be issued when: + +1. ``pkg_resources`` is imported, and +2. The specific path being prepended contains a declared namespace package (via ``pkg_resources.declare_namespace()``) + +To fix this warning, convert your legacy namespace packages to native namespace packages: + +**Legacy namespace package** (deprecated): + +.. code-block:: python + + # mypkg/__init__.py + __import__("pkg_resources").declare_namespace(__name__) + +**Native namespace package** (recommended): + +Simply remove the ``__init__.py`` file entirely. +Python 3.3+ natively supports namespace packages without ``__init__.py``. + + .. _sync-test-async-fixture: sync test depending on async fixture diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 24e6462506b..60540552401 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -15,6 +15,7 @@ from _pytest.warning_types import PytestDeprecationWarning from _pytest.warning_types import PytestRemovedIn9Warning +from _pytest.warning_types import PytestRemovedIn10Warning from _pytest.warning_types import UnformattedWarning @@ -66,6 +67,13 @@ "See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function" ) +MONKEYPATCH_LEGACY_NAMESPACE_PACKAGES = PytestRemovedIn10Warning( + "monkeypatch.syspath_prepend() called with pkg_resources legacy namespace packages detected.\n" + "Legacy namespace packages (using pkg_resources.declare_namespace) are deprecated.\n" + "Please use native namespace packages (PEP 420) instead.\n" + "See https://docs.pytest.org/en/stable/deprecations.html#monkeypatch-fixup-namespace-packages" +) + # You want to make some `__init__` or function "private". # # def my_private_function(some, args): diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 1285e571551..07cc3fc4b0f 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from contextlib import contextmanager import os +from pathlib import Path import re import sys from typing import Any @@ -16,6 +17,7 @@ from typing import TypeVar import warnings +from _pytest.deprecated import MONKEYPATCH_LEGACY_NAMESPACE_PACKAGES from _pytest.fixtures import fixture from _pytest.warning_types import PytestWarning @@ -346,8 +348,26 @@ def syspath_prepend(self, path) -> None: # https://github.com/pypa/setuptools/blob/d8b901bc/docs/pkg_resources.txt#L162-L171 # this is only needed when pkg_resources was already loaded by the namespace package if "pkg_resources" in sys.modules: + import pkg_resources from pkg_resources import fixup_namespace_packages + # Only issue deprecation warning if this call would actually have an + # effect for this specific path. + if ( + hasattr(pkg_resources, "_namespace_packages") + and pkg_resources._namespace_packages + ): + path_obj = Path(str(path)) + for ns_pkg in pkg_resources._namespace_packages: + if ns_pkg is None: + continue + ns_pkg_path = path_obj / ns_pkg.replace(".", os.sep) + if ns_pkg_path.is_dir(): + warnings.warn( + MONKEYPATCH_LEGACY_NAMESPACE_PACKAGES, stacklevel=2 + ) + break + fixup_namespace_packages(str(path)) # A call to syspathinsert() usually means that the caller wants to diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py index edf3169bed5..c321439e398 100644 --- a/testing/test_monkeypatch.py +++ b/testing/test_monkeypatch.py @@ -7,8 +7,7 @@ import re import sys import textwrap - -import setuptools +import warnings from _pytest.monkeypatch import MonkeyPatch from _pytest.pytester import Pytester @@ -430,14 +429,16 @@ class A: assert A.x == 1 -@pytest.mark.filterwarnings(r"ignore:.*\bpkg_resources\b:DeprecationWarning") -@pytest.mark.skipif( - int(setuptools.__version__.split(".")[0]) >= 80, - reason="modern setuptools removing pkg_resources", +@pytest.mark.filterwarnings( + r"ignore:.*\bpkg_resources\b:DeprecationWarning", + r"ignore:.*\bpkg_resources\b:UserWarning", ) def test_syspath_prepend_with_namespace_packages( pytester: Pytester, monkeypatch: MonkeyPatch ) -> None: + # Needs to be in sys.modules. + pytest.importorskip("pkg_resources") + for dirname in "hello", "world": d = pytester.mkdir(dirname) ns = d.joinpath("ns_pkg") @@ -451,7 +452,9 @@ def test_syspath_prepend_with_namespace_packages( f"def check(): return {dirname!r}", encoding="utf-8" ) + # First call should not warn - namespace package not registered yet. monkeypatch.syspath_prepend("hello") + # This registers ns_pkg as a namespace package. import ns_pkg.hello assert ns_pkg.hello.check() == "hello" @@ -460,13 +463,19 @@ def test_syspath_prepend_with_namespace_packages( import ns_pkg.world # Prepending should call fixup_namespace_packages. - monkeypatch.syspath_prepend("world") + # This call should warn - ns_pkg is now registered and "world" contains it + with pytest.warns(pytest.PytestRemovedIn10Warning, match="legacy namespace"): + monkeypatch.syspath_prepend("world") import ns_pkg.world assert ns_pkg.world.check() == "world" # Should invalidate caches via importlib.invalidate_caches. + # Should not warn for path without namespace packages. modules_tmpdir = pytester.mkdir("modules_tmpdir") - monkeypatch.syspath_prepend(str(modules_tmpdir)) + with warnings.catch_warnings(): + warnings.simplefilter("error") + monkeypatch.syspath_prepend(str(modules_tmpdir)) + modules_tmpdir.joinpath("main_app.py").write_text("app = True", encoding="utf-8") from main_app import app # noqa: F401 From 6cd48aa23a30a3016294d72fb91d6f4a0e86cdab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 21:06:59 +0000 Subject: [PATCH 163/270] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.13.3 → v0.14.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.13.3...v0.14.0) - [github.com/tox-dev/pyproject-fmt: v2.7.0 → v2.10.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.7.0...v2.10.0) - [github.com/asottile/pyupgrade: v3.20.0 → v3.21.0](https://github.com/asottile/pyupgrade/compare/v3.20.0...v3.21.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2aa0069f62..fa12f0ebd84 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.13.3" + rev: "v0.14.0" hooks: - id: ruff-check args: ["--fix"] @@ -66,13 +66,13 @@ repos: # Manual because passing pyright is a work in progress. stages: [manual] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.7.0" + rev: "v2.10.0" hooks: - id: pyproject-fmt # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version additional_dependencies: ["tox>=4.9"] - repo: https://github.com/asottile/pyupgrade - rev: v3.20.0 + rev: v3.21.0 hooks: - id: pyupgrade args: From ae648b361b0ea5f656196ecefa7ba87d7edb0827 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 14 Oct 2025 09:12:10 +0300 Subject: [PATCH 164/270] config: `freeze_support` is not a plugin, remove from `default_plugins` There is no need to inspect this module as a plugin, it only contains an API function. --- src/_pytest/config/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 8d9282ab37b..4df15c4db7f 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -269,7 +269,6 @@ def directory_arg(path: str, optname: str) -> str: "junitxml", "doctest", "cacheprovider", - "freeze_support", "setuponly", "setupplan", "stepwise", From eed1f8093ae5557887d10c1bbc7c96a859df6cf1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 Oct 2025 09:48:41 +0200 Subject: [PATCH 165/270] [automated] Update plugin list (#13827) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 192 ++++++++++++++++++------------- 1 file changed, 112 insertions(+), 80 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index b3e2cafffbc..60a12ad8ada 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,14 +27,14 @@ please refer to `the update script =8.3 + :pypi:`databricks-labs-pytester` Python Testing for Databricks Oct 17, 2025 4 - Beta pytest>=8.3 :pypi:`logassert` Simple but powerful assertion and verification of logged lines Aug 14, 2025 5 - Production/Stable pytest; extra == "dev" :pypi:`logot` Test whether your code is logging correctly 🪵 Jul 28, 2025 5 - Production/Stable pytest; extra == "pytest" :pypi:`nuts` Network Unit Testing System May 10, 2025 N/A pytest<8,>=7 @@ -95,7 +95,7 @@ This list contains 1728 plugins. :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-api-cov` Pytest Plugin to provide API Coverage statistics for Python Web Frameworks Sep 11, 2025 N/A pytest>=6.0.0 :pypi:`pytest-api-framework` pytest framework Jun 22, 2025 N/A pytest==7.2.2 - :pypi:`pytest-api-framework-alpha` Sep 28, 2025 N/A pytest==7.2.2 + :pypi:`pytest-api-framework-alpha` Oct 14, 2025 N/A pytest==7.2.2 :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-apiver` Jun 21, 2024 N/A pytest @@ -114,6 +114,7 @@ This list contains 1728 plugins. :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A :pypi:`pytest-assertcount` Plugin to count actual number of asserts in pytest Oct 23, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A + :pypi:`pytest-assert-type` Use typing.assert_type() to test runtime behavior Oct 14, 2025 3 - Alpha pytest>=6.2.0 :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A :pypi:`pytest-assist` load testing library Mar 17, 2025 N/A pytest @@ -169,12 +170,13 @@ This list contains 1728 plugins. :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Nov 22, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) :pypi:`pytest-bdd-ng` BDD for pytest Nov 26, 2024 4 - Beta pytest>=5.2 :pypi:`pytest-bdd-report` A pytest-bdd plugin for generating useful and informative BDD test reports Aug 19, 2025 N/A pytest>=7.1.3 + :pypi:`pytest-bdd-reporter` Enterprise-grade BDD test reporting with interactive dashboards, suite management, and comprehensive email integration Oct 14, 2025 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Oct 09, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Oct 15, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -336,7 +338,7 @@ This list contains 1728 plugins. :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cratedb` Manage CrateDB instances for integration tests Oct 08, 2024 4 - Beta pytest<9 :pypi:`pytest-cratedb-reporter` A pytest plugin for reporting test results to CrateDB Mar 11, 2025 N/A pytest>=6.0.0 - :pypi:`pytest-crayons` A pytest plugin for colorful print statements Oct 08, 2023 N/A pytest + :pypi:`pytest-crayons` A pytest plugin for colorful print statements Oct 14, 2025 5 - Production/Stable pytest :pypi:`pytest-create` pytest-create Feb 15, 2023 1 - Planning N/A :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A @@ -370,7 +372,7 @@ This list contains 1728 plugins. :pypi:`pytest-datafixtures` Data fixtures for pytest made simple. May 15, 2025 5 - Production/Stable N/A :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataguard` Data validation and integrity testing for your datasets using pytest. Oct 08, 2025 N/A pytest>=8.4.2 - :pypi:`pytest-data-loader` Pytest plugin for loading test data for data-driven testing (DDT) Oct 10, 2025 4 - Beta pytest<9,>=7.0.0 + :pypi:`pytest-data-loader` Pytest plugin for loading test data for data-driven testing (DDT) Oct 16, 2025 4 - Beta pytest<9,>=7.0.0 :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Jul 31, 2024 5 - Production/Stable pytest :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Sep 01, 2023 5 - Production/Stable N/A @@ -470,7 +472,7 @@ This list contains 1728 plugins. :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) :pypi:`pytest-doctest-mkdocstrings` Run pytest --doctest-modules with markdown docstrings in code blocks (\`\`\`) Mar 02, 2024 N/A pytest :pypi:`pytest-doctest-only` A plugin to run only doctest Jul 30, 2025 4 - Beta pytest>=8.3.0 - :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Jan 25, 2025 5 - Production/Stable pytest>=4.6 + :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Oct 18, 2025 5 - Production/Stable pytest>=4.6 :pypi:`pytest-documentary` A simple pytest plugin to generate test documentation Jul 11, 2024 N/A pytest :pypi:`pytest-dogu-report` pytest plugin for dogu report Jul 07, 2023 N/A N/A :pypi:`pytest-dogu-sdk` pytest plugin for the Dogu Dec 14, 2023 N/A N/A @@ -496,7 +498,7 @@ This list contains 1728 plugins. :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jul 15, 2024 N/A N/A :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Aug 29, 2025 5 - Production/Stable pytest>=4.6 - :pypi:`pytest-dynamic-parameterize` A Python package for managing pytest plugins. Sep 14, 2025 N/A pytest + :pypi:`pytest-dynamic-parameterize` A Python package for managing pytest plugins. Oct 14, 2025 N/A pytest :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Apr 04, 2025 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A @@ -514,15 +516,15 @@ This list contains 1728 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Sep 25, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Sep 25, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Sep 25, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Sep 25, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Sep 25, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Sep 25, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Sep 25, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Sep 25, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Sep 25, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Oct 16, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Oct 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Oct 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Oct 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Oct 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Oct 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Oct 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Oct 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Oct 16, 2025 5 - Production/Stable N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 09, 2023 4 - Beta pytest (==7.0.1) @@ -555,7 +557,7 @@ This list contains 1728 plugins. :pypi:`pytest_evm` The testing package containing tools to test Web3-based projects Sep 23, 2024 4 - Beta pytest<9.0.0,>=8.1.1 :pypi:`pytest_exact_fixtures` Parse queries in Lucene and Elasticsearch syntaxes Feb 04, 2019 N/A N/A :pypi:`pytest-examples` Pytest plugin for testing examples in docstrings and markdown files. May 06, 2025 N/A pytest>=7 - :pypi:`pytest-exasol-backend` Jul 21, 2025 N/A pytest<9,>=7 + :pypi:`pytest-exasol-backend` Oct 13, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-extension` Jun 13, 2025 N/A pytest<9,>=7 :pypi:`pytest-exasol-itde` Nov 22, 2024 N/A pytest<9,>=7 :pypi:`pytest-exasol-saas` Nov 22, 2024 N/A pytest<9,>=7 @@ -617,7 +619,7 @@ This list contains 1728 plugins. :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` Feb 28, 2025 N/A N/A :pypi:`pytest-fixturecheck` A pytest plugin to check fixture validity before test execution Jun 02, 2025 3 - Alpha pytest>=6.0.0 - :pypi:`pytest-fixture-classes` Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers Sep 02, 2023 5 - Production/Stable pytest + :pypi:`pytest-fixture-classes` Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers Oct 12, 2025 5 - Production/Stable N/A :pypi:`pytest-fixture-collect` A utility to collect pytest fixture file paths. Jul 25, 2025 N/A pytest; extra == "test" :pypi:`pytest-fixturecollection` A pytest plugin to collect tests based on fixtures being used by tests Feb 22, 2024 4 - Beta pytest >=3.5.0 :pypi:`pytest-fixture-config` Fixture configuration utils for py.test Oct 17, 2024 5 - Production/Stable pytest @@ -656,7 +658,7 @@ This list contains 1728 plugins. :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A :pypi:`pytest-frappe` Pytest Frappe Plugin - A set of pytest fixtures to test Frappe applications Jul 30, 2024 4 - Beta pytest>=7.0.0 :pypi:`pytest-freethreaded` pytest plugin for running parallel tests Oct 03, 2024 5 - Production/Stable pytest - :pypi:`pytest-freezeblaster` Wrap tests with fixtures in freeze_time Jun 02, 2025 N/A pytest>=6.2.5 + :pypi:`pytest-freezeblaster` Wrap tests with fixtures in freeze_time Oct 13, 2025 N/A pytest>=6.2.5 :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-freezer` Pytest plugin providing a fixture interface for spulec/freezegun Dec 12, 2024 N/A pytest>=3.6 :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A @@ -675,14 +677,14 @@ This list contains 1728 plugins. :pypi:`pytest-gc` The garbage collector plugin for py.test Feb 01, 2018 N/A N/A :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A :pypi:`pytest-gcs` GCS fixtures and fixture factories for Pytest. Jan 24, 2025 5 - Production/Stable pytest>=6.2 - :pypi:`pytest-gee` The Python plugin for your GEE based packages. May 11, 2025 3 - Alpha pytest + :pypi:`pytest-gee` The Python plugin for your GEE based packages. Oct 16, 2025 3 - Alpha pytest :pypi:`pytest-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Sep 30, 2025 N/A pytest>=3.6 :pypi:`pytest-git` Git repository fixture for py.test Oct 17, 2024 5 - Production/Stable pytest - :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Aug 11, 2024 4 - Beta pytest>=7.1.2 + :pypi:`pytest-gitconfig` Provide a Git config sandbox for testing Oct 12, 2025 4 - Beta pytest>=7.1.2 :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-diff` Pytest plugin that allows the user to select the tests affected by a range of git commits Apr 02, 2024 N/A N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -706,7 +708,7 @@ This list contains 1728 plugins. :pypi:`pytest-gradescope` A pytest plugin for Gradescope integration Apr 29, 2025 N/A N/A :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A - :pypi:`pytest-greener` Pytest plugin for Greener Oct 05, 2025 N/A pytest<9.0.0,>=8.3.3 + :pypi:`pytest-greener` Pytest plugin for Greener Oct 18, 2025 N/A pytest<9.0.0,>=8.3.3 :pypi:`pytest-group-by-class` A Pytest plugin for running a subset of your tests by splitting them in to groups of classes. Jun 27, 2023 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) @@ -730,7 +732,7 @@ This list contains 1728 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 11, 2025 3 - Alpha pytest==8.4.2 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 18, 2025 3 - Alpha pytest==8.4.2 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -791,7 +793,7 @@ This list contains 1728 plugins. :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A :pypi:`pytest-info-plugin` Get executed interface information in pytest interface automation framework Sep 14, 2023 N/A N/A :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A - :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Oct 11, 2025 4 - Beta pytest~=8.3 + :pypi:`pytest-infrahouse` A set of fixtures to use with pytest Oct 13, 2025 4 - Beta pytest~=8.3 :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-initry` Plugin for sending automation test data from Pytest to the initry Apr 30, 2024 N/A pytest<9.0.0,>=8.1.1 @@ -819,7 +821,7 @@ This list contains 1728 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest - :pypi:`pytest-ipywidgets` Aug 20, 2025 N/A pytest + :pypi:`pytest-ipywidgets` Oct 17, 2025 N/A pytest :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Sep 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 :pypi:`pytest-isort` py.test plugin to check import ordering using isort Mar 05, 2024 5 - Production/Stable pytest (>=5.0) @@ -850,7 +852,7 @@ This list contains 1728 plugins. :pypi:`pytest-jtr` pytest plugin supporting json test report output Jul 21, 2024 N/A pytest<8.0.0,>=7.1.2 :pypi:`pytest-jubilant` Add your description here Jul 28, 2025 N/A pytest>=8.3.5 :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest - :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Apr 04, 2024 4 - Beta pytest>=7.0 + :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Oct 16, 2025 4 - Beta pytest>=7.0 :pypi:`pytest-jupyterhub` A reusable JupyterHub pytest plugin Apr 25, 2023 5 - Production/Stable pytest :pypi:`pytest-k8s` Kubernetes-based testing for pytest Jul 07, 2025 N/A pytest>=8.4.1 :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 14, 2024 N/A pytest @@ -886,7 +888,7 @@ This list contains 1728 plugins. :pypi:`pytest-leaping` A simple plugin to use with pytest Mar 27, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-leo-interface` Pytest extension tool for leo projects. Mar 19, 2025 N/A N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest - :pypi:`pytest-lf-skip` A pytest plugin which makes \`--last-failed\` skip instead of deselect tests. May 26, 2025 4 - Beta pytest>=8.3.5 + :pypi:`pytest-lf-skip` A pytest plugin which makes \`--last-failed\` skip instead of deselect tests. Oct 14, 2025 4 - Beta pytest>=8.3.5 :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest Apr 12, 2024 4 - Beta pytest>=3.0.0 :pypi:`pytest-libiio` A pytest plugin for testing libiio based devices Aug 15, 2025 N/A pytest>=3.5.0 :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest @@ -958,7 +960,7 @@ This list contains 1728 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Aug 18, 2025 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Oct 07, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Oct 16, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -967,7 +969,7 @@ This list contains 1728 plugins. :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mfd-config` Pytest Plugin that handles test and topology configs and all their belongings like helper fixtures. Jul 11, 2025 N/A pytest<9,>=7.2.1 :pypi:`pytest-mfd-logging` Module for handling PyTest logging. Jul 09, 2025 N/A pytest<9,>=7.2.1 - :pypi:`pytest-mh` Pytest multihost plugin Sep 25, 2025 N/A pytest + :pypi:`pytest-mh` Pytest multihost plugin Oct 16, 2025 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-mimic` Easily record function calls while testing Apr 24, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) @@ -1040,7 +1042,7 @@ This list contains 1728 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Oct 08, 2025 N/A pytest<9.0.0,>=8.2.0 + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Oct 16, 2025 N/A pytest<9.0.0,>=8.2.0 :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest_nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Aug 05, 2024 N/A N/A @@ -1048,7 +1050,7 @@ This list contains 1728 plugins. :pypi:`pytest-node-dependency` pytest plugin for controlling execution flow Apr 10, 2024 5 - Production/Stable N/A :pypi:`pytest-nodev` Test-driven source code search for Python. Jul 21, 2016 4 - Beta pytest (>=2.8.1) :pypi:`pytest-nogarbage` Ensure a test produces no garbage Feb 24, 2025 5 - Production/Stable pytest>=4.6.0 - :pypi:`pytest-no-problem` Pytest plugin to tell you when there's no problem Apr 05, 2025 N/A pytest>=7.0 + :pypi:`pytest-no-problem` Pytest plugin to tell you when there's no problem Oct 18, 2025 N/A pytest>=7.0 :pypi:`pytest-nose-attrib` pytest plugin to use nose @attrib marks decorators and pick tests based on attributes and partially uses nose-attrib plugin approach Aug 13, 2023 N/A N/A :pypi:`pytest_notebook` A pytest plugin for testing Jupyter Notebooks. Nov 28, 2023 4 - Beta pytest>=3.5.0 :pypi:`pytest-notice` Send pytest execution result email Nov 05, 2020 N/A N/A @@ -1059,7 +1061,7 @@ This list contains 1728 plugins. :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Feb 26, 2024 5 - Production/Stable N/A :pypi:`pytest-oar` PyTest plugin for the OAR testing framework May 12, 2025 N/A pytest>=6.0.1 - :pypi:`pytest-oarepo` Oct 02, 2025 N/A pytest>=7.1.2; extra == "base" + :pypi:`pytest-oarepo` Oct 14, 2025 N/A pytest>=7.1.2; extra == "dev" :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odc` A pytest plugin for simplifying ODC database tests Aug 04, 2023 4 - Beta pytest (>=3.5.0) @@ -1158,7 +1160,7 @@ This list contains 1728 plugins. :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Oct 10, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Oct 14, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1191,6 +1193,7 @@ This list contains 1728 plugins. :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Sep 27, 2022 5 - Production/Stable pytest :pypi:`pytest-prometheus-pushgw` Pytest plugin to export test metrics to Prometheus Pushgateway May 19, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-proofy` Pytest plugin for Proofy test reporting Oct 17, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-prysk` Pytest plugin for prysk Dec 10, 2024 4 - Beta pytest>=7.3.2 :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) @@ -1212,7 +1215,7 @@ This list contains 1728 plugins. :pypi:`pytest-pylint` pytest plugin to check source code with pylint Oct 06, 2023 5 - Production/Stable pytest >=7.0 :pypi:`pytest-pylyzer` A pytest plugin for pylyzer Feb 15, 2025 4 - Beta N/A :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A - :pypi:`pytest-pyodide` Pytest plugin for testing applications that use Pyodide Jun 12, 2025 N/A pytest + :pypi:`pytest-pyodide` Pytest plugin for testing applications that use Pyodide Oct 18, 2025 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1378,7 +1381,7 @@ This list contains 1728 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Oct 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Oct 17, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. Sep 03, 2025 5 - Production/Stable pytest<9,>=7.4 :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A @@ -1390,7 +1393,7 @@ This list contains 1728 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 10, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 17, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1439,6 +1442,7 @@ This list contains 1728 plugins. :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A :pypi:`pytest-smart-debugger-backend` Backend server for Pytest Smart Debugger Sep 17, 2025 N/A N/A + :pypi:`pytest-smart-rerun` A Pytest plugin for intelligent retrying of flaky tests. Oct 12, 2025 3 - Alpha N/A :pypi:`pytest-smell` Automated bad smell detection tool for Pytest Jun 26, 2022 N/A N/A :pypi:`pytest-smoke` Pytest plugin for smoke testing Oct 08, 2025 4 - Beta pytest<9,>=7.0.0 :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest @@ -1678,7 +1682,7 @@ This list contains 1728 plugins. :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Nov 23, 2023 4 - Beta pytest :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests Nov 29, 2024 5 - Production/Stable pytest - :pypi:`pytest-verify` A pytest plugin for snapshot verification with optional visual diff viewer. Oct 11, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-verify` A pytest plugin for snapshot verification with optional visual diff viewer. Oct 12, 2025 5 - Production/Stable pytest>=7.0 :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test Nov 29, 2024 5 - Production/Stable pytest :pypi:`pytest-visual` Nov 28, 2024 4 - Beta pytest>=7.0.0 @@ -1722,7 +1726,7 @@ This list contains 1728 plugins. :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xflaky` A simple plugin to use with pytest Oct 14, 2024 4 - Beta pytest>=8.2.1 - :pypi:`pytest-xhtml` pytest plugin for generating HTML reports Aug 14, 2025 5 - Production/Stable pytest>=7 + :pypi:`pytest-xhtml` pytest plugin for generating HTML reports Oct 18, 2025 5 - Production/Stable pytest>=7 :pypi:`pytest-xiuyu` This is a pytest plugin Jul 25, 2023 5 - Production/Stable N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Aug 07, 2024 N/A pytest~=8.2.2 @@ -1768,7 +1772,7 @@ This list contains 1728 plugins. :pypi:`databricks-labs-pytester` - *last release*: Aug 07, 2025, + *last release*: Oct 17, 2025, *status*: 4 - Beta, *requires*: pytest>=8.3 @@ -2195,7 +2199,7 @@ This list contains 1728 plugins. pytest framework :pypi:`pytest-api-framework-alpha` - *last release*: Sep 28, 2025, + *last release*: Oct 14, 2025, *status*: N/A, *requires*: pytest==7.2.2 @@ -2327,6 +2331,13 @@ This list contains 1728 plugins. Pytest Assertions + :pypi:`pytest-assert-type` + *last release*: Oct 14, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=6.2.0 + + Use typing.assert_type() to test runtime behavior + :pypi:`pytest-assertutil` *last release*: May 10, 2019, *status*: N/A, @@ -2712,6 +2723,13 @@ This list contains 1728 plugins. A pytest-bdd plugin for generating useful and informative BDD test reports + :pypi:`pytest-bdd-reporter` + *last release*: Oct 14, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=6.0.0 + + Enterprise-grade BDD test reporting with interactive dashboards, suite management, and comprehensive email integration + :pypi:`pytest-bdd-splinter` *last release*: Aug 12, 2019, *status*: 5 - Production/Stable, @@ -2748,7 +2766,7 @@ This list contains 1728 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Oct 09, 2025, + *last release*: Oct 15, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -3882,8 +3900,8 @@ This list contains 1728 plugins. A pytest plugin for reporting test results to CrateDB :pypi:`pytest-crayons` - *last release*: Oct 08, 2023, - *status*: N/A, + *last release*: Oct 14, 2025, + *status*: 5 - Production/Stable, *requires*: pytest A pytest plugin for colorful print statements @@ -4120,7 +4138,7 @@ This list contains 1728 plugins. Data validation and integrity testing for your datasets using pytest. :pypi:`pytest-data-loader` - *last release*: Oct 10, 2025, + *last release*: Oct 16, 2025, *status*: 4 - Beta, *requires*: pytest<9,>=7.0.0 @@ -4820,7 +4838,7 @@ This list contains 1728 plugins. A plugin to run only doctest :pypi:`pytest-doctestplus` - *last release*: Jan 25, 2025, + *last release*: Oct 18, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=4.6 @@ -5002,7 +5020,7 @@ This list contains 1728 plugins. Pytest plugin reporting fixtures and test functions execution time. :pypi:`pytest-dynamic-parameterize` - *last release*: Sep 14, 2025, + *last release*: Oct 14, 2025, *status*: N/A, *requires*: pytest @@ -5128,63 +5146,63 @@ This list contains 1728 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-idf` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -5415,7 +5433,7 @@ This list contains 1728 plugins. Pytest plugin for testing examples in docstrings and markdown files. :pypi:`pytest-exasol-backend` - *last release*: Jul 21, 2025, + *last release*: Oct 13, 2025, *status*: N/A, *requires*: pytest<9,>=7 @@ -5849,9 +5867,9 @@ This list contains 1728 plugins. A pytest plugin to check fixture validity before test execution :pypi:`pytest-fixture-classes` - *last release*: Sep 02, 2023, + *last release*: Oct 12, 2025, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: N/A Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers @@ -6122,7 +6140,7 @@ This list contains 1728 plugins. pytest plugin for running parallel tests :pypi:`pytest-freezeblaster` - *last release*: Jun 02, 2025, + *last release*: Oct 13, 2025, *status*: N/A, *requires*: pytest>=6.2.5 @@ -6255,7 +6273,7 @@ This list contains 1728 plugins. GCS fixtures and fixture factories for Pytest. :pypi:`pytest-gee` - *last release*: May 11, 2025, + *last release*: Oct 16, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -6304,7 +6322,7 @@ This list contains 1728 plugins. Git repository fixture for py.test :pypi:`pytest-gitconfig` - *last release*: Aug 11, 2024, + *last release*: Oct 12, 2025, *status*: 4 - Beta, *requires*: pytest>=7.1.2 @@ -6472,7 +6490,7 @@ This list contains 1728 plugins. Green progress dots :pypi:`pytest-greener` - *last release*: Oct 05, 2025, + *last release*: Oct 18, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.3.3 @@ -6640,7 +6658,7 @@ This list contains 1728 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Oct 11, 2025, + *last release*: Oct 18, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.2 @@ -7067,7 +7085,7 @@ This list contains 1728 plugins. display more node ininformation. :pypi:`pytest-infrahouse` - *last release*: Oct 11, 2025, + *last release*: Oct 13, 2025, *status*: 4 - Beta, *requires*: pytest~=8.3 @@ -7263,7 +7281,7 @@ This list contains 1728 plugins. Pytest plugin to run tests in Jupyter Notebooks :pypi:`pytest-ipywidgets` - *last release*: Aug 20, 2025, + *last release*: Oct 17, 2025, *status*: N/A, *requires*: pytest @@ -7480,7 +7498,7 @@ This list contains 1728 plugins. Export test results in an augmented JUnit format for usage with Xray () :pypi:`pytest-jupyter` - *last release*: Apr 04, 2024, + *last release*: Oct 16, 2025, *status*: 4 - Beta, *requires*: pytest>=7.0 @@ -7732,7 +7750,7 @@ This list contains 1728 plugins. Select tests of a given level or lower :pypi:`pytest-lf-skip` - *last release*: May 26, 2025, + *last release*: Oct 14, 2025, *status*: 4 - Beta, *requires*: pytest>=8.3.5 @@ -8236,7 +8254,7 @@ This list contains 1728 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Oct 07, 2025, + *last release*: Oct 16, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8299,7 +8317,7 @@ This list contains 1728 plugins. Module for handling PyTest logging. :pypi:`pytest-mh` - *last release*: Sep 25, 2025, + *last release*: Oct 16, 2025, *status*: N/A, *requires*: pytest @@ -8810,7 +8828,7 @@ This list contains 1728 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Oct 08, 2025, + *last release*: Oct 16, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.2.0 @@ -8866,7 +8884,7 @@ This list contains 1728 plugins. Ensure a test produces no garbage :pypi:`pytest-no-problem` - *last release*: Apr 05, 2025, + *last release*: Oct 18, 2025, *status*: N/A, *requires*: pytest>=7.0 @@ -8943,9 +8961,9 @@ This list contains 1728 plugins. PyTest plugin for the OAR testing framework :pypi:`pytest-oarepo` - *last release*: Oct 02, 2025, + *last release*: Oct 14, 2025, *status*: N/A, - *requires*: pytest>=7.1.2; extra == "base" + *requires*: pytest>=7.1.2; extra == "dev" @@ -9636,7 +9654,7 @@ This list contains 1728 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Oct 10, 2025, + *last release*: Oct 14, 2025, *status*: N/A, *requires*: pytest @@ -9866,6 +9884,13 @@ This list contains 1728 plugins. Pytest plugin to export test metrics to Prometheus Pushgateway + :pypi:`pytest-proofy` + *last release*: Oct 17, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0.0 + + Pytest plugin for Proofy test reporting + :pypi:`pytest-prosper` *last release*: Sep 24, 2018, *status*: N/A, @@ -10014,7 +10039,7 @@ This list contains 1728 plugins. Record PyMySQL queries and mock with the stored data. :pypi:`pytest-pyodide` - *last release*: Jun 12, 2025, + *last release*: Oct 18, 2025, *status*: N/A, *requires*: pytest @@ -11176,7 +11201,7 @@ This list contains 1728 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Oct 10, 2025, + *last release*: Oct 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11260,7 +11285,7 @@ This list contains 1728 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Oct 10, 2025, + *last release*: Oct 17, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11602,6 +11627,13 @@ This list contains 1728 plugins. Backend server for Pytest Smart Debugger + :pypi:`pytest-smart-rerun` + *last release*: Oct 12, 2025, + *status*: 3 - Alpha, + *requires*: N/A + + A Pytest plugin for intelligent retrying of flaky tests. + :pypi:`pytest-smell` *last release*: Jun 26, 2022, *status*: N/A, @@ -13276,7 +13308,7 @@ This list contains 1728 plugins. More descriptive output for parametrized py.test tests :pypi:`pytest-verify` - *last release*: Oct 11, 2025, + *last release*: Oct 12, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 @@ -13584,7 +13616,7 @@ This list contains 1728 plugins. A simple plugin to use with pytest :pypi:`pytest-xhtml` - *last release*: Aug 14, 2025, + *last release*: Oct 18, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7 From 526288bcb19aac64895fad59956ecf8058706118 Mon Sep 17 00:00:00 2001 From: Omri Golan Date: Fri, 26 Sep 2025 20:57:56 +0300 Subject: [PATCH 166/270] python: add `strict_parametrization_ids` option Fix #13737. --- AUTHORS | 1 + changelog/13737.feature.rst | 4 ++ doc/en/reference/reference.rst | 38 ++++++++++++++ src/_pytest/python.py | 46 ++++++++++++++++- testing/test_collection.py | 92 ++++++++++++++++++++++++++++++++++ 5 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 changelog/13737.feature.rst diff --git a/AUTHORS b/AUTHORS index 9539e8dc4f4..b28f49776d6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -346,6 +346,7 @@ Oliver Bestwalter Olivier Grisel Omar Kohl Omer Hadari +Omri Golan Ondřej Súkup Oscar Benjamin Parth Patel diff --git a/changelog/13737.feature.rst b/changelog/13737.feature.rst new file mode 100644 index 00000000000..e7fe7fd3ab7 --- /dev/null +++ b/changelog/13737.feature.rst @@ -0,0 +1,4 @@ +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/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index a2d275fdcfe..3dfa11901ea 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -2082,6 +2082,44 @@ passed multiple times. The expected format is ``name=value``. For example:: [pytest] xfail_strict = True +.. confval:: strict_parametrization_ids + + If set, pytest emits an error if it detects non-unique parameter set IDs. + + If not set (the default), pytest automatically handles this by adding `0`, `1`, ... to duplicate IDs, + making them unique. + + .. code-block:: ini + + [pytest] + strict_parametrization_ids = True + + For example, + + .. code-block:: python + + import pytest + + + @pytest.mark.parametrize("letter", ["a", "a"]) + def test_letter_is_ascii(letter): + assert letter.isascii() + + will emit an error because both cases (parameter sets) have the same auto-generated ID "a". + + To fix the error, if you decide to keep the duplicates, explicitly assign unique IDs: + + .. code-block:: python + + import pytest + + + @pytest.mark.parametrize("letter", ["a", "a"], ids=["a0", "a1"]) + def test_letter_is_ascii(letter): + assert letter.isascii() + + See :func:`parametrize ` and :func:`pytest.param` for other ways to set IDs. + .. _`command-line-flags`: diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 3f9da026799..4dbf1cc8775 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -21,6 +21,7 @@ import os from pathlib import Path import re +import textwrap import types from typing import Any from typing import final @@ -107,6 +108,12 @@ def pytest_addoption(parser: Parser) -> None: help="Disable string escape non-ASCII characters, might cause unwanted " "side effects(use at your own risk)", ) + parser.addini( + "strict_parametrization_ids", + type="bool", + default=False, + help="Emit an error if non-unique parameter set IDs are detected", + ) def pytest_generate_tests(metafunc: Metafunc) -> None: @@ -878,8 +885,8 @@ class IdMaker: # Optionally, explicit IDs for ParameterSets by index. ids: Sequence[object | None] | None # Optionally, the pytest config. - # Used for controlling ASCII escaping, and for calling the - # :hook:`pytest_make_parametrize_id` hook. + # Used for controlling ASCII escaping, determining parametrization ID + # strictness, and for calling the :hook:`pytest_make_parametrize_id` hook. config: Config | None # Optionally, the ID of the node being parametrized. # Used only for clearer error messages. @@ -892,6 +899,9 @@ def make_unique_parameterset_ids(self) -> list[str | _HiddenParam]: """Make a unique identifier for each ParameterSet, that may be used to identify the parametrization in a node ID. + If strict_parametrization_ids is enabled, and duplicates are detected, + raises CollectError. Otherwise makes the IDs unique as follows: + Format is -...-[counter], where prm_x_token is - user-provided id, if given - else an id derived from the value, applicable for certain types @@ -904,6 +914,33 @@ def make_unique_parameterset_ids(self) -> list[str | _HiddenParam]: if len(resolved_ids) != len(set(resolved_ids)): # Record the number of occurrences of each ID. id_counts = Counter(resolved_ids) + + if self._strict_parametrization_ids_enabled(): + parameters = ", ".join(self.argnames) + parametersets = ", ".join( + [saferepr(list(param.values)) for param in self.parametersets] + ) + ids = ", ".join( + id if id is not HIDDEN_PARAM else "" for id in resolved_ids + ) + duplicates = ", ".join( + id if id is not HIDDEN_PARAM else "" + for id, count in id_counts.items() + if count > 1 + ) + msg = textwrap.dedent(f""" + Duplicate parametrization IDs detected, but strict_parametrization_ids is set. + + Test name: {self.nodeid} + Parameters: {parameters} + Parameter sets: {parametersets} + IDs: {ids} + Duplicates: {duplicates} + + You can fix this problem using `@pytest.mark.parametrize(..., ids=...)` or `pytest.param(..., id=...)`. + """).strip() # noqa: E501 + raise nodes.Collector.CollectError(msg) + # Map the ID to its next suffix. id_suffixes: dict[str, int] = defaultdict(int) # Suffix non-unique IDs to make them unique. @@ -925,6 +962,11 @@ def make_unique_parameterset_ids(self) -> list[str | _HiddenParam]: ) return resolved_ids + def _strict_parametrization_ids_enabled(self) -> bool: + if self.config: + return bool(self.config.getini("strict_parametrization_ids")) + return False + def _resolve_ids(self) -> Iterable[str | _HiddenParam]: """Resolve IDs for all ParameterSets (may contain duplicates).""" for idx, parameterset in enumerate(self.parametersets): diff --git a/testing/test_collection.py b/testing/test_collection.py index 40568a9bdf4..153811dea3e 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1,6 +1,7 @@ # mypy: allow-untyped-defs from __future__ import annotations +from collections.abc import Sequence import os from pathlib import Path from pathlib import PurePath @@ -2702,3 +2703,94 @@ def test_1(): pass ], consecutive=True, ) + + +@pytest.mark.parametrize( + ["x_y", "expected_duplicates"], + [ + ( + [(1, 1), (1, 1)], + ["1-1"], + ), + ( + [(1, 1), (1, 2), (1, 1)], + ["1-1"], + ), + ( + [(1, 1), (2, 2), (1, 1)], + ["1-1"], + ), + ( + [(1, 1), (2, 2), (1, 2), (2, 1), (1, 1), (2, 1)], + ["1-1", "2-1"], + ), + ], +) +def test_strict_parametrization_ids( + pytester: Pytester, + x_y: Sequence[tuple[int, int]], + expected_duplicates: Sequence[str], +) -> None: + pytester.makeini( + """ + [pytest] + strict_parametrization_ids = true + """ + ) + pytester.makepyfile( + f""" + import pytest + + @pytest.mark.parametrize(["x", "y"], {x_y}) + def test1(x, y): + pass + """ + ) + + result = pytester.runpytest() + + assert result.ret == ExitCode.INTERRUPTED + expected_parametersets = ", ".join(str(list(p)) for p in x_y) + expected_ids = ", ".join(f"{x}-{y}" for x, y in x_y) + result.stdout.fnmatch_lines( + [ + "Duplicate parametrization IDs detected*", + "", + "Test name: *::test1", + "Parameters: x, y", + f"Parameter sets: {expected_parametersets}", + f"IDs: {expected_ids}", + f"Duplicates: {', '.join(expected_duplicates)}", + "", + "You can fix this problem using *", + ] + ) + + +def test_strict_parametrization_ids_with_hidden_param(pytester: Pytester) -> None: + pytester.makeini( + """ + [pytest] + strict_parametrization_ids = true + """ + ) + pytester.makepyfile( + """ + import pytest + + @pytest.mark.parametrize(["x"], ["a", pytest.param("a", id=pytest.HIDDEN_PARAM), "a"]) + def test1(x): + pass + """ + ) + + result = pytester.runpytest() + + assert result.ret == ExitCode.INTERRUPTED + result.stdout.fnmatch_lines( + [ + "Duplicate parametrization IDs detected*", + "IDs: a, , a", + "Duplicates: a", + ] + ) From 5df54c6de87497fe8ff3a8b5e8c7b3a45411ee48 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 18 Oct 2025 19:47:10 +0300 Subject: [PATCH 167/270] testing: enable strict_parametrization_ids and fix problems --- pyproject.toml | 1 + testing/_py/test_local.py | 2 +- testing/test_doctest.py | 9 ++++++++- testing/test_mark_expression.py | 1 - 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 091676409ed..964c4f449dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -379,6 +379,7 @@ norecursedirs = [ "dist", ] xfail_strict = true +strict_parametrization_ids = true filterwarnings = [ "error", "default:Using or importing the ABCs:DeprecationWarning:unittest2.*", diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index 673ce9b3de6..e7301c273e0 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -209,7 +209,7 @@ def test_visit_norecurse(self, path1): @pytest.mark.parametrize( "fil", - ["*dir", "*dir", pytest.mark.skip("sys.version_info < (3,6)")(b"*dir")], + ["*dir", pytest.mark.skip("sys.version_info < (3,6)")(b"*dir")], ) def test_visit_filterfunc_is_string(self, path1, fil): lst = [] diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 415d3a24faa..e2ca1119e92 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -1596,7 +1596,14 @@ def __getattr__(self, _): @pytest.mark.parametrize( # pragma: no branch (lambdas are not called) - "stop", [None, _is_mocked, lambda f: None, lambda f: False, lambda f: True] + "stop", + [ + None, + pytest.param(_is_mocked, id="is_mocked"), + pytest.param(lambda f: None, id="lambda_none"), + pytest.param(lambda f: False, id="lambda_false"), + pytest.param(lambda f: True, id="lambda_true"), + ], ) def test_warning_on_unwrap_of_broken_object( stop: Callable[[object], object] | None, diff --git a/testing/test_mark_expression.py b/testing/test_mark_expression.py index 1b93130349b..1e3c769347c 100644 --- a/testing/test_mark_expression.py +++ b/testing/test_mark_expression.py @@ -20,7 +20,6 @@ def test_empty_is_false() -> None: @pytest.mark.parametrize( ("expr", "expected"), ( - ("true", True), ("true", True), ("false", False), ("not true", False), From e76b05426f324541fcb755eb2ecfe17796ed877f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 04:03:11 +0200 Subject: [PATCH 168/270] [pre-commit.ci] pre-commit autoupdate (#13833) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.0 → v0.14.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.0...v0.14.1) - [github.com/woodruffw/zizmor-pre-commit: v1.14.2 → v1.15.2](https://github.com/woodruffw/zizmor-pre-commit/compare/v1.14.2...v1.15.2) - [github.com/tox-dev/pyproject-fmt: v2.10.0 → v2.11.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.10.0...v2.11.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa12f0ebd84..838e1772f56 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.14.0" + rev: "v0.14.1" hooks: - id: ruff-check args: ["--fix"] @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.14.2 + rev: v1.15.2 hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs @@ -66,7 +66,7 @@ repos: # Manual because passing pyright is a work in progress. stages: [manual] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.10.0" + rev: "v2.11.0" hooks: - id: pyproject-fmt # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version From 15c2e193f22d6d7e6c78fae4b0643b710af4eb89 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 19 Oct 2025 22:50:32 +0300 Subject: [PATCH 169/270] config: apply --override-ini eagerly Currently ini overrides are handled lazily in `getini`, but I think it just complicates things and I don't see a reason to it lazily. Do it eagerly in `determine_setup` instead. --- changelog/13830.misc.rst | 1 + src/_pytest/config/__init__.py | 32 +++++--------------------------- src/_pytest/config/findpaths.py | 33 ++++++++++++++++++++++++++++++++- testing/test_config.py | 17 +++++++++++++++-- 4 files changed, 53 insertions(+), 30 deletions(-) create mode 100644 changelog/13830.misc.rst diff --git a/changelog/13830.misc.rst b/changelog/13830.misc.rst new file mode 100644 index 00000000000..0d81ce2f14f --- /dev/null +++ b/changelog/13830.misc.rst @@ -0,0 +1 @@ +Configuration overrides (``-o``/``--override-ini``) are now processed during startup rather than during :func:`config.getini() `. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 4df15c4db7f..c26455e3d8b 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1083,7 +1083,6 @@ def __init__( self.trace = self.pluginmanager.trace.root.get("config") self.hook: pluggy.HookRelay = PathAwareHookProxy(self.pluginmanager.hook) # type: ignore[assignment] self._inicache: dict[str, Any] = {} - self._override_ini: Sequence[str] = () self._opt2dest: dict[str, str] = {} self._cleanup_stack = contextlib.ExitStack() self.pluginmanager.register(self, "pytestconfig") @@ -1251,6 +1250,7 @@ def _initini(self, args: Sequence[str]) -> None: ) rootpath, inipath, inicfg, ignored_config_files = determine_setup( inifile=ns.inifilename, + override_ini=ns.override_ini, args=ns.file_or_dir + unknown_args, rootdir_cmd_arg=ns.rootdir or None, invocation_dir=self.invocation_params.dir, @@ -1272,7 +1272,6 @@ def _initini(self, args: Sequence[str]) -> None: type="args", default=[], ) - self._override_ini = ns.override_ini or () def _consider_importhook(self, args: Sequence[str]) -> None: """Install the PEP 302 import hook if using assertion rewriting. @@ -1641,14 +1640,10 @@ def _getini(self, name: str): _description, type, default = self._parser._inidict[name] except KeyError as e: raise ValueError(f"unknown configuration value: {name!r}") from e - override_value = self._get_override_ini_value(name) - if override_value is None: - try: - value = self.inicfg[name] - except KeyError: - return default - else: - value = override_value + try: + value = self.inicfg[name] + except KeyError: + return default # Coerce the values based on types. # # Note: some coercions are only required if we are reading from .ini files, because @@ -1719,23 +1714,6 @@ def _getconftest_pathlist( values.append(relroot) return values - def _get_override_ini_value(self, name: str) -> str | None: - value = None - # override_ini is a list of "ini=value" options. - # Always use the last item if multiple values are set for same ini-name, - # e.g. -o foo=bar1 -o foo=bar2 will set foo to bar2. - for ini_config in self._override_ini: - try: - key, user_ini_value = ini_config.split("=", 1) - except ValueError as e: - raise UsageError( - f"-o/--override-ini expects option=value style (got: {ini_config!r})." - ) from e - else: - if key == name: - value = user_ini_value - return value - def getoption(self, name: str, default: Any = notset, skip: bool = False): """Return command line option value. diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index 3f08c8121a9..2dea16dd0d5 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -181,12 +181,35 @@ def get_dir_from_path(path: Path) -> Path: return [get_dir_from_path(path) for path in possible_paths if safe_exists(path)] +def parse_override_ini(override_ini: Sequence[str] | None) -> dict[str, str]: + """Parse the -o/--override-ini command line arguments and return the overrides. + + :raises UsageError: + If one of the values is malformed. + """ + overrides = {} + # override_ini is a list of "ini=value" options. + # Always use the last item if multiple values are set for same ini-name, + # e.g. -o foo=bar1 -o foo=bar2 will set foo to bar2. + for ini_config in override_ini or (): + try: + key, user_ini_value = ini_config.split("=", 1) + except ValueError as e: + raise UsageError( + f"-o/--override-ini expects option=value style (got: {ini_config!r})." + ) from e + else: + overrides[key] = user_ini_value + return overrides + + CFG_PYTEST_SECTION = "[pytest] section in {filename} files is no longer supported, change to [tool:pytest] instead." def determine_setup( *, inifile: str | None, + override_ini: Sequence[str] | None, args: Sequence[str], rootdir_cmd_arg: str | None, invocation_dir: Path, @@ -196,12 +219,16 @@ def determine_setup( :param inifile: The `--inifile` command line argument, if given. + :param override_ini: + The -o/--override-ini command line arguments, if given. :param args: The free command line arguments. :param rootdir_cmd_arg: The `--rootdir` command line argument, if given. :param invocation_dir: The working directory when pytest was invoked. + + :raises UsageError: """ rootdir = None dirs = get_dirs_from_args(args) @@ -238,8 +265,12 @@ def determine_setup( raise UsageError( f"Directory '{rootdir}' not found. Check your '--rootdir' option." ) + + ini_overrides = parse_override_ini(override_ini) + inicfg.update(ini_overrides) + assert rootdir is not None - return rootdir, inipath, inicfg or {}, ignored_config_files + return rootdir, inipath, inicfg, ignored_config_files def is_fs_root(p: Path) -> bool: diff --git a/testing/test_config.py b/testing/test_config.py index 9efac8739b7..d85e95046c1 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1631,6 +1631,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: for args in ([str(tmp_path)], [str(a)], [str(b)]): rootpath, parsed_inipath, *_ = determine_setup( inifile=None, + override_ini=None, args=args, rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1639,6 +1640,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: assert parsed_inipath == inipath rootpath, parsed_inipath, ini_config, _ = determine_setup( inifile=None, + override_ini=None, args=[str(b), str(a)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1656,6 +1658,7 @@ def test_pytestini_overrides_empty_other(self, tmp_path: Path, name: str) -> Non (a / name).touch() rootpath, parsed_inipath, *_ = determine_setup( inifile=None, + override_ini=None, args=[str(a)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1670,6 +1673,7 @@ def test_setuppy_fallback(self, tmp_path: Path) -> None: (tmp_path / "setup.py").touch() rootpath, inipath, inicfg, _ = determine_setup( inifile=None, + override_ini=None, args=[str(a)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1682,6 +1686,7 @@ def test_nothing(self, tmp_path: Path, monkeypatch: MonkeyPatch) -> None: monkeypatch.chdir(tmp_path) rootpath, inipath, inicfg, _ = determine_setup( inifile=None, + override_ini=None, args=[str(tmp_path)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1709,6 +1714,7 @@ def test_with_specific_inifile( p.write_text(contents, encoding="utf-8") rootpath, inipath, ini_config, _ = determine_setup( inifile=str(p), + override_ini=None, args=[str(tmp_path)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1728,6 +1734,7 @@ def test_explicit_config_file_sets_rootdir( # No config file is explicitly given: rootdir is determined to be cwd. rootpath, found_inipath, *_ = determine_setup( inifile=None, + override_ini=None, args=[str(tests_dir)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1740,6 +1747,7 @@ def test_explicit_config_file_sets_rootdir( inipath.touch() rootpath, found_inipath, *_ = determine_setup( inifile=str(inipath), + override_ini=None, args=[str(tests_dir)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1757,6 +1765,7 @@ def test_with_arg_outside_cwd_without_inifile( b.mkdir() rootpath, inifile, *_ = determine_setup( inifile=None, + override_ini=None, args=[str(a), str(b)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1773,6 +1782,7 @@ def test_with_arg_outside_cwd_with_inifile(self, tmp_path: Path) -> None: inipath.touch() rootpath, parsed_inipath, *_ = determine_setup( inifile=None, + override_ini=None, args=[str(a), str(b)], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1787,6 +1797,7 @@ def test_with_non_dir_arg( monkeypatch.chdir(tmp_path) rootpath, inipath, *_ = determine_setup( inifile=None, + override_ini=None, args=dirs, rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1803,6 +1814,7 @@ def test_with_existing_file_in_subdir( monkeypatch.chdir(tmp_path) rootpath, inipath, *_ = determine_setup( inifile=None, + override_ini=None, args=["a/exist"], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1822,6 +1834,7 @@ def test_with_config_also_in_parent_directory( rootpath, inipath, *_ = determine_setup( inifile=None, + override_ini=None, args=["tests/"], rootdir_cmd_arg=None, invocation_dir=Path.cwd(), @@ -1978,7 +1991,7 @@ def test_addopts_before_initini( monkeypatch.setenv("PYTEST_ADDOPTS", f"-o cache_dir={cache_dir}") config = _config_for_test config._preparse([], addopts=True) - assert config._override_ini == [f"cache_dir={cache_dir}"] + assert config.inicfg.get("cache_dir") == cache_dir def test_addopts_from_env_not_concatenated( self, monkeypatch: MonkeyPatch, _config_for_test @@ -2016,7 +2029,7 @@ def test_override_ini_does_not_contain_paths( """Check that -o no longer swallows all options after it (#3103)""" config = _config_for_test config._preparse(["-o", "cache_dir=/cache", "/some/test/path"]) - assert config._override_ini == ["cache_dir=/cache"] + assert config.inicfg.get("cache_dir") == "/cache" def test_multiple_override_ini_options(self, pytester: Pytester) -> None: """Ensure a file path following a '-o' option does not generate an error (#3103)""" From 355ff095202921388061211d7a13332944191bad Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 19 Oct 2025 22:25:17 +0300 Subject: [PATCH 170/270] config: add support for ini option aliases Fix #13829. --- changelog/13829.feature.rst | 5 + src/_pytest/config/__init__.py | 40 +++++-- src/_pytest/config/argparsing.py | 17 +++ src/_pytest/config/findpaths.py | 32 ++++-- testing/test_config.py | 175 +++++++++++++++++++++++++++++-- testing/test_findpaths.py | 17 +-- 6 files changed, 253 insertions(+), 33 deletions(-) create mode 100644 changelog/13829.feature.rst diff --git a/changelog/13829.feature.rst b/changelog/13829.feature.rst new file mode 100644 index 00000000000..5f80ca5ac2f --- /dev/null +++ b/changelog/13829.feature.rst @@ -0,0 +1,5 @@ +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/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index c26455e3d8b..2af60fa9c3c 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1461,7 +1461,8 @@ def pytest_collection(self) -> Generator[None, object, object]: def _checkversion(self) -> None: import pytest - minver = self.inicfg.get("minversion", None) + minver_ini_value = self.inicfg.get("minversion", None) + minver = minver_ini_value.value if minver_ini_value is not None else None if minver: # Imported lazily to improve start-up time. from packaging.version import Version @@ -1519,9 +1520,9 @@ def _warn_or_fail_if_strict(self, message: str) -> None: self.issue_config_time_warning(PytestConfigWarning(message), stacklevel=3) - def _get_unknown_ini_keys(self) -> list[str]: - parser_inicfg = self._parser._inidict - return [name for name in self.inicfg if name not in parser_inicfg] + def _get_unknown_ini_keys(self) -> set[str]: + known_keys = self._parser._inidict.keys() | self._parser._ini_aliases.keys() + return self.inicfg.keys() - known_keys def parse(self, args: list[str], addopts: bool = True) -> None: # Parse given cmdline arguments into this config object. @@ -1621,10 +1622,11 @@ def getini(self, name: str) -> Any: :func:`parser.addini ` call (usually from a plugin), a ValueError is raised. """ + canonical_name = self._parser._ini_aliases.get(name, name) try: - return self._inicache[name] + return self._inicache[canonical_name] except KeyError: - self._inicache[name] = val = self._getini(name) + self._inicache[canonical_name] = val = self._getini(canonical_name) return val # Meant for easy monkeypatching by legacypath plugin. @@ -1636,14 +1638,32 @@ def _getini_unknown_type(self, name: str, type: str, value: object): raise ValueError(msg) # pragma: no cover def _getini(self, name: str): + # If this is an alias, resolve to canonical name. + canonical_name = self._parser._ini_aliases.get(name, name) + try: - _description, type, default = self._parser._inidict[name] + _description, type, default = self._parser._inidict[canonical_name] except KeyError as e: raise ValueError(f"unknown configuration value: {name!r}") from e - try: - value = self.inicfg[name] - except KeyError: + + # Collect all possible values (canonical name + aliases) from inicfg. + # Each candidate is (IniValue, is_canonical). + candidates = [] + if canonical_name in self.inicfg: + candidates.append((self.inicfg[canonical_name], True)) + for alias, target in self._parser._ini_aliases.items(): + if target == canonical_name and alias in self.inicfg: + candidates.append((self.inicfg[alias], False)) + + if not candidates: return default + + # Pick the best candidate based on precedence: + # 1. CLI override takes precedence over file, then + # 2. Canonical name takes precedence over alias. + ini_value = max(candidates, key=lambda x: (x[0].origin == "override", x[1]))[0] + value = ini_value.value + # Coerce the values based on types. # # Note: some coercions are only required if we are reading from .ini files, because diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 8d4ed823325..afd1892b222 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -52,6 +52,8 @@ def __init__( self._usage = usage self._inidict: dict[str, tuple[str, str | None, Any]] = {} self._ininames: list[str] = [] + # Maps alias -> canonical name. + self._ini_aliases: dict[str, str] = {} self.extra_info: dict[str, Any] = {} def processoption(self, option: Argument) -> None: @@ -179,6 +181,8 @@ def addini( ] | None = None, default: Any = NOT_SET, + *, + aliases: Sequence[str] = (), ) -> None: """Register an ini-file option. @@ -213,6 +217,12 @@ def addini( Defaults to ``string`` if ``None`` or not passed. :param default: Default value if no ini-file option exists but is queried. + :param aliases: + Additional names by which this option can be referenced. + Aliases resolve to the canonical name. + + .. versionadded:: 9.0 + The ``aliases`` parameter. The value of ini-variables can be retrieved via a call to :py:func:`config.getini(name) `. @@ -234,6 +244,13 @@ def addini( self._inidict[name] = (help, type, default) self._ininames.append(name) + for alias in aliases: + if alias in self._inidict: + raise ValueError(f"alias {alias!r} conflicts with existing ini option") + if (already := self._ini_aliases.get(alias)) is not None: + raise ValueError(f"{alias!r} is already an alias of {already!r}") + self._ini_aliases[alias] = name + def get_ini_default_for_type( type: Literal[ diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index 2dea16dd0d5..fcdcfa69f7d 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -2,9 +2,11 @@ from collections.abc import Iterable from collections.abc import Sequence +from dataclasses import dataclass import os from pathlib import Path import sys +from typing import Literal from typing import TypeAlias import iniconfig @@ -16,9 +18,23 @@ from _pytest.pathlib import safe_exists -# Even though TOML supports richer data types, all values are converted to str/list[str] during -# parsing to maintain compatibility with the rest of the configuration system. -ConfigDict: TypeAlias = dict[str, str | list[str]] +@dataclass(frozen=True) +class IniValue: + """Represents an ini configuration value with its origin. + + This allows tracking whether a value came from a configuration file + or from a CLI override (--override-ini), which is important for + determining precedence when dealing with ini option aliases. + """ + + # Even though TOML supports richer data types, all values are converted to + # str/list[str] during parsing to maintain compatibility with the rest of + # the configuration system. + value: str | list[str] + origin: Literal["file", "override"] + + +ConfigDict: TypeAlias = dict[str, IniValue] def _parse_ini_config(path: Path) -> iniconfig.IniConfig: @@ -45,7 +61,7 @@ def load_config_dict_from_file( iniconfig = _parse_ini_config(filepath) if "pytest" in iniconfig: - return dict(iniconfig["pytest"].items()) + return {k: IniValue(v, "file") for k, v in iniconfig["pytest"].items()} else: # "pytest.ini" files are always the source of configuration, even if empty. if filepath.name == "pytest.ini": @@ -56,7 +72,7 @@ def load_config_dict_from_file( iniconfig = _parse_ini_config(filepath) if "tool:pytest" in iniconfig.sections: - return dict(iniconfig["tool:pytest"].items()) + return {k: IniValue(v, "file") for k, v in iniconfig["tool:pytest"].items()} elif "pytest" in iniconfig.sections: # If a setup.cfg contains a "[pytest]" section, we raise a failure to indicate users that # plain "[pytest]" sections in setup.cfg files is no longer supported (#3086). @@ -83,7 +99,7 @@ def load_config_dict_from_file( def make_scalar(v: object) -> str | list[str]: return v if isinstance(v, list) else str(v) - return {k: make_scalar(v) for k, v in result.items()} + return {k: IniValue(make_scalar(v), "file") for k, v in result.items()} return None @@ -181,7 +197,7 @@ def get_dir_from_path(path: Path) -> Path: return [get_dir_from_path(path) for path in possible_paths if safe_exists(path)] -def parse_override_ini(override_ini: Sequence[str] | None) -> dict[str, str]: +def parse_override_ini(override_ini: Sequence[str] | None) -> ConfigDict: """Parse the -o/--override-ini command line arguments and return the overrides. :raises UsageError: @@ -199,7 +215,7 @@ def parse_override_ini(override_ini: Sequence[str] | None) -> dict[str, str]: f"-o/--override-ini expects option=value style (got: {ini_config!r})." ) from e else: - overrides[key] = user_ini_value + overrides[key] = IniValue(user_ini_value, "override") return overrides diff --git a/testing/test_config.py b/testing/test_config.py index d85e95046c1..773bd2c927d 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -25,6 +25,7 @@ from _pytest.config.exceptions import UsageError from _pytest.config.findpaths import determine_setup from _pytest.config.findpaths import get_common_ancestor +from _pytest.config.findpaths import IniValue from _pytest.config.findpaths import locate_config from _pytest.monkeypatch import MonkeyPatch from _pytest.pathlib import absolutepath @@ -57,9 +58,9 @@ def test_getcfg_and_config( encoding="utf-8", ) _, _, cfg, _ = locate_config(Path.cwd(), [sub]) - assert cfg["name"] == "value" + assert cfg["name"] == IniValue("value", "file") config = pytester.parseconfigure(str(sub)) - assert config.inicfg["name"] == "value" + assert config.inicfg["name"] == IniValue("value", "file") def test_setupcfg_uses_toolpytest_with_pytest(self, pytester: Pytester) -> None: p1 = pytester.makepyfile("def test(): pass") @@ -1005,6 +1006,166 @@ def pytest_addoption(parser): value = config.getini("no_type") assert value == "" + def test_addini_with_aliases(self, pytester: Pytester) -> None: + """Test that ini options can have aliases.""" + pytester.makeconftest( + """ + def pytest_addoption(parser): + parser.addini("new_name", "my option", aliases=["old_name"]) + """ + ) + pytester.makeini( + """ + [pytest] + old_name = hello + """ + ) + config = pytester.parseconfig() + # Should be able to access via canonical name. + assert config.getini("new_name") == "hello" + # Should also be able to access via alias. + assert config.getini("old_name") == "hello" + + def test_addini_aliases_with_canonical_in_file(self, pytester: Pytester) -> None: + """Test that canonical name takes precedence over alias in ini file.""" + pytester.makeconftest( + """ + def pytest_addoption(parser): + parser.addini("new_name", "my option", aliases=["old_name"]) + """ + ) + pytester.makeini( + """ + [pytest] + old_name = from_alias + new_name = from_canonical + """ + ) + config = pytester.parseconfig() + # Canonical name should take precedence. + assert config.getini("new_name") == "from_canonical" + assert config.getini("old_name") == "from_canonical" + + def test_addini_aliases_multiple(self, pytester: Pytester) -> None: + """Test that ini option can have multiple aliases.""" + pytester.makeconftest( + """ + def pytest_addoption(parser): + parser.addini("current_name", "my option", aliases=["old_name", "legacy_name"]) + """ + ) + pytester.makeini( + """ + [pytest] + old_name = value1 + """ + ) + config = pytester.parseconfig() + assert config.getini("current_name") == "value1" + assert config.getini("old_name") == "value1" + assert config.getini("legacy_name") == "value1" + + def test_addini_aliases_with_override_of_old(self, pytester: Pytester) -> None: + """Test that aliases work with --override-ini -- ini sets old.""" + pytester.makeconftest( + """ + def pytest_addoption(parser): + parser.addini("new_name", "my option", aliases=["old_name"]) + """ + ) + pytester.makeini( + """ + [pytest] + old_name = from_file + """ + ) + # Override using alias. + config = pytester.parseconfig("-o", "old_name=overridden") + assert config.getini("new_name") == "overridden" + assert config.getini("old_name") == "overridden" + + # Override using canonical name. + config = pytester.parseconfig("-o", "new_name=overridden2") + assert config.getini("new_name") == "overridden2" + + def test_addini_aliases_with_override_of_new(self, pytester: Pytester) -> None: + """Test that aliases work with --override-ini -- ini sets new.""" + pytester.makeconftest( + """ + def pytest_addoption(parser): + parser.addini("new_name", "my option", aliases=["old_name"]) + """ + ) + pytester.makeini( + """ + [pytest] + new_name = from_file + """ + ) + # Override using alias. + config = pytester.parseconfig("-o", "old_name=overridden") + assert config.getini("new_name") == "overridden" + assert config.getini("old_name") == "overridden" + + # Override using canonical name. + config = pytester.parseconfig("-o", "new_name=overridden2") + assert config.getini("new_name") == "overridden2" + + def test_addini_aliases_with_types(self, pytester: Pytester) -> None: + """Test that aliases work with different types.""" + pytester.makeconftest( + """ + def pytest_addoption(parser): + parser.addini("mylist", "list option", type="linelist", aliases=["oldlist"]) + parser.addini("mybool", "bool option", type="bool", aliases=["oldbool"]) + """ + ) + pytester.makeini( + """ + [pytest] + oldlist = line1 + line2 + oldbool = true + """ + ) + config = pytester.parseconfig() + assert config.getini("mylist") == ["line1", "line2"] + assert config.getini("oldlist") == ["line1", "line2"] + assert config.getini("mybool") is True + assert config.getini("oldbool") is True + + def test_addini_aliases_conflict_error(self, pytester: Pytester) -> None: + """Test that registering an alias that conflicts with an existing option raises an error.""" + pytester.makeconftest( + """ + def pytest_addoption(parser): + parser.addini("existing", "first option") + + try: + parser.addini("new_option", "second option", aliases=["existing"]) + except ValueError as e: + assert "alias 'existing' conflicts with existing ini option" in str(e) + else: + assert False, "Should have raised ValueError" + """ + ) + pytester.parseconfig() + + def test_addini_aliases_duplicate_error(self, pytester: Pytester) -> None: + """Test that registering the same alias twice raises an error.""" + pytester.makeconftest( + """ + def pytest_addoption(parser): + parser.addini("option1", "first option", aliases=["shared_alias"]) + try: + parser.addini("option2", "second option", aliases=["shared_alias"]) + raise AssertionError("Should have raised ValueError") + except ValueError as e: + assert "'shared_alias' is already an alias of 'option1'" in str(e) + """ + ) + pytester.parseconfig() + @pytest.mark.parametrize( "type, expected", [ @@ -1153,7 +1314,7 @@ def test_inifilename(self, tmp_path: Path) -> None: # this indicates this is the file used for getting configuration values assert config.inipath == inipath - assert config.inicfg.get("name") == "value" + assert config.inicfg.get("name") == IniValue("value", "file") assert config.inicfg.get("should_not_be_set") is None @@ -1647,7 +1808,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: ) assert rootpath == tmp_path assert parsed_inipath == inipath - assert ini_config == {"x": "10"} + assert ini_config["x"] == IniValue("10", "file") @pytest.mark.parametrize("name", ["setup.cfg", "tox.ini"]) def test_pytestini_overrides_empty_other(self, tmp_path: Path, name: str) -> None: @@ -1721,7 +1882,7 @@ def test_with_specific_inifile( ) assert rootpath == tmp_path assert inipath == p - assert ini_config == {"x": "10"} + assert ini_config["x"] == IniValue("10", "file") def test_explicit_config_file_sets_rootdir( self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch @@ -1991,7 +2152,7 @@ def test_addopts_before_initini( monkeypatch.setenv("PYTEST_ADDOPTS", f"-o cache_dir={cache_dir}") config = _config_for_test config._preparse([], addopts=True) - assert config.inicfg.get("cache_dir") == cache_dir + assert config.inicfg.get("cache_dir") == IniValue(cache_dir, "override") def test_addopts_from_env_not_concatenated( self, monkeypatch: MonkeyPatch, _config_for_test @@ -2029,7 +2190,7 @@ def test_override_ini_does_not_contain_paths( """Check that -o no longer swallows all options after it (#3103)""" config = _config_for_test config._preparse(["-o", "cache_dir=/cache", "/some/test/path"]) - assert config.inicfg.get("cache_dir") == "/cache" + assert config.inicfg.get("cache_dir") == IniValue("/cache", "override") def test_multiple_override_ini_options(self, pytester: Pytester) -> None: """Ensure a file path following a '-o' option does not generate an error (#3103)""" diff --git a/testing/test_findpaths.py b/testing/test_findpaths.py index 9532f1eef75..fed8c9d4838 100644 --- a/testing/test_findpaths.py +++ b/testing/test_findpaths.py @@ -8,6 +8,7 @@ from _pytest.config import UsageError from _pytest.config.findpaths import get_common_ancestor from _pytest.config.findpaths import get_dirs_from_args +from _pytest.config.findpaths import IniValue from _pytest.config.findpaths import is_fs_root from _pytest.config.findpaths import load_config_dict_from_file import pytest @@ -24,13 +25,13 @@ def test_pytest_ini(self, tmp_path: Path) -> None: """[pytest] section in pytest.ini files is read correctly""" fn = tmp_path / "pytest.ini" fn.write_text("[pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": "1"} + assert load_config_dict_from_file(fn) == {"x": IniValue("1", "file")} def test_custom_ini(self, tmp_path: Path) -> None: """[pytest] section in any .ini file is read correctly""" fn = tmp_path / "custom.ini" fn.write_text("[pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": "1"} + assert load_config_dict_from_file(fn) == {"x": IniValue("1", "file")} def test_custom_ini_without_section(self, tmp_path: Path) -> None: """Custom .ini files without [pytest] section are not considered for configuration""" @@ -48,7 +49,7 @@ def test_valid_cfg_file(self, tmp_path: Path) -> None: """Custom .cfg files with [tool:pytest] section are read correctly""" fn = tmp_path / "custom.cfg" fn.write_text("[tool:pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": "1"} + assert load_config_dict_from_file(fn) == {"x": IniValue("1", "file")} def test_unsupported_pytest_section_in_cfg_file(self, tmp_path: Path) -> None: """.cfg files with [pytest] section are no longer supported and should fail to alert users""" @@ -96,11 +97,11 @@ def test_valid_toml_file(self, tmp_path: Path) -> None: encoding="utf-8", ) assert load_config_dict_from_file(fn) == { - "x": "1", - "y": "20.0", - "values": ["tests", "integration"], - "name": "foo", - "heterogeneous_array": [1, "str"], + "x": IniValue("1", "file"), + "y": IniValue("20.0", "file"), + "values": IniValue(["tests", "integration"], "file"), + "name": IniValue("foo", "file"), + "heterogeneous_array": IniValue([1, "str"], "file"), # type: ignore[list-item] } From 65ede5b5966db19ba7e6c2f02638bd16fe373ef9 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 23 Oct 2025 17:06:22 +0300 Subject: [PATCH 171/270] tox: require tox>=4 Tox 4.0.0 was released on Dec 7, 2022, should be OK to require it. On the way, since `minversion` is deprecated, replace it with `require`. https://tox.wiki/en/latest/config.html#min_version --- changelog/13841.contrib.rst | 1 + tox.ini | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/13841.contrib.rst diff --git a/changelog/13841.contrib.rst b/changelog/13841.contrib.rst new file mode 100644 index 00000000000..e5672634700 --- /dev/null +++ b/changelog/13841.contrib.rst @@ -0,0 +1 @@ +``tox>=4`` is now required when contributing to pytest. diff --git a/tox.ini b/tox.ini index fa86c9c4403..f3e4cdc12c1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] isolated_build = True -minversion = 3.20.0 +requires = + tox >= 4 distshare = {homedir}/.tox/distshare envlist = linting From 0075c57cb7da8bdb21785d06786a728faa55ceb5 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 23 Oct 2025 17:03:52 +0300 Subject: [PATCH 172/270] tox: remove `distshare` setting As far as I can see this setting no longer exists in tox 4, and probably not utilized before either, so should be safe to remove. --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index f3e4cdc12c1..520799b019d 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ isolated_build = True requires = tox >= 4 -distshare = {homedir}/.tox/distshare envlist = linting py310 From 66429cef4c3b02adce66f7cf39cce134da0ac173 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 23 Oct 2025 17:09:01 +0300 Subject: [PATCH 173/270] tox: remove `isolated_build` setting According to https://tox.wiki/en/stable/upgrading.html#removed-tox-ini-keys: "Isolated builds are now always used." --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 520799b019d..9e1d2f7079e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,4 @@ [tox] -isolated_build = True requires = tox >= 4 envlist = From 20741b447f0241db7e40ad0ed21f205efd456c95 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 23 Oct 2025 17:16:33 +0300 Subject: [PATCH 174/270] tox: use the same wheel for all environments Since pytest wheel is "universal" (not different between Python versions or implementations or anything), the same wheel can be reused. See: https://tox.wiki/en/stable/config.html#wheel_build_env https://tox.wiki/en/stable/upgrading.html#universal-wheels --- tox.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tox.ini b/tox.ini index 9e1d2f7079e..a47f944133a 100644 --- a/tox.ini +++ b/tox.ini @@ -93,6 +93,9 @@ deps = xdist: pytest-xdist>=2.1.0 xdist: -e . {env:_PYTEST_TOX_EXTRA_DEP:} +# Can use the same wheel for all environments. +package = wheel +wheel_build_env = .pkg [testenv:linting] description = From 0ed35d5f904669630834f1141cd618b2b28360e3 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 23 Oct 2025 17:19:51 +0300 Subject: [PATCH 175/270] tox: remove `basepython = python3` lines I don't think they're needed. --- tox.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tox.ini b/tox.ini index a47f944133a..1203bfe2352 100644 --- a/tox.ini +++ b/tox.ini @@ -101,7 +101,6 @@ wheel_build_env = .pkg description = run pre-commit-defined linters under `{basepython}` skip_install = True -basepython = python3 deps = pre-commit>=2.9.3 commands = pre-commit run --all-files --show-diff-on-failure {posargs:} setenv = @@ -129,7 +128,6 @@ setenv = [testenv:docs-checklinks] description = check the links in the documentation with `{basepython}` -basepython = python3 usedevelop = True changedir = doc/en deps = -r{toxinidir}/doc/en/requirements.txt @@ -143,7 +141,6 @@ setenv = description = regenerate documentation examples under `{basepython}` changedir = doc/en -basepython = python3 passenv = SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST deps = @@ -196,7 +193,6 @@ commands = [testenv:release] description = do a release, required posarg of the version number -basepython = python3 usedevelop = True passenv = * deps = @@ -214,7 +210,6 @@ commands = python scripts/prepare-release-pr.py {posargs} [testenv:generate-gh-release-notes] description = generate release notes that can be published as GitHub Release -basepython = python3 usedevelop = True deps = pypandoc From 7fc91fe2c5e23ad6a17aab6a0c22b7036468c048 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 25 Oct 2025 12:07:16 +0300 Subject: [PATCH 176/270] config: convert ini type `None` to `string` earlier Do it early so later code doesn't have to deal with `type=None`. --- src/_pytest/config/__init__.py | 2 -- src/_pytest/config/argparsing.py | 11 +++++------ src/_pytest/helpconfig.py | 2 -- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 2af60fa9c3c..c82b33a7235 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1710,8 +1710,6 @@ def _getini(self, name: str): f"Expected a float string for option {name} of type float, but got: {value!r}" ) from None return float(value) - elif type is None: - return value else: return self._getini_unknown_type(name, type, value) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index afd1892b222..e30883acb8a 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -50,7 +50,7 @@ def __init__( self._groups: list[OptionGroup] = [] self._processopt = processopt self._usage = usage - self._inidict: dict[str, tuple[str, str | None, Any]] = {} + self._inidict: dict[str, tuple[str, str, Any]] = {} self._ininames: list[str] = [] # Maps alias -> canonical name. self._ini_aliases: dict[str, str] = {} @@ -238,6 +238,8 @@ def addini( "int", "float", ) + if type is None: + type = "string" if default is NOT_SET: default = get_ini_default_for_type(type) @@ -255,16 +257,13 @@ def addini( def get_ini_default_for_type( type: Literal[ "string", "paths", "pathlist", "args", "linelist", "bool", "int", "float" - ] - | None, + ], ) -> Any: """ Used by addini to get the default value for a given ini-option type, when default is not supplied. """ - if type is None: - return "" - elif type in ("paths", "pathlist", "args", "linelist"): + if type in ("paths", "pathlist", "args", "linelist"): return [] elif type == "bool": return False diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index da5d06f83b0..b2158e4c116 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -186,8 +186,6 @@ def showhelp(config: Config) -> None: indent = " " * indent_len for name in config._parser._ininames: help, type, _default = config._parser._inidict[name] - if type is None: - type = "string" if help is None: raise TypeError(f"help argument cannot be None for {name}") spec = f"{name} ({type}):" From 1b89e4f32cce8e6b6c8c5a816930417f1d2e906b Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 25 Oct 2025 12:15:30 +0300 Subject: [PATCH 177/270] config: remove `Parser._ininames` Doesn't seem needed. Maybe it was useful before dicts had guaranteed iteration order? `pytest --help` output is unchanged. --- src/_pytest/config/argparsing.py | 2 -- src/_pytest/helpconfig.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index e30883acb8a..e6e89e03a6b 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -51,7 +51,6 @@ def __init__( self._processopt = processopt self._usage = usage self._inidict: dict[str, tuple[str, str, Any]] = {} - self._ininames: list[str] = [] # Maps alias -> canonical name. self._ini_aliases: dict[str, str] = {} self.extra_info: dict[str, Any] = {} @@ -244,7 +243,6 @@ def addini( default = get_ini_default_for_type(type) self._inidict[name] = (help, type, default) - self._ininames.append(name) for alias in aliases: if alias in self._inidict: diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index b2158e4c116..9e06a45ad52 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -184,7 +184,7 @@ def showhelp(config: Config) -> None: columns = tw.fullwidth # costly call indent_len = 24 # based on argparse's max_help_position=24 indent = " " * indent_len - for name in config._parser._ininames: + for name in config._parser._inidict: help, type, _default = config._parser._inidict[name] if help is None: raise TypeError(f"help argument cannot be None for {name}") From 543d9aac933cd122ef509e3056cfc3959e128b3f Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 24 Oct 2025 22:34:02 +0300 Subject: [PATCH 178/270] config: rename `IniValue` to `ConfigValue` As we add native toml support, the name `IniValue` will be less appropriate. --- src/_pytest/config/__init__.py | 6 +++--- src/_pytest/config/findpaths.py | 16 +++++++++------- testing/test_config.py | 16 ++++++++-------- testing/test_findpaths.py | 18 +++++++++--------- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index c82b33a7235..29fe7d5dcbe 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1647,7 +1647,7 @@ def _getini(self, name: str): raise ValueError(f"unknown configuration value: {name!r}") from e # Collect all possible values (canonical name + aliases) from inicfg. - # Each candidate is (IniValue, is_canonical). + # Each candidate is (ConfigValue, is_canonical). candidates = [] if canonical_name in self.inicfg: candidates.append((self.inicfg[canonical_name], True)) @@ -1661,8 +1661,8 @@ def _getini(self, name: str): # Pick the best candidate based on precedence: # 1. CLI override takes precedence over file, then # 2. Canonical name takes precedence over alias. - ini_value = max(candidates, key=lambda x: (x[0].origin == "override", x[1]))[0] - value = ini_value.value + selected = max(candidates, key=lambda x: (x[0].origin == "override", x[1]))[0] + value = selected.value # Coerce the values based on types. # diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index fcdcfa69f7d..8724db43352 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -19,8 +19,8 @@ @dataclass(frozen=True) -class IniValue: - """Represents an ini configuration value with its origin. +class ConfigValue: + """Represents a configuration value with its origin. This allows tracking whether a value came from a configuration file or from a CLI override (--override-ini), which is important for @@ -34,7 +34,7 @@ class IniValue: origin: Literal["file", "override"] -ConfigDict: TypeAlias = dict[str, IniValue] +ConfigDict: TypeAlias = dict[str, ConfigValue] def _parse_ini_config(path: Path) -> iniconfig.IniConfig: @@ -61,7 +61,7 @@ def load_config_dict_from_file( iniconfig = _parse_ini_config(filepath) if "pytest" in iniconfig: - return {k: IniValue(v, "file") for k, v in iniconfig["pytest"].items()} + return {k: ConfigValue(v, "file") for k, v in iniconfig["pytest"].items()} else: # "pytest.ini" files are always the source of configuration, even if empty. if filepath.name == "pytest.ini": @@ -72,7 +72,9 @@ def load_config_dict_from_file( iniconfig = _parse_ini_config(filepath) if "tool:pytest" in iniconfig.sections: - return {k: IniValue(v, "file") for k, v in iniconfig["tool:pytest"].items()} + return { + k: ConfigValue(v, "file") for k, v in iniconfig["tool:pytest"].items() + } elif "pytest" in iniconfig.sections: # If a setup.cfg contains a "[pytest]" section, we raise a failure to indicate users that # plain "[pytest]" sections in setup.cfg files is no longer supported (#3086). @@ -99,7 +101,7 @@ def load_config_dict_from_file( def make_scalar(v: object) -> str | list[str]: return v if isinstance(v, list) else str(v) - return {k: IniValue(make_scalar(v), "file") for k, v in result.items()} + return {k: ConfigValue(make_scalar(v), "file") for k, v in result.items()} return None @@ -215,7 +217,7 @@ def parse_override_ini(override_ini: Sequence[str] | None) -> ConfigDict: f"-o/--override-ini expects option=value style (got: {ini_config!r})." ) from e else: - overrides[key] = IniValue(user_ini_value, "override") + overrides[key] = ConfigValue(user_ini_value, "override") return overrides diff --git a/testing/test_config.py b/testing/test_config.py index 773bd2c927d..39cb2d5ed83 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -23,9 +23,9 @@ from _pytest.config.argparsing import get_ini_default_for_type from _pytest.config.argparsing import Parser from _pytest.config.exceptions import UsageError +from _pytest.config.findpaths import ConfigValue from _pytest.config.findpaths import determine_setup from _pytest.config.findpaths import get_common_ancestor -from _pytest.config.findpaths import IniValue from _pytest.config.findpaths import locate_config from _pytest.monkeypatch import MonkeyPatch from _pytest.pathlib import absolutepath @@ -58,9 +58,9 @@ def test_getcfg_and_config( encoding="utf-8", ) _, _, cfg, _ = locate_config(Path.cwd(), [sub]) - assert cfg["name"] == IniValue("value", "file") + assert cfg["name"] == ConfigValue("value", "file") config = pytester.parseconfigure(str(sub)) - assert config.inicfg["name"] == IniValue("value", "file") + assert config.inicfg["name"] == ConfigValue("value", "file") def test_setupcfg_uses_toolpytest_with_pytest(self, pytester: Pytester) -> None: p1 = pytester.makepyfile("def test(): pass") @@ -1314,7 +1314,7 @@ def test_inifilename(self, tmp_path: Path) -> None: # this indicates this is the file used for getting configuration values assert config.inipath == inipath - assert config.inicfg.get("name") == IniValue("value", "file") + assert config.inicfg.get("name") == ConfigValue("value", "file") assert config.inicfg.get("should_not_be_set") is None @@ -1808,7 +1808,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: ) assert rootpath == tmp_path assert parsed_inipath == inipath - assert ini_config["x"] == IniValue("10", "file") + assert ini_config["x"] == ConfigValue("10", "file") @pytest.mark.parametrize("name", ["setup.cfg", "tox.ini"]) def test_pytestini_overrides_empty_other(self, tmp_path: Path, name: str) -> None: @@ -1882,7 +1882,7 @@ def test_with_specific_inifile( ) assert rootpath == tmp_path assert inipath == p - assert ini_config["x"] == IniValue("10", "file") + assert ini_config["x"] == ConfigValue("10", "file") def test_explicit_config_file_sets_rootdir( self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch @@ -2152,7 +2152,7 @@ def test_addopts_before_initini( monkeypatch.setenv("PYTEST_ADDOPTS", f"-o cache_dir={cache_dir}") config = _config_for_test config._preparse([], addopts=True) - assert config.inicfg.get("cache_dir") == IniValue(cache_dir, "override") + assert config.inicfg.get("cache_dir") == ConfigValue(cache_dir, "override") def test_addopts_from_env_not_concatenated( self, monkeypatch: MonkeyPatch, _config_for_test @@ -2190,7 +2190,7 @@ def test_override_ini_does_not_contain_paths( """Check that -o no longer swallows all options after it (#3103)""" config = _config_for_test config._preparse(["-o", "cache_dir=/cache", "/some/test/path"]) - assert config.inicfg.get("cache_dir") == IniValue("/cache", "override") + assert config.inicfg.get("cache_dir") == ConfigValue("/cache", "override") def test_multiple_override_ini_options(self, pytester: Pytester) -> None: """Ensure a file path following a '-o' option does not generate an error (#3103)""" diff --git a/testing/test_findpaths.py b/testing/test_findpaths.py index fed8c9d4838..8da24ea07eb 100644 --- a/testing/test_findpaths.py +++ b/testing/test_findpaths.py @@ -6,9 +6,9 @@ from textwrap import dedent from _pytest.config import UsageError +from _pytest.config.findpaths import ConfigValue from _pytest.config.findpaths import get_common_ancestor from _pytest.config.findpaths import get_dirs_from_args -from _pytest.config.findpaths import IniValue from _pytest.config.findpaths import is_fs_root from _pytest.config.findpaths import load_config_dict_from_file import pytest @@ -25,13 +25,13 @@ def test_pytest_ini(self, tmp_path: Path) -> None: """[pytest] section in pytest.ini files is read correctly""" fn = tmp_path / "pytest.ini" fn.write_text("[pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": IniValue("1", "file")} + assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", "file")} def test_custom_ini(self, tmp_path: Path) -> None: """[pytest] section in any .ini file is read correctly""" fn = tmp_path / "custom.ini" fn.write_text("[pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": IniValue("1", "file")} + assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", "file")} def test_custom_ini_without_section(self, tmp_path: Path) -> None: """Custom .ini files without [pytest] section are not considered for configuration""" @@ -49,7 +49,7 @@ def test_valid_cfg_file(self, tmp_path: Path) -> None: """Custom .cfg files with [tool:pytest] section are read correctly""" fn = tmp_path / "custom.cfg" fn.write_text("[tool:pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": IniValue("1", "file")} + assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", "file")} def test_unsupported_pytest_section_in_cfg_file(self, tmp_path: Path) -> None: """.cfg files with [pytest] section are no longer supported and should fail to alert users""" @@ -97,11 +97,11 @@ def test_valid_toml_file(self, tmp_path: Path) -> None: encoding="utf-8", ) assert load_config_dict_from_file(fn) == { - "x": IniValue("1", "file"), - "y": IniValue("20.0", "file"), - "values": IniValue(["tests", "integration"], "file"), - "name": IniValue("foo", "file"), - "heterogeneous_array": IniValue([1, "str"], "file"), # type: ignore[list-item] + "x": ConfigValue("1", "file"), + "y": ConfigValue("20.0", "file"), + "values": ConfigValue(["tests", "integration"], "file"), + "name": ConfigValue("foo", "file"), + "heterogeneous_array": ConfigValue([1, "str"], "file"), # type: ignore[list-item] } From ab44bec1fae928052bdff86bd0094f212a8c7abe Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 24 Oct 2025 22:43:20 +0300 Subject: [PATCH 179/270] config: make `ConfigValue.origin` kw-only I am going to add another field, then it will start being ambiguous, so make it kw-only to ensure clarity. --- src/_pytest/config/findpaths.py | 15 +++++++++++---- testing/test_config.py | 18 +++++++++++------- testing/test_findpaths.py | 16 ++++++++-------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index 8724db43352..db0b829a530 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -3,6 +3,7 @@ from collections.abc import Iterable from collections.abc import Sequence from dataclasses import dataclass +from dataclasses import KW_ONLY import os from pathlib import Path import sys @@ -31,6 +32,7 @@ class ConfigValue: # str/list[str] during parsing to maintain compatibility with the rest of # the configuration system. value: str | list[str] + _: KW_ONLY origin: Literal["file", "override"] @@ -61,7 +63,9 @@ def load_config_dict_from_file( iniconfig = _parse_ini_config(filepath) if "pytest" in iniconfig: - return {k: ConfigValue(v, "file") for k, v in iniconfig["pytest"].items()} + return { + k: ConfigValue(v, origin="file") for k, v in iniconfig["pytest"].items() + } else: # "pytest.ini" files are always the source of configuration, even if empty. if filepath.name == "pytest.ini": @@ -73,7 +77,8 @@ def load_config_dict_from_file( if "tool:pytest" in iniconfig.sections: return { - k: ConfigValue(v, "file") for k, v in iniconfig["tool:pytest"].items() + k: ConfigValue(v, origin="file") + for k, v in iniconfig["tool:pytest"].items() } elif "pytest" in iniconfig.sections: # If a setup.cfg contains a "[pytest]" section, we raise a failure to indicate users that @@ -101,7 +106,9 @@ def load_config_dict_from_file( def make_scalar(v: object) -> str | list[str]: return v if isinstance(v, list) else str(v) - return {k: ConfigValue(make_scalar(v), "file") for k, v in result.items()} + return { + k: ConfigValue(make_scalar(v), origin="file") for k, v in result.items() + } return None @@ -217,7 +224,7 @@ def parse_override_ini(override_ini: Sequence[str] | None) -> ConfigDict: f"-o/--override-ini expects option=value style (got: {ini_config!r})." ) from e else: - overrides[key] = ConfigValue(user_ini_value, "override") + overrides[key] = ConfigValue(user_ini_value, origin="override") return overrides diff --git a/testing/test_config.py b/testing/test_config.py index 39cb2d5ed83..cd8ed6b01d4 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -58,9 +58,9 @@ def test_getcfg_and_config( encoding="utf-8", ) _, _, cfg, _ = locate_config(Path.cwd(), [sub]) - assert cfg["name"] == ConfigValue("value", "file") + assert cfg["name"] == ConfigValue("value", origin="file") config = pytester.parseconfigure(str(sub)) - assert config.inicfg["name"] == ConfigValue("value", "file") + assert config.inicfg["name"] == ConfigValue("value", origin="file") def test_setupcfg_uses_toolpytest_with_pytest(self, pytester: Pytester) -> None: p1 = pytester.makepyfile("def test(): pass") @@ -1314,7 +1314,7 @@ def test_inifilename(self, tmp_path: Path) -> None: # this indicates this is the file used for getting configuration values assert config.inipath == inipath - assert config.inicfg.get("name") == ConfigValue("value", "file") + assert config.inicfg.get("name") == ConfigValue("value", origin="file") assert config.inicfg.get("should_not_be_set") is None @@ -1808,7 +1808,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: ) assert rootpath == tmp_path assert parsed_inipath == inipath - assert ini_config["x"] == ConfigValue("10", "file") + assert ini_config["x"] == ConfigValue("10", origin="file") @pytest.mark.parametrize("name", ["setup.cfg", "tox.ini"]) def test_pytestini_overrides_empty_other(self, tmp_path: Path, name: str) -> None: @@ -1882,7 +1882,7 @@ def test_with_specific_inifile( ) assert rootpath == tmp_path assert inipath == p - assert ini_config["x"] == ConfigValue("10", "file") + assert ini_config["x"] == ConfigValue("10", origin="file") def test_explicit_config_file_sets_rootdir( self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch @@ -2152,7 +2152,9 @@ def test_addopts_before_initini( monkeypatch.setenv("PYTEST_ADDOPTS", f"-o cache_dir={cache_dir}") config = _config_for_test config._preparse([], addopts=True) - assert config.inicfg.get("cache_dir") == ConfigValue(cache_dir, "override") + assert config.inicfg.get("cache_dir") == ConfigValue( + cache_dir, origin="override" + ) def test_addopts_from_env_not_concatenated( self, monkeypatch: MonkeyPatch, _config_for_test @@ -2190,7 +2192,9 @@ def test_override_ini_does_not_contain_paths( """Check that -o no longer swallows all options after it (#3103)""" config = _config_for_test config._preparse(["-o", "cache_dir=/cache", "/some/test/path"]) - assert config.inicfg.get("cache_dir") == ConfigValue("/cache", "override") + assert config.inicfg.get("cache_dir") == ConfigValue( + "/cache", origin="override" + ) def test_multiple_override_ini_options(self, pytester: Pytester) -> None: """Ensure a file path following a '-o' option does not generate an error (#3103)""" diff --git a/testing/test_findpaths.py b/testing/test_findpaths.py index 8da24ea07eb..e8e70f9c6fb 100644 --- a/testing/test_findpaths.py +++ b/testing/test_findpaths.py @@ -25,13 +25,13 @@ def test_pytest_ini(self, tmp_path: Path) -> None: """[pytest] section in pytest.ini files is read correctly""" fn = tmp_path / "pytest.ini" fn.write_text("[pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", "file")} + assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", origin="file")} def test_custom_ini(self, tmp_path: Path) -> None: """[pytest] section in any .ini file is read correctly""" fn = tmp_path / "custom.ini" fn.write_text("[pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", "file")} + assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", origin="file")} def test_custom_ini_without_section(self, tmp_path: Path) -> None: """Custom .ini files without [pytest] section are not considered for configuration""" @@ -49,7 +49,7 @@ def test_valid_cfg_file(self, tmp_path: Path) -> None: """Custom .cfg files with [tool:pytest] section are read correctly""" fn = tmp_path / "custom.cfg" fn.write_text("[tool:pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", "file")} + assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", origin="file")} def test_unsupported_pytest_section_in_cfg_file(self, tmp_path: Path) -> None: """.cfg files with [pytest] section are no longer supported and should fail to alert users""" @@ -97,11 +97,11 @@ def test_valid_toml_file(self, tmp_path: Path) -> None: encoding="utf-8", ) assert load_config_dict_from_file(fn) == { - "x": ConfigValue("1", "file"), - "y": ConfigValue("20.0", "file"), - "values": ConfigValue(["tests", "integration"], "file"), - "name": ConfigValue("foo", "file"), - "heterogeneous_array": ConfigValue([1, "str"], "file"), # type: ignore[list-item] + "x": ConfigValue("1", origin="file"), + "y": ConfigValue("20.0", origin="file"), + "values": ConfigValue(["tests", "integration"], origin="file"), + "name": ConfigValue("foo", origin="file"), + "heterogeneous_array": ConfigValue([1, "str"], origin="file"), # type: ignore[list-item] } From 820964732b0ed3f6782e121d3d5af8084717a9e5 Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Sat, 25 Oct 2025 13:46:23 -0400 Subject: [PATCH 180/270] Remove unintentionally-unconditional skips (#13842) --- CONTRIBUTING.rst | 7 ++++--- testing/_py/test_local.py | 15 +++++---------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e98dd06fb5a..f31c14aec49 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -203,7 +203,7 @@ Short version #. Write a ``changelog`` entry: ``changelog/2574.bugfix.rst``, use issue id number and one of ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, - ``breaking``, ``vendor`` or ``trivial`` for the issue type. + ``breaking``, ``vendor``, ``packaging``, ``contrib``, or ``misc`` for the issue type. #. Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please @@ -305,8 +305,9 @@ Here is a simple overview, with pytest-specific bits: #. Create a new changelog entry in ``changelog``. The file should be named ``..rst``, where *issueid* is the number of the issue related to the change and *type* is one of - ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, ``breaking``, ``vendor`` - or ``trivial``. You may skip creating the changelog entry if the change doesn't affect the + ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, ``breaking``, ``vendor``, + ``packaging``, ``contrib``, or ``misc``. + You may skip creating the changelog entry if the change doesn't affect the documented behaviour of pytest. #. Add yourself to ``AUTHORS`` file if not there yet, in alphabetical order. diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index e7301c273e0..592058a54a5 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -207,13 +207,9 @@ def test_visit_norecurse(self, path1): assert "sampledir" in lst assert path1.sep.join(["sampledir", "otherfile"]) not in lst - @pytest.mark.parametrize( - "fil", - ["*dir", pytest.mark.skip("sys.version_info < (3,6)")(b"*dir")], - ) - def test_visit_filterfunc_is_string(self, path1, fil): + def test_visit_filterfunc_is_string(self, path1): lst = [] - for i in path1.visit(fil): + for i in path1.visit("*dir"): lst.append(i.relto(path1)) assert len(lst), 2 # noqa: PLC1802,RUF040 assert "sampledir" in lst @@ -463,12 +459,11 @@ def test_fspath_func_match_strpath(self, path1): assert fspath(path1) == path1.strpath - @pytest.mark.skip("sys.version_info < (3,6)") def test_fspath_open(self, path1): - f = path1.join("opentestfile") - open(f) + f = path1.join("samplefile") + stream = open(f, encoding="utf-8") + stream.close() - @pytest.mark.skip("sys.version_info < (3,6)") def test_fspath_fsencode(self, path1): from os import fsencode From a75b425635efb910eab77773357437042b80be3c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Oct 2025 06:18:20 +0000 Subject: [PATCH 181/270] [automated] Update plugin list (#13847) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 232 ++++++++++++++++++++----------- 1 file changed, 152 insertions(+), 80 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 60a12ad8ada..f41ee044400 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -27,7 +27,7 @@ please refer to `the update script =2.7.3) :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Apr 13, 2023 N/A pytest :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest - :pypi:`pytest-allure-host` Publish Allure static reports to private S3 behind CloudFront with history preservation Oct 10, 2025 3 - Alpha N/A + :pypi:`pytest-allure-host` Publish Allure static reports to private S3 behind CloudFront with history preservation Oct 21, 2025 3 - Alpha N/A :pypi:`pytest-allure-id2history` Overwrite allure history id with testcase full name and testcase id if testcase has id, exclude parameters. May 14, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-allure-intersection` Oct 27, 2022 N/A pytest (<5) :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest @@ -114,7 +114,7 @@ This list contains 1732 plugins. :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A :pypi:`pytest-assertcount` Plugin to count actual number of asserts in pytest Oct 23, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A - :pypi:`pytest-assert-type` Use typing.assert_type() to test runtime behavior Oct 14, 2025 3 - Alpha pytest>=6.2.0 + :pypi:`pytest-assert-type` Use typing.assert_type() to test runtime behavior Oct 20, 2025 3 - Alpha pytest>=6.2.0 :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A :pypi:`pytest-assist` load testing library Mar 17, 2025 N/A pytest @@ -176,7 +176,7 @@ This list contains 1732 plugins. :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beartype` Pytest plugin to run your tests with beartype checking enabled. Oct 31, 2024 N/A pytest - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Oct 15, 2025 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Oct 21, 2025 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beeprint` use icdiff for better error messages in pytest assertions Jul 04, 2023 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A @@ -237,6 +237,7 @@ This list contains 1732 plugins. :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest :pypi:`pytest-case` A clean, modern, wrapper for pytest.mark.parametrize Nov 25, 2024 N/A pytest<9.0.0,>=8.3.3 + :pypi:`pytest-case-provider` Advanced pytest parametrization plugin that generates test case instances from sync or async factories. Oct 25, 2025 3 - Alpha pytest<9,>=8 :pypi:`pytest-cases` Separate test code from test cases in pytest. Jun 09, 2025 5 - Production/Stable pytest :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) @@ -299,7 +300,7 @@ This list contains 1732 plugins. :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Oct 07, 2025 5 - Production/Stable pytest>=3.8 + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Oct 24, 2025 5 - Production/Stable pytest>=3.8 :pypi:`pytest-collect-appoint-info` set your encoding Aug 03, 2023 N/A pytest :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A @@ -308,7 +309,7 @@ This list contains 1732 plugins. :pypi:`pytest-collect-pytest-interinfo` A simple plugin to use with pytest Sep 26, 2023 4 - Beta N/A :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) - :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Jun 12, 2024 N/A pytest<9,>=3.6 + :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Oct 22, 2025 N/A pytest<9,>=3.6 :pypi:`pytest-compare` pytest plugin for comparing call arguments. Jun 22, 2023 5 - Production/Stable N/A :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-conductor` Pytest plugin for coordinating the order in which marked tests run. Jul 30, 2025 N/A pytest<8.4; python_version == "3.8" @@ -339,6 +340,7 @@ This list contains 1732 plugins. :pypi:`pytest-cratedb` Manage CrateDB instances for integration tests Oct 08, 2024 4 - Beta pytest<9 :pypi:`pytest-cratedb-reporter` A pytest plugin for reporting test results to CrateDB Mar 11, 2025 N/A pytest>=6.0.0 :pypi:`pytest-crayons` A pytest plugin for colorful print statements Oct 14, 2025 5 - Production/Stable pytest + :pypi:`pytest-cream` The cream of test execution - smooth pytest workflows with intelligent orchestration Oct 25, 2025 N/A pytest :pypi:`pytest-create` pytest-create Feb 15, 2023 1 - Planning N/A :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A @@ -372,7 +374,7 @@ This list contains 1732 plugins. :pypi:`pytest-datafixtures` Data fixtures for pytest made simple. May 15, 2025 5 - Production/Stable N/A :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataguard` Data validation and integrity testing for your datasets using pytest. Oct 08, 2025 N/A pytest>=8.4.2 - :pypi:`pytest-data-loader` Pytest plugin for loading test data for data-driven testing (DDT) Oct 16, 2025 4 - Beta pytest<9,>=7.0.0 + :pypi:`pytest-data-loader` Pytest plugin for loading test data for data-driven testing (DDT) Oct 22, 2025 4 - Beta pytest<9,>=7.0.0 :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Jul 31, 2024 5 - Production/Stable pytest :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Sep 01, 2023 5 - Production/Stable N/A @@ -399,9 +401,10 @@ This list contains 1732 plugins. :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A :pypi:`pytest-dependency` Manage dependencies of tests Dec 31, 2023 4 - Beta N/A :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) + :pypi:`pytest-depper` Smart test selection based on AST-level code dependency analysis Oct 23, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-deprecate` Mark tests as testing a deprecated feature with a warning note. Jul 01, 2019 N/A N/A :pypi:`pytest-deprecator` A simple plugin to use with pytest Dec 02, 2024 4 - Beta pytest>=6.2.0 - :pypi:`pytest-describe` Describe-style plugin for pytest Feb 10, 2024 5 - Production/Stable pytest <9,>=4.6 + :pypi:`pytest-describe` Describe-style plugin for pytest Oct 23, 2025 5 - Production/Stable pytest<9,>=6 :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest :pypi:`pytest-deselect-if` A plugin to deselect pytests tests rather than using skipif Dec 26, 2024 4 - Beta pytest>=6.2.0 :pypi:`pytest-devpi-server` DevPI server fixture for py.test Oct 17, 2024 5 - Production/Stable pytest @@ -516,15 +519,15 @@ This list contains 1732 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jul 25, 2024 4 - Beta pytest>=3.5.0 :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Oct 16, 2025 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Oct 16, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Oct 16, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Oct 16, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Oct 16, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Oct 16, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Oct 16, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Oct 16, 2025 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Oct 16, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Oct 24, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Oct 24, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Oct 24, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Oct 24, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Oct 24, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Oct 24, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Oct 24, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Oct 24, 2025 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Oct 24, 2025 5 - Production/Stable N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 09, 2023 4 - Beta pytest (==7.0.1) @@ -626,7 +629,7 @@ This list contains 1732 plugins. :pypi:`pytest-fixture-forms` A pytest plugin for creating fixtures that holds different forms between tests. Dec 06, 2024 N/A pytest<9.0.0,>=7.0.0 :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A - :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order May 16, 2022 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order Oct 22, 2025 5 - Production/Stable pytest>=3.0 :pypi:`pytest-fixture-ref` Lets users reference fixtures without name matching magic. Nov 17, 2022 4 - Beta N/A :pypi:`pytest-fixture-remover` A LibCST codemod to remove pytest fixtures applied via the usefixtures decorator, as well as its parametrizations. Feb 14, 2024 5 - Production/Stable N/A :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) @@ -709,6 +712,7 @@ This list contains 1732 plugins. :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A :pypi:`pytest-greener` Pytest plugin for Greener Oct 18, 2025 N/A pytest<9.0.0,>=8.3.3 + :pypi:`pytest-greet` Oct 21, 2025 N/A N/A :pypi:`pytest-group-by-class` A Pytest plugin for running a subset of your tests by splitting them in to groups of classes. Jun 27, 2023 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) @@ -732,7 +736,7 @@ This list contains 1732 plugins. :pypi:`pytest-history` Pytest plugin to keep a history of your pytest runs Jan 14, 2024 N/A pytest (>=7.4.3,<8.0.0) :pypi:`pytest-home` Home directory fixtures Jul 28, 2024 5 - Production/Stable pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 18, 2025 3 - Alpha pytest==8.4.2 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 25, 2025 3 - Alpha pytest==8.4.2 :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-reloading` Sep 23, 2024 N/A N/A @@ -775,7 +779,7 @@ This list contains 1732 plugins. :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A :pypi:`pytest-iam` A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite Jul 25, 2025 4 - Beta pytest>=7.0.0 - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Sep 26, 2025 4 - Beta pytest + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Oct 21, 2025 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Dec 05, 2023 4 - Beta pytest :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Dec 13, 2023 5 - Production/Stable N/A @@ -821,7 +825,7 @@ This list contains 1732 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-ipynb2` Pytest plugin to run tests in Jupyter Notebooks Mar 09, 2025 N/A pytest - :pypi:`pytest-ipywidgets` Oct 17, 2025 N/A pytest + :pypi:`pytest-ipywidgets` Oct 24, 2025 N/A pytest :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Sep 08, 2025 4 - Beta pytest :pypi:`pytest-isolate-mpi` pytest-isolate-mpi allows for MPI-parallel tests being executed in a segfault and MPI_Abort safe manner Feb 24, 2025 4 - Beta pytest>=5 :pypi:`pytest-isort` py.test plugin to check import ordering using isort Mar 05, 2024 5 - Production/Stable pytest (>=5.0) @@ -854,6 +858,7 @@ This list contains 1732 plugins. :pypi:`pytest-junit-xray-xml` Export test results in an augmented JUnit format for usage with Xray () Jan 01, 2025 4 - Beta pytest :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Oct 16, 2025 4 - Beta pytest>=7.0 :pypi:`pytest-jupyterhub` A reusable JupyterHub pytest plugin Apr 25, 2023 5 - Production/Stable pytest + :pypi:`pytest-jux` A pytest plugin for signing and publishing JUnit XML test reports to the Jux REST API Oct 24, 2025 3 - Alpha pytest>=7.4 :pypi:`pytest-k8s` Kubernetes-based testing for pytest Jul 07, 2025 N/A pytest>=8.4.1 :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 14, 2024 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest @@ -869,7 +874,7 @@ This list contains 1732 plugins. :pypi:`pytest-kookit` Your simple but kooky integration testing with pytest Sep 10, 2024 N/A N/A :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A - :pypi:`pytest-kubernetes` Feb 04, 2025 N/A pytest<9.0.0,>=8.3.0 + :pypi:`pytest-kubernetes` Oct 23, 2025 N/A pytest<9.0.0,>=8.3.0 :pypi:`pytest_kustomize` Parse and validate kustomize output Oct 02, 2025 N/A N/A :pypi:`pytest-kuunda` pytest plugin to help with test data setup for PySpark tests Feb 25, 2024 4 - Beta pytest >=6.2.0 :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) @@ -925,7 +930,7 @@ This list contains 1732 plugins. :pypi:`pytest-logscanner` Pytest plugin for logscanner (A logger for python logging outputting to easily viewable (and filterable) html files. Good for people not grep savey, and color higlighting and quickly changing filters might even bye useful for commandline wizards.) Sep 30, 2024 4 - Beta pytest>=8.2.2 :pypi:`pytest-loguru` Pytest Loguru Mar 20, 2024 5 - Production/Stable pytest; extra == "test" :pypi:`pytest-loop` pytest plugin for looping tests Oct 17, 2024 5 - Production/Stable pytest - :pypi:`pytest-lsp` A pytest plugin for end-to-end testing of language servers Nov 23, 2024 3 - Alpha pytest + :pypi:`pytest-lsp` A pytest plugin for end-to-end testing of language servers Oct 25, 2025 5 - Production/Stable pytest>=8.0 :pypi:`pytest-lw-realtime-result` Pytest plugin to generate realtime test results to a file Mar 13, 2025 N/A pytest>=3.5.0 :pypi:`pytest-manifest` PyTest plugin for recording and asserting against a manifest file Apr 07, 2025 N/A pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha pytest>=7 @@ -960,7 +965,7 @@ This list contains 1732 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Aug 18, 2025 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mergify` Pytest plugin for Mergify Oct 16, 2025 N/A pytest>=6.0.0 + :pypi:`pytest-mergify` Pytest plugin for Mergify Oct 23, 2025 N/A pytest>=6.0.0 :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A @@ -1061,7 +1066,7 @@ This list contains 1732 plugins. :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Feb 26, 2024 5 - Production/Stable N/A :pypi:`pytest-oar` PyTest plugin for the OAR testing framework May 12, 2025 N/A pytest>=6.0.1 - :pypi:`pytest-oarepo` Oct 14, 2025 N/A pytest>=7.1.2; extra == "dev" + :pypi:`pytest-oarepo` Oct 23, 2025 N/A pytest>=7.1.2; extra == "dev" :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odc` A pytest plugin for simplifying ODC database tests Aug 04, 2023 4 - Beta pytest (>=3.5.0) @@ -1156,11 +1161,11 @@ This list contains 1732 plugins. :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A :pypi:`pytest-playwright-visual-snapshot` Easy pytest visual regression testing using playwright Jul 02, 2025 N/A N/A - :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Oct 01, 2025 3 - Alpha pytest + :pypi:`pytest-pl-grader` A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform. Oct 22, 2025 3 - Alpha pytest :pypi:`pytest-plone` Pytest plugin to test Plone addons Jun 11, 2025 3 - Alpha pytest<8.0.0 :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Jan 17, 2024 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plugins` A Python package for managing pytest plugins. Oct 14, 2025 N/A pytest + :pypi:`pytest-plugins` A Python package for managing pytest plugins. Oct 23, 2025 N/A pytest :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Feb 02, 2025 5 - Production/Stable pytest>=7.4.2 :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A :pypi:`pytest-pogo` Pytest plugin for pogo-migrate May 05, 2025 4 - Beta pytest<9,>=7 @@ -1169,6 +1174,7 @@ This list contains 1732 plugins. :pypi:`pytest-polarion-cfme` pytest plugin for collecting test cases and recording test results Nov 13, 2017 3 - Alpha N/A :pypi:`pytest-polarion-collect` pytest plugin for collecting polarion test cases data Jun 18, 2020 3 - Alpha pytest :pypi:`pytest-polecat` Provides Polecat pytest fixtures Aug 12, 2019 4 - Beta N/A + :pypi:`pytest-polymeric-report` A polymeric test report plugin for pytest Oct 20, 2025 N/A N/A :pypi:`pytest-ponyorm` PonyORM in Pytest Oct 31, 2018 N/A pytest (>=3.1.1) :pypi:`pytest-poo` Visualize your crappy tests Mar 25, 2021 5 - Production/Stable pytest (>=2.3.4) :pypi:`pytest-poo-fail` Visualize your failed tests with poo Feb 12, 2015 5 - Production/Stable N/A @@ -1215,7 +1221,7 @@ This list contains 1732 plugins. :pypi:`pytest-pylint` pytest plugin to check source code with pylint Oct 06, 2023 5 - Production/Stable pytest >=7.0 :pypi:`pytest-pylyzer` A pytest plugin for pylyzer Feb 15, 2025 4 - Beta N/A :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A - :pypi:`pytest-pyodide` Pytest plugin for testing applications that use Pyodide Oct 18, 2025 N/A pytest + :pypi:`pytest-pyodide` Pytest plugin for testing applications that use Pyodide Oct 24, 2025 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1266,7 +1272,7 @@ This list contains 1732 plugins. :pypi:`pytest-readme` Test your README.md file Aug 01, 2025 5 - Production/Stable pytest :pypi:`pytest-reana` Pytest fixtures for REANA. Oct 10, 2025 3 - Alpha N/A :pypi:`pytest-recap` Capture your test sessions. Recap the results. Jun 16, 2025 N/A pytest>=6.2.0 - :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Jul 25, 2025 N/A N/A + :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Oct 21, 2025 N/A pytest>=8.4.1 :pypi:`pytest-recording` A pytest plugin powered by VCR.py to record and replay HTTP traffic May 08, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-record-video` 用例执行过程中录制视频 Oct 31, 2024 N/A N/A @@ -1325,7 +1331,7 @@ This list contains 1732 plugins. :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory Sep 18, 2025 5 - Production/Stable pytest>=3.5.0 :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 - :pypi:`pytest-respect` Pytest plugin to load resource files relative to test code and to expect values to match them. Aug 25, 2025 5 - Production/Stable pytest>=8.0.0 + :pypi:`pytest-respect` Pytest plugin to load resource files relative to test code and to expect values to match them. Oct 21, 2025 5 - Production/Stable pytest>=8.0.0 :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) @@ -1343,7 +1349,7 @@ This list contains 1732 plugins. :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Jan 19, 2025 N/A pytest>=7.0.0 :pypi:`pytest-retry-class` A pytest plugin to rerun entire class on failure Nov 24, 2024 N/A pytest>=5.3 :pypi:`pytest-reusable-testcases` Apr 28, 2023 N/A N/A - :pypi:`pytest-revealtype-injector` Pytest plugin for replacing reveal_type() calls inside test functions with static and runtime type checking result comparison, for confirming type annotation validity. Mar 18, 2025 4 - Beta pytest<9,>=7.0 + :pypi:`pytest-revealtype-injector` Pytest plugin for replacing reveal_type() calls inside test functions with static and runtime type checking result comparison, for confirming type annotation validity. Oct 23, 2025 4 - Beta pytest<9,>=7.0 :pypi:`pytest-reverse` Pytest plugin to reverse test order. Sep 09, 2025 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Dec 12, 2024 4 - Beta pytest>=7.0 :pypi:`pytest-richer` Pytest plugin providing a Rich based reporter. Oct 27, 2023 3 - Alpha pytest @@ -1364,7 +1370,7 @@ This list contains 1732 plugins. :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Jun 19, 2025 4 - Beta pytest>=5 :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Sep 25, 2025 4 - Beta pytest>=6.2.0 + :pypi:`pytest-run-parallel` A simple pytest plugin to run tests concurrently Oct 23, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Oct 10, 2025 5 - Production/Stable pytest>=5.0.0 @@ -1381,9 +1387,10 @@ This list contains 1732 plugins. :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A :pypi:`pytest_sauce` pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs Jul 14, 2014 3 - Alpha N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Oct 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Oct 25, 2025 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-scenario-files` A pytest plugin that generates unit test scenarios from data files. Sep 03, 2025 5 - Production/Stable pytest<9,>=7.4 + :pypi:`pytest-scenarios` Add your description here Oct 21, 2025 N/A N/A :pypi:`pytest-schedule` Automate and customize test scheduling effortlessly on local machines. Oct 31, 2024 N/A N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Feb 16, 2024 5 - Production/Stable pytest >=3.5.0 :pypi:`pytest-scim2-server` SCIM2 server fixture for Pytest May 14, 2025 4 - Beta pytest>=8.3.4 @@ -1393,7 +1400,7 @@ This list contains 1732 plugins. :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Feb 01, 2024 5 - Production/Stable pytest>=6.0.0 :pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Nov 07, 2023 N/A pytest >= 7.0.0 - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 17, 2025 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 25, 2025 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-selfie` A pytest plugin for selfie snapshot testing. Dec 16, 2024 N/A pytest>=8.0.0 @@ -1422,7 +1429,7 @@ This list contains 1732 plugins. :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Aug 14, 2023 5 - Production/Stable pytest >=3.5.1 :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-shutil` A goodie-bag of unix shell and environment tools for py.test Nov 29, 2024 5 - Production/Stable pytest - :pypi:`pytest-sigil` Proper fixture resource cleanup by handling signals Oct 08, 2025 N/A pytest<9.0.0,>=8.0.0 + :pypi:`pytest-sigil` Proper fixture resource cleanup by handling signals Oct 21, 2025 N/A pytest<9.0.0,>=7.0.0 :pypi:`pytest-simbind` Pytest plugin to operate with objects generated by Simbind tool. Mar 28, 2024 N/A pytest>=7.0.0 :pypi:`pytest-simplehttpserver` Simple pytest fixture to spin up an HTTP server Jun 24, 2021 4 - Beta N/A :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A @@ -1522,7 +1529,7 @@ This list contains 1732 plugins. :pypi:`pytest-subket` Pytest Plugin to disable socket calls during tests Jul 31, 2025 4 - Beta N/A :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 04, 2025 5 - Production/Stable pytest>=4.0.0 :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jun 13, 2025 4 - Beta pytest>=7.4 + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Oct 20, 2025 4 - Beta pytest>=7.4 :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Sep 17, 2023 N/A pytest (>=2.3) :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Aug 23, 2025 4 - Beta pytest>=6.2.0 :pypi:`pytest-suitemanager` A simple plugin to use with pytest Apr 28, 2023 4 - Beta N/A @@ -1642,6 +1649,7 @@ This list contains 1732 plugins. :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Dec 08, 2023 4 - Beta N/A + :pypi:`pytest-tui-runner` Textual-based terminal UI for running pytest tests Oct 23, 2025 N/A pytest>=8.3.5 :pypi:`pytest-tuitest` pytest plugin for testing TUI and regular command-line applications. Apr 11, 2025 N/A pytest>=7.4.0 :pypi:`pytest-tutorials` Mar 11, 2023 N/A N/A :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A @@ -1670,6 +1678,7 @@ This list contains 1732 plugins. :pypi:`pytest-unordered` Test equality of unordered collections in pytest Jun 03, 2025 4 - Beta pytest>=7.0.0 :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Sep 27, 2022 4 - Beta N/A :pypi:`pytest-unused-fixtures` A pytest plugin to list unused fixtures after a test run. Mar 15, 2025 4 - Beta pytest>7.3.2 + :pypi:`pytest-unused-port` pytest fixture finding an unused local port Oct 22, 2025 N/A pytest :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A :pypi:`pytest-utils` Some helpers for pytest. Feb 02, 2023 4 - Beta pytest (>=7.0.0,<8.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest @@ -1682,7 +1691,7 @@ This list contains 1732 plugins. :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Nov 23, 2023 4 - Beta pytest :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests Nov 29, 2024 5 - Production/Stable pytest - :pypi:`pytest-verify` A pytest plugin for snapshot verification with optional visual diff viewer. Oct 12, 2025 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-verify` A pytest plugin for snapshot verification with optional visual diff viewer. Oct 25, 2025 5 - Production/Stable N/A :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test Nov 29, 2024 5 - Production/Stable pytest :pypi:`pytest-visual` Nov 28, 2024 4 - Beta pytest>=7.0.0 @@ -2031,7 +2040,7 @@ This list contains 1732 plugins. pytest plugin to test case doc string dls instructions :pypi:`pytest-allure-host` - *last release*: Oct 10, 2025, + *last release*: Oct 21, 2025, *status*: 3 - Alpha, *requires*: N/A @@ -2332,7 +2341,7 @@ This list contains 1732 plugins. Pytest Assertions :pypi:`pytest-assert-type` - *last release*: Oct 14, 2025, + *last release*: Oct 20, 2025, *status*: 3 - Alpha, *requires*: pytest>=6.2.0 @@ -2766,7 +2775,7 @@ This list contains 1732 plugins. Pytest plugin to run your tests with beartype checking enabled. :pypi:`pytest-bec-e2e` - *last release*: Oct 15, 2025, + *last release*: Oct 21, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -3192,6 +3201,13 @@ This list contains 1732 plugins. A clean, modern, wrapper for pytest.mark.parametrize + :pypi:`pytest-case-provider` + *last release*: Oct 25, 2025, + *status*: 3 - Alpha, + *requires*: pytest<9,>=8 + + Advanced pytest parametrization plugin that generates test case instances from sync or async factories. + :pypi:`pytest-cases` *last release*: Jun 09, 2025, *status*: 5 - Production/Stable, @@ -3627,7 +3643,7 @@ This list contains 1732 plugins. pytest plugin to run pycodestyle :pypi:`pytest-codspeed` - *last release*: Oct 07, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=3.8 @@ -3690,7 +3706,7 @@ This list contains 1732 plugins. An interactive GUI test runner for PyTest :pypi:`pytest-common-subject` - *last release*: Jun 12, 2024, + *last release*: Oct 22, 2025, *status*: N/A, *requires*: pytest<9,>=3.6 @@ -3906,6 +3922,13 @@ This list contains 1732 plugins. A pytest plugin for colorful print statements + :pypi:`pytest-cream` + *last release*: Oct 25, 2025, + *status*: N/A, + *requires*: pytest + + The cream of test execution - smooth pytest workflows with intelligent orchestration + :pypi:`pytest-create` *last release*: Feb 15, 2023, *status*: 1 - Planning, @@ -4138,7 +4161,7 @@ This list contains 1732 plugins. Data validation and integrity testing for your datasets using pytest. :pypi:`pytest-data-loader` - *last release*: Oct 16, 2025, + *last release*: Oct 22, 2025, *status*: 4 - Beta, *requires*: pytest<9,>=7.0.0 @@ -4326,6 +4349,13 @@ This list contains 1732 plugins. Tests that depend on other tests + :pypi:`pytest-depper` + *last release*: Oct 23, 2025, + *status*: 4 - Beta, + *requires*: pytest>=7.0.0 + + Smart test selection based on AST-level code dependency analysis + :pypi:`pytest-deprecate` *last release*: Jul 01, 2019, *status*: N/A, @@ -4341,9 +4371,9 @@ This list contains 1732 plugins. A simple plugin to use with pytest :pypi:`pytest-describe` - *last release*: Feb 10, 2024, + *last release*: Oct 23, 2025, *status*: 5 - Production/Stable, - *requires*: pytest <9,>=4.6 + *requires*: pytest<9,>=6 Describe-style plugin for pytest @@ -5146,63 +5176,63 @@ This list contains 1732 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-idf` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: Oct 16, 2025, + *last release*: Oct 24, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -5916,9 +5946,9 @@ This list contains 1732 plugins. A pytest plugin to add markers based on fixtures used. :pypi:`pytest-fixture-order` - *last release*: May 16, 2022, + *last release*: Oct 22, 2025, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.0) + *requires*: pytest>=3.0 pytest plugin to control fixture evaluation order @@ -6496,6 +6526,13 @@ This list contains 1732 plugins. Pytest plugin for Greener + :pypi:`pytest-greet` + *last release*: Oct 21, 2025, + *status*: N/A, + *requires*: N/A + + + :pypi:`pytest-group-by-class` *last release*: Jun 27, 2023, *status*: 5 - Production/Stable, @@ -6658,7 +6695,7 @@ This list contains 1732 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Oct 18, 2025, + *last release*: Oct 25, 2025, *status*: 3 - Alpha, *requires*: pytest==8.4.2 @@ -6959,7 +6996,7 @@ This list contains 1732 plugins. A fully functional OAUTH2 / OpenID Connect (OIDC) / SCIM server to be used in your testsuite :pypi:`pytest-ibutsu` - *last release*: Sep 26, 2025, + *last release*: Oct 21, 2025, *status*: 4 - Beta, *requires*: pytest @@ -7281,7 +7318,7 @@ This list contains 1732 plugins. Pytest plugin to run tests in Jupyter Notebooks :pypi:`pytest-ipywidgets` - *last release*: Oct 17, 2025, + *last release*: Oct 24, 2025, *status*: N/A, *requires*: pytest @@ -7511,6 +7548,13 @@ This list contains 1732 plugins. A reusable JupyterHub pytest plugin + :pypi:`pytest-jux` + *last release*: Oct 24, 2025, + *status*: 3 - Alpha, + *requires*: pytest>=7.4 + + A pytest plugin for signing and publishing JUnit XML test reports to the Jux REST API + :pypi:`pytest-k8s` *last release*: Jul 07, 2025, *status*: N/A, @@ -7617,7 +7661,7 @@ This list contains 1732 plugins. pytest krtech common library :pypi:`pytest-kubernetes` - *last release*: Feb 04, 2025, + *last release*: Oct 23, 2025, *status*: N/A, *requires*: pytest<9.0.0,>=8.3.0 @@ -8009,9 +8053,9 @@ This list contains 1732 plugins. pytest plugin for looping tests :pypi:`pytest-lsp` - *last release*: Nov 23, 2024, - *status*: 3 - Alpha, - *requires*: pytest + *last release*: Oct 25, 2025, + *status*: 5 - Production/Stable, + *requires*: pytest>=8.0 A pytest plugin for end-to-end testing of language servers @@ -8254,7 +8298,7 @@ This list contains 1732 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mergify` - *last release*: Oct 16, 2025, + *last release*: Oct 23, 2025, *status*: N/A, *requires*: pytest>=6.0.0 @@ -8961,7 +9005,7 @@ This list contains 1732 plugins. PyTest plugin for the OAR testing framework :pypi:`pytest-oarepo` - *last release*: Oct 14, 2025, + *last release*: Oct 23, 2025, *status*: N/A, *requires*: pytest>=7.1.2; extra == "dev" @@ -9626,7 +9670,7 @@ This list contains 1732 plugins. Easy pytest visual regression testing using playwright :pypi:`pytest-pl-grader` - *last release*: Oct 01, 2025, + *last release*: Oct 22, 2025, *status*: 3 - Alpha, *requires*: pytest @@ -9654,7 +9698,7 @@ This list contains 1732 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plugins` - *last release*: Oct 14, 2025, + *last release*: Oct 23, 2025, *status*: N/A, *requires*: pytest @@ -9716,6 +9760,13 @@ This list contains 1732 plugins. Provides Polecat pytest fixtures + :pypi:`pytest-polymeric-report` + *last release*: Oct 20, 2025, + *status*: N/A, + *requires*: N/A + + A polymeric test report plugin for pytest + :pypi:`pytest-ponyorm` *last release*: Oct 31, 2018, *status*: N/A, @@ -10039,7 +10090,7 @@ This list contains 1732 plugins. Record PyMySQL queries and mock with the stored data. :pypi:`pytest-pyodide` - *last release*: Oct 18, 2025, + *last release*: Oct 24, 2025, *status*: N/A, *requires*: pytest @@ -10396,9 +10447,9 @@ This list contains 1732 plugins. Capture your test sessions. Recap the results. :pypi:`pytest-recorder` - *last release*: Jul 25, 2025, + *last release*: Oct 21, 2025, *status*: N/A, - *requires*: N/A + *requires*: pytest>=8.4.1 Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. @@ -10809,7 +10860,7 @@ This list contains 1732 plugins. Pytest plugin for reporting running time and peak memory usage :pypi:`pytest-respect` - *last release*: Aug 25, 2025, + *last release*: Oct 21, 2025, *status*: 5 - Production/Stable, *requires*: pytest>=8.0.0 @@ -10935,7 +10986,7 @@ This list contains 1732 plugins. :pypi:`pytest-revealtype-injector` - *last release*: Mar 18, 2025, + *last release*: Oct 23, 2025, *status*: 4 - Beta, *requires*: pytest<9,>=7.0 @@ -11082,7 +11133,7 @@ This list contains 1732 plugins. implement a --failed option for pytest :pypi:`pytest-run-parallel` - *last release*: Sep 25, 2025, + *last release*: Oct 23, 2025, *status*: 4 - Beta, *requires*: pytest>=6.2.0 @@ -11201,7 +11252,7 @@ This list contains 1732 plugins. pytest_sauce provides sane and helpful methods worked out in clearcode to run py.test tests with selenium/saucelabs :pypi:`pytest-sbase` - *last release*: Oct 17, 2025, + *last release*: Oct 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11221,6 +11272,13 @@ This list contains 1732 plugins. A pytest plugin that generates unit test scenarios from data files. + :pypi:`pytest-scenarios` + *last release*: Oct 21, 2025, + *status*: N/A, + *requires*: N/A + + Add your description here + :pypi:`pytest-schedule` *last release*: Oct 31, 2024, *status*: N/A, @@ -11285,7 +11343,7 @@ This list contains 1732 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Oct 17, 2025, + *last release*: Oct 25, 2025, *status*: 5 - Production/Stable, *requires*: N/A @@ -11488,9 +11546,9 @@ This list contains 1732 plugins. A goodie-bag of unix shell and environment tools for py.test :pypi:`pytest-sigil` - *last release*: Oct 08, 2025, + *last release*: Oct 21, 2025, *status*: N/A, - *requires*: pytest<9.0.0,>=8.0.0 + *requires*: pytest<9.0.0,>=7.0.0 Proper fixture resource cleanup by handling signals @@ -12188,7 +12246,7 @@ This list contains 1732 plugins. A hack to explicitly set up and tear down fixtures. :pypi:`pytest-subtests` - *last release*: Jun 13, 2025, + *last release*: Oct 20, 2025, *status*: 4 - Beta, *requires*: pytest>=7.4 @@ -13027,6 +13085,13 @@ This list contains 1732 plugins. Text User Interface (TUI) and HTML report for Pytest test runs + :pypi:`pytest-tui-runner` + *last release*: Oct 23, 2025, + *status*: N/A, + *requires*: pytest>=8.3.5 + + Textual-based terminal UI for running pytest tests + :pypi:`pytest-tuitest` *last release*: Apr 11, 2025, *status*: N/A, @@ -13223,6 +13288,13 @@ This list contains 1732 plugins. A pytest plugin to list unused fixtures after a test run. + :pypi:`pytest-unused-port` + *last release*: Oct 22, 2025, + *status*: N/A, + *requires*: pytest + + pytest fixture finding an unused local port + :pypi:`pytest-upload-report` *last release*: Jun 18, 2021, *status*: 5 - Production/Stable, @@ -13308,9 +13380,9 @@ This list contains 1732 plugins. More descriptive output for parametrized py.test tests :pypi:`pytest-verify` - *last release*: Oct 12, 2025, + *last release*: Oct 25, 2025, *status*: 5 - Production/Stable, - *requires*: pytest>=7.0 + *requires*: N/A A pytest plugin for snapshot verification with optional visual diff viewer. From 94534908a0f8295ea1299191c3a321bb9f92ebd4 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 20 Oct 2025 08:48:39 +0300 Subject: [PATCH 182/270] Rename `xfail_strict` to `strict_xfail`, make it an alias This is to make it consistent with the other `strict_` options. For #13823. --- changelog/13823.improvement.rst | 2 ++ doc/en/how-to/skipping.rst | 4 ++-- doc/en/reference/reference.rst | 12 ++++++++---- pyproject.toml | 2 +- src/_pytest/helpconfig.py | 2 +- src/_pytest/skipping.py | 9 +++++---- testing/test_skipping.py | 4 ++-- 7 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 changelog/13823.improvement.rst diff --git a/changelog/13823.improvement.rst b/changelog/13823.improvement.rst new file mode 100644 index 00000000000..f5069366ee9 --- /dev/null +++ b/changelog/13823.improvement.rst @@ -0,0 +1,2 @@ +Added :confval:`strict_xfail` as an alias to the ``xfail_strict`` option. +This makes it consistent with other strictness options. diff --git a/doc/en/how-to/skipping.rst b/doc/en/how-to/skipping.rst index 6584b1c7b24..10c45c23ed2 100644 --- a/doc/en/how-to/skipping.rst +++ b/doc/en/how-to/skipping.rst @@ -331,12 +331,12 @@ You can change this by setting the ``strict`` keyword-only parameter to ``True`` This will make ``XPASS`` ("unexpectedly passing") results from this test to fail the test suite. You can change the default value of the ``strict`` parameter using the -``xfail_strict`` ini option: +``strict_xfail`` ini option: .. code-block:: ini [pytest] - xfail_strict=true + strict_xfail=true Ignoring xfail diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 3dfa11901ea..16c50c217c4 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -261,7 +261,7 @@ pytest.mark.xfail Marks a test function as *expected to fail*. -.. py:function:: pytest.mark.xfail(condition=False, *, reason=None, raises=None, run=True, strict=xfail_strict) +.. py:function:: pytest.mark.xfail(condition=False, *, reason=None, raises=None, run=True, strict=strict_xfail) :keyword Union[bool, str] condition: Condition for marking the test function as xfail (``True/False`` or a @@ -286,7 +286,7 @@ Marks a test function as *expected to fail*. that are always failing and there should be a clear indication if they unexpectedly start to pass (for example a new release of a library fixes a known bug). - Defaults to :confval:`xfail_strict`, which is ``False`` by default. + Defaults to :confval:`strict_xfail`, which is ``False`` by default. Custom marks @@ -2070,7 +2070,7 @@ passed multiple times. The expected format is ``name=value``. For example:: "auto" can be used to explicitly use the global verbosity level. -.. confval:: xfail_strict +.. confval:: strict_xfail If set to ``True``, tests marked with ``@pytest.mark.xfail`` that actually succeed will by default fail the test suite. @@ -2080,7 +2080,11 @@ passed multiple times. The expected format is ``name=value``. For example:: .. code-block:: ini [pytest] - xfail_strict = True + strict_xfail = True + + .. versionchanged:: 9.0 + Renamed from ``xfail_strict`` to ``strict_xfail``. + ``xfail_strict`` is accepted as an alias for ``strict_xfail``. .. confval:: strict_parametrization_ids diff --git a/pyproject.toml b/pyproject.toml index 964c4f449dc..892fd113a73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -378,7 +378,7 @@ norecursedirs = [ "build", "dist", ] -xfail_strict = true +strict_xfail = true strict_parametrization_ids = true filterwarnings = [ "error", diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index 9e06a45ad52..32b807029fb 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -103,7 +103,7 @@ def pytest_addoption(parser: Parser) -> None: dest="override_ini", action="append", help='Override ini option with "option=value" style, ' - "e.g. `-o xfail_strict=True -o cache_dir=cache`.", + "e.g. `-o strict_xfail=True -o cache_dir=cache`.", ) diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index 6ba30c4574c..584e744d369 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -37,11 +37,12 @@ def pytest_addoption(parser: Parser) -> None: ) parser.addini( - "xfail_strict", + "strict_xfail", "Default for the strict parameter of xfail " - "markers when not given explicitly (default: False)", + "markers when not given explicitly (default: False) (alias: xfail_strict)", default=False, type="bool", + aliases=["xfail_strict"], ) @@ -74,7 +75,7 @@ def nop(*args, **kwargs): ) config.addinivalue_line( "markers", - "xfail(condition, ..., *, reason=..., run=True, raises=None, strict=xfail_strict): " + "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. " @@ -213,7 +214,7 @@ def evaluate_xfail_marks(item: Item) -> Xfail | None: """Evaluate xfail marks on item, returning Xfail if triggered.""" for mark in item.iter_markers(name="xfail"): run = mark.kwargs.get("run", True) - strict = mark.kwargs.get("strict", item.config.getini("xfail_strict")) + strict = mark.kwargs.get("strict", item.config.getini("strict_xfail")) raises = mark.kwargs.get("raises", None) if "condition" not in mark.kwargs: conditions = mark.args diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 558e3656524..c1f5868d4a4 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -690,7 +690,7 @@ def test_strict_xfail_default_from_file( pytester.makeini( f""" [pytest] - xfail_strict = {strict_val} + strict_xfail = {strict_val} """ ) p = pytester.makepyfile( @@ -1178,7 +1178,7 @@ def test_default_markers(pytester: Pytester) -> None: result.stdout.fnmatch_lines( [ "*skipif(condition, ..., [*], reason=...)*skip*", - "*xfail(condition, ..., [*], reason=..., run=True, raises=None, strict=xfail_strict)*expected failure*", + "*xfail(condition, ..., [*], reason=..., run=True, raises=None, strict=strict_xfail)*expected failure*", ] ) From efa9eff5831658f765d4d7590a91ac2f0ff12fa2 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 20 Oct 2025 09:15:09 +0300 Subject: [PATCH 183/270] Add `strict_config`, `strict_markers` ini options, same as CLI flags We want to have ini versions of all strictness flags, since they're usually more sensible as project configuration, and as preparation for adding the `strict` ini option. Refs #13823. --- changelog/13823.improvement.rst | 6 +++-- doc/en/example/markers.rst | 3 +-- doc/en/how-to/mark.rst | 6 ++--- doc/en/reference/reference.rst | 31 ++++++++++++++++----- pyproject.toml | 4 ++- src/_pytest/config/__init__.py | 3 ++- src/_pytest/config/argparsing.py | 37 ++++++++++++++++++++++++++ src/_pytest/main.py | 29 +++++++++++++++----- src/_pytest/mark/structures.py | 5 +++- testing/plugins_integration/pytest.ini | 2 +- testing/test_config.py | 13 +++++++++ testing/test_mark.py | 15 +++++++++-- 12 files changed, 128 insertions(+), 26 deletions(-) diff --git a/changelog/13823.improvement.rst b/changelog/13823.improvement.rst index f5069366ee9..4346d702c8c 100644 --- a/changelog/13823.improvement.rst +++ b/changelog/13823.improvement.rst @@ -1,2 +1,4 @@ -Added :confval:`strict_xfail` as an alias to the ``xfail_strict`` option. -This makes it consistent with other strictness options. +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/doc/en/example/markers.rst b/doc/en/example/markers.rst index babcd9e2f3a..071869c07b4 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -286,8 +286,7 @@ For an example on how to add and work with markers from a plugin, see * Asking for existing markers via ``pytest --markers`` gives good output - * Typos in function markers are treated as an error if you use - the ``--strict-markers`` option. + * Typos in function markers are treated as an error if you use the :confval:`strict_markers` configuration option. .. _`scoped-marking`: diff --git a/doc/en/how-to/mark.rst b/doc/en/how-to/mark.rst index 33f9d18bfe3..40ee14c36fd 100644 --- a/doc/en/how-to/mark.rst +++ b/doc/en/how-to/mark.rst @@ -80,14 +80,14 @@ surprising due to mistyped names. As described in the previous section, you can the warning for custom marks by registering them in your ``pytest.ini`` file or using a custom ``pytest_configure`` hook. -When the ``--strict-markers`` command-line flag is passed, any unknown marks applied +When the :confval:`strict_markers` ini option is set, any unknown marks applied with the ``@pytest.mark.name_of_the_mark`` decorator will trigger an error. You can -enforce this validation in your project by adding ``--strict-markers`` to ``addopts``: +enforce this validation in your project by setting :confval:`strict_markers` in your configuration: .. code-block:: ini [pytest] - addopts = --strict-markers + strict_markers = True markers = slow: marks tests as slow (deselect with '-m "not slow"') serial diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 16c50c217c4..241ba94e9d8 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1774,25 +1774,21 @@ passed multiple times. The expected format is ``name=value``. For example:: .. confval:: markers - When the ``--strict-markers`` or ``--strict`` command-line arguments are used, + When the :confval:`strict_markers` configuration option is set, only known markers - defined in code by core pytest or some plugin - are allowed. You can list additional markers in this setting to add them to the whitelist, - in which case you probably want to add ``--strict-markers`` to ``addopts`` + in which case you probably want to set :confval:`strict_markers` to ``True`` to avoid future regressions: .. code-block:: ini [pytest] - addopts = --strict-markers + strict_markers = True markers = slow serial - .. note:: - The use of ``--strict-markers`` is highly preferred. ``--strict`` was kept for - backward compatibility only and may be confusing for others as it only applies to - markers and not to other options. .. confval:: minversion @@ -2086,6 +2082,27 @@ passed multiple times. The expected format is ``name=value``. For example:: Renamed from ``xfail_strict`` to ``strict_xfail``. ``xfail_strict`` is accepted as an alias for ``strict_xfail``. + +.. confval:: strict_config + + If set to ``True``, any warnings encountered while parsing the ``pytest`` section of the configuration file will raise errors. + + .. code-block:: ini + + [pytest] + strict_config = True + + +.. confval:: strict_markers + + If set to ``True``, markers not registered in the ``markers`` section of the configuration file will raise errors. + + .. code-block:: ini + + [pytest] + strict_markers = True + + .. confval:: strict_parametrization_ids If set, pytest emits an error if it detects non-unique parameter set IDs. diff --git a/pyproject.toml b/pyproject.toml index 892fd113a73..9f7a590b977 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -355,7 +355,7 @@ max_supported_python = "3.14" [tool.pytest.ini_options] minversion = "2.0" -addopts = "-rfEX -p pytester --strict-markers" +addopts = "-rfEX -p pytester" python_files = [ "test_*.py", "*_test.py", @@ -380,6 +380,8 @@ norecursedirs = [ ] strict_xfail = true strict_parametrization_ids = true +strict_markers = true +strict_config = true filterwarnings = [ "error", "default:Using or importing the ABCs:DeprecationWarning:unittest2.*", diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 29fe7d5dcbe..a17c576f064 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1515,7 +1515,8 @@ def _validate_plugins(self) -> None: ) def _warn_or_fail_if_strict(self, message: str) -> None: - if self.known_args_namespace.strict_config: + strict_config = self.getini("strict_config") + if strict_config: raise UsageError(message) self.issue_config_time_warning(PytestConfigWarning(message), stacklevel=3) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index e6e89e03a6b..67b89bbbb16 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -547,3 +547,40 @@ def _split_lines(self, text, width): for line in text.splitlines(): lines.extend(textwrap.wrap(line.strip(), width)) return lines + + +class OverrideIniAction(argparse.Action): + """Custom argparse action that makes a CLI flag equivalent to overriding an + option, in addition to behaving like `store_true`. + + This can simplify things since code only needs to inspect the ini option + and not consider the CLI flag. + """ + + def __init__( + self, + option_strings: Sequence[str], + dest: str, + nargs: int | str | None = None, + *args, + ini_option: str, + ini_value: str, + **kwargs, + ) -> None: + super().__init__(option_strings, dest, 0, *args, **kwargs) + self.ini_option = ini_option + self.ini_value = ini_value + + def __call__( + self, + parser: argparse.ArgumentParser, + namespace: argparse.Namespace, + *args, + **kwargs, + ) -> None: + setattr(namespace, self.dest, True) + current_overrides = getattr(namespace, "override_ini", None) + if current_overrides is None: + current_overrides = [] + current_overrides.append(f"{self.ini_option}={self.ini_value}") + setattr(namespace, "override_ini", current_overrides) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 893dee90e84..1a963718edd 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -32,6 +32,7 @@ from _pytest.config import hookimpl from _pytest.config import PytestPluginManager from _pytest.config import UsageError +from _pytest.config.argparsing import OverrideIniAction from _pytest.config.argparsing import Parser from _pytest.config.compat import PathAwareHookProxy from _pytest.outcomes import exit @@ -75,21 +76,37 @@ def pytest_addoption(parser: Parser) -> None: ) group.addoption( "--strict-config", - action="store_true", - help="Any warnings encountered while parsing the `pytest` section of the " - "configuration file raise errors", + action=OverrideIniAction, + ini_option="strict_config", + ini_value="true", + help="Enables the strict_config option", ) group.addoption( "--strict-markers", - action="store_true", - help="Markers not registered in the `markers` section of the configuration " - "file raise errors", + action=OverrideIniAction, + ini_option="strict_markers", + ini_value="true", + help="Enables the strict_markers option", ) group.addoption( "--strict", action="store_true", help="(Deprecated) alias to --strict-markers", ) + parser.addini( + "strict_config", + "Any warnings encountered while parsing the `pytest` section of the " + "configuration file raise errors", + type="bool", + default=False, + ) + parser.addini( + "strict_markers", + "Markers not registered in the `markers` section of the configuration " + "file raise errors", + type="bool", + default=False, + ) group = parser.getgroup("pytest-warnings") group.addoption( diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index d0280e26945..f3a29c667be 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -580,7 +580,10 @@ def __getattr__(self, name: str) -> MarkDecorator: # If the name is not in the set of known marks after updating, # then it really is time to issue a warning or an error. if name not in self._markers: - if self._config.option.strict_markers or self._config.option.strict: + strict_markers = ( + self._config.getini("strict_markers") or self._config.option.strict + ) + if strict_markers: fail( f"{name!r} not found in `markers` configuration option", pytrace=False, diff --git a/testing/plugins_integration/pytest.ini b/testing/plugins_integration/pytest.ini index 86058fbbac8..b0eb9c3806f 100644 --- a/testing/plugins_integration/pytest.ini +++ b/testing/plugins_integration/pytest.ini @@ -1,5 +1,5 @@ [pytest] -addopts = --strict-markers +strict_markers = True asyncio_mode = strict filterwarnings = error::pytest.PytestWarning diff --git a/testing/test_config.py b/testing/test_config.py index cd8ed6b01d4..8a7262f503b 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -355,6 +355,19 @@ def test_silence_unknown_key_warning(self, pytester: Pytester) -> None: result = pytester.runpytest() result.stdout.no_fnmatch_line("*PytestConfigWarning*") + def test_strict_config_ini_option(self, pytester: Pytester) -> None: + """Test that strict_config ini option works.""" + pytester.makeini( + """ + [pytest] + unknown_option = 1 + strict_config = True + """ + ) + result = pytester.runpytest() + result.stderr.fnmatch_lines("ERROR: Unknown config option: unknown_option") + assert result.ret == pytest.ExitCode.USAGE_ERROR + @pytest.mark.filterwarnings("default::pytest.PytestConfigWarning") def test_disable_warnings_plugin_disables_config_warnings( self, pytester: Pytester diff --git a/testing/test_mark.py b/testing/test_mark.py index ad86a9695b0..a3adbf29322 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -183,7 +183,9 @@ def test_hello(): reprec.assertoutcome(passed=1) -@pytest.mark.parametrize("option_name", ["--strict-markers", "--strict"]) +@pytest.mark.parametrize( + "option_name", ["--strict-markers", "--strict", "strict_markers"] +) def test_strict_prohibits_unregistered_markers( pytester: Pytester, option_name: str ) -> None: @@ -195,7 +197,16 @@ def test_hello(): pass """ ) - result = pytester.runpytest(option_name) + if option_name == "strict_markers": + pytester.makeini( + """ + [pytest] + strict_markers = true + """ + ) + result = pytester.runpytest() + else: + result = pytester.runpytest(option_name) assert result.ret != 0 result.stdout.fnmatch_lines( ["'unregisteredmark' not found in `markers` configuration option"] From 95204ed276bd061ef3fe5295fc1bbffb0c2e245d Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 22 Oct 2025 15:51:42 +0300 Subject: [PATCH 184/270] mark: enable "parametrize" misspelling error even in strict_markers mode I figure the misspelling error is better than the "not found in `markers`" error. --- src/_pytest/mark/structures.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index f3a29c667be..413ae74c176 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -580,6 +580,11 @@ def __getattr__(self, name: str) -> MarkDecorator: # If the name is not in the set of known marks after updating, # then it really is time to issue a warning or an error. if name not in self._markers: + # Raise a specific error for common misspellings of "parametrize". + if name in ["parameterize", "parametrise", "parameterise"]: + __tracebackhide__ = True + fail(f"Unknown '{name}' mark, did you mean 'parametrize'?") + strict_markers = ( self._config.getini("strict_markers") or self._config.option.strict ) @@ -589,11 +594,6 @@ def __getattr__(self, name: str) -> MarkDecorator: pytrace=False, ) - # Raise a specific error for common misspellings of "parametrize". - if name in ["parameterize", "parametrise", "parameterise"]: - __tracebackhide__ = True - fail(f"Unknown '{name}' mark, did you mean 'parametrize'?") - warnings.warn( f"Unknown pytest.mark.{name} - is this a typo? You can register " "custom marks to avoid this warning - for details, see " From d79af500bf13c3d50dd89793c69304cf448f3210 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 23 Oct 2025 13:25:28 +0300 Subject: [PATCH 185/270] Add `strict` ini option to enable all other strictness options The `--strict` option is undeprecated and enables `strict`. Fix #13823. --- changelog/13823.feature.rst | 10 ++++++++++ doc/en/deprecations.rst | 16 +++++++++------- doc/en/reference/reference.rst | 34 ++++++++++++++++++++++++++++++++++ pyproject.toml | 5 +---- src/_pytest/config/__init__.py | 2 ++ src/_pytest/main.py | 17 ++++++++++++++--- src/_pytest/mark/structures.py | 6 +++--- src/_pytest/python.py | 13 +++++++++---- src/_pytest/skipping.py | 9 +++++++-- testing/test_collection.py | 6 ++++-- testing/test_config.py | 11 +++++++---- testing/test_mark.py | 8 ++++---- testing/test_skipping.py | 5 +++-- 13 files changed, 107 insertions(+), 35 deletions(-) create mode 100644 changelog/13823.feature.rst diff --git a/changelog/13823.feature.rst b/changelog/13823.feature.rst new file mode 100644 index 00000000000..15586d70663 --- /dev/null +++ b/changelog/13823.feature.rst @@ -0,0 +1,10 @@ +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_xfail`, and :confval:`strict_parametrization_ids`. + +The individual strictness options can be explicitly set to override the global :confval:`strict` setting. + +If new strictness options are added in the future, they will also be automatically enabled by :confval:`strict`. +Therefore, we only recommend setting ``strict=True`` if you're using a locked version of pytest, +or if you want to proactively adopt new strictness options as they are added. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index e129dd931a9..790e1d89f29 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -589,18 +589,20 @@ removed in pytest 8 (deprecated since pytest 2.4.0): - ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead. -The ``--strict`` command-line option -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The ``--strict`` command-line option (reintroduced) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. deprecated:: 6.2 -.. versionremoved:: 8.0 +.. versionchanged:: 9.0 -The ``--strict`` command-line option has been deprecated in favor of ``--strict-markers``, which +The ``--strict`` command-line option had been deprecated in favor of ``--strict-markers``, which better conveys what the option does. -We have plans to maybe in the future to reintroduce ``--strict`` and make it an encompassing -flag for all strictness related options (``--strict-markers`` and ``--strict-config`` -at the moment, more might be introduced in the future). +In version 8.1, we accidentally un-deprecated ``--strict``. + +In version 9.0, we changed ``--strict`` to make it set the new :confval:`strict` +configuration option. It now enables all strictness related options (including +:confval:`strict_markers`). .. _cmdline-preparse-deprecated: diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 241ba94e9d8..d5f8716d7b4 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -2066,6 +2066,32 @@ passed multiple times. The expected format is ``name=value``. For example:: "auto" can be used to explicitly use the global verbosity level. +.. confval:: strict + + If set to ``True``, enables all strictness options: + + * :confval:`strict_config` + * :confval:`strict_markers` + * :confval:`strict_xfail` + * :confval:`strict_parametrization_ids` + + Plugins may also enable their own strictness options. + + If you explicitly set an individual strictness option, it takes precedence over ``strict``. + + .. note:: + If new strictness options are added to pytest in the future, they will also be enabled by ``strict``. + We therefore only recommend using this option when using a locked version of pytest, + or if you want to proactively adopt new strictness options as they are added. + + .. code-block:: ini + + [pytest] + strict = True + + .. versionadded:: 9.0 + + .. confval:: strict_xfail If set to ``True``, tests marked with ``@pytest.mark.xfail`` that actually succeed will by default fail the @@ -2078,6 +2104,8 @@ passed multiple times. The expected format is ``name=value``. For example:: [pytest] strict_xfail = True + You can also enable this option via the :confval:`strict` option. + .. versionchanged:: 9.0 Renamed from ``xfail_strict`` to ``strict_xfail``. ``xfail_strict`` is accepted as an alias for ``strict_xfail``. @@ -2092,6 +2120,8 @@ passed multiple times. The expected format is ``name=value``. For example:: [pytest] strict_config = True + You can also enable this option via the :confval:`strict` option. + .. confval:: strict_markers @@ -2102,6 +2132,8 @@ passed multiple times. The expected format is ``name=value``. For example:: [pytest] strict_markers = True + You can also enable this option via the :confval:`strict` option. + .. confval:: strict_parametrization_ids @@ -2115,6 +2147,8 @@ passed multiple times. The expected format is ``name=value``. For example:: [pytest] strict_parametrization_ids = True + You can also enable this option via the :confval:`strict` option. + For example, .. code-block:: python diff --git a/pyproject.toml b/pyproject.toml index 9f7a590b977..09c3146d792 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -378,10 +378,7 @@ norecursedirs = [ "build", "dist", ] -strict_xfail = true -strict_parametrization_ids = true -strict_markers = true -strict_config = true +strict = true filterwarnings = [ "error", "default:Using or importing the ABCs:DeprecationWarning:unittest2.*", diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index a17c576f064..e6d34ffc5c4 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1516,6 +1516,8 @@ def _validate_plugins(self) -> None: def _warn_or_fail_if_strict(self, message: str) -> None: strict_config = self.getini("strict_config") + if strict_config is None: + strict_config = self.getini("strict") if strict_config: raise UsageError(message) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 1a963718edd..54944677891 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -90,21 +90,32 @@ def pytest_addoption(parser: Parser) -> None: ) group.addoption( "--strict", - action="store_true", - help="(Deprecated) alias to --strict-markers", + action=OverrideIniAction, + ini_option="strict", + ini_value="true", + help="Enables the strict option", ) parser.addini( "strict_config", "Any warnings encountered while parsing the `pytest` section of the " "configuration file raise errors", type="bool", - default=False, + # None => fallback to `strict`. + default=None, ) parser.addini( "strict_markers", "Markers not registered in the `markers` section of the configuration " "file raise errors", type="bool", + # None => fallback to `strict`. + default=None, + ) + parser.addini( + "strict", + "Enables all strictness options, currently: " + "strict_config, strict_markers, strict_xfail, strict_parametrization_ids", + type="bool", default=False, ) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 413ae74c176..7c3764697c6 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -585,9 +585,9 @@ def __getattr__(self, name: str) -> MarkDecorator: __tracebackhide__ = True fail(f"Unknown '{name}' mark, did you mean 'parametrize'?") - strict_markers = ( - self._config.getini("strict_markers") or self._config.option.strict - ) + strict_markers = self._config.getini("strict_markers") + if strict_markers is None: + strict_markers = self._config.getini("strict") if strict_markers: fail( f"{name!r} not found in `markers` configuration option", diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 4dbf1cc8775..67b1c0474f7 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -24,6 +24,7 @@ import textwrap import types from typing import Any +from typing import cast from typing import final from typing import Literal from typing import NoReturn @@ -111,7 +112,8 @@ def pytest_addoption(parser: Parser) -> None: parser.addini( "strict_parametrization_ids", type="bool", - default=False, + # None => fallback to `strict`. + default=None, help="Emit an error if non-unique parameter set IDs are detected", ) @@ -963,9 +965,12 @@ def make_unique_parameterset_ids(self) -> list[str | _HiddenParam]: return resolved_ids def _strict_parametrization_ids_enabled(self) -> bool: - if self.config: - return bool(self.config.getini("strict_parametrization_ids")) - return False + if self.config is None: + return False + strict_parametrization_ids = self.config.getini("strict_parametrization_ids") + if strict_parametrization_ids is None: + strict_parametrization_ids = self.config.getini("strict") + return cast(bool, strict_parametrization_ids) def _resolve_ids(self) -> Iterable[str | _HiddenParam]: """Resolve IDs for all ParameterSets (may contain duplicates).""" diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index 584e744d369..3b067629de0 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -40,8 +40,9 @@ def pytest_addoption(parser: Parser) -> None: "strict_xfail", "Default for the strict parameter of xfail " "markers when not given explicitly (default: False) (alias: xfail_strict)", - default=False, type="bool", + # None => fallback to `strict`. + default=None, aliases=["xfail_strict"], ) @@ -214,7 +215,11 @@ def evaluate_xfail_marks(item: Item) -> Xfail | None: """Evaluate xfail marks on item, returning Xfail if triggered.""" for mark in item.iter_markers(name="xfail"): run = mark.kwargs.get("run", True) - strict = mark.kwargs.get("strict", item.config.getini("strict_xfail")) + strict = mark.kwargs.get("strict") + if strict is None: + strict = item.config.getini("strict_xfail") + if strict is None: + strict = item.config.getini("strict") raises = mark.kwargs.get("raises", None) if "condition" not in mark.kwargs: conditions = mark.args diff --git a/testing/test_collection.py b/testing/test_collection.py index 153811dea3e..cd8e13c8790 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -2726,15 +2726,17 @@ def test_1(): pass ), ], ) +@pytest.mark.parametrize("option_name", ["strict_parametrization_ids", "strict"]) def test_strict_parametrization_ids( pytester: Pytester, x_y: Sequence[tuple[int, int]], expected_duplicates: Sequence[str], + option_name: str, ) -> None: pytester.makeini( - """ + f""" [pytest] - strict_parametrization_ids = true + {option_name} = true """ ) pytester.makepyfile( diff --git a/testing/test_config.py b/testing/test_config.py index 8a7262f503b..01907132cd1 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -355,13 +355,16 @@ def test_silence_unknown_key_warning(self, pytester: Pytester) -> None: result = pytester.runpytest() result.stdout.no_fnmatch_line("*PytestConfigWarning*") - def test_strict_config_ini_option(self, pytester: Pytester) -> None: - """Test that strict_config ini option works.""" + @pytest.mark.parametrize("option_name", ["strict_config", "strict"]) + def test_strict_config_ini_option( + self, pytester: Pytester, option_name: str + ) -> None: + """Test that strict_config and strict ini options enable strict config checking.""" pytester.makeini( - """ + f""" [pytest] unknown_option = 1 - strict_config = True + {option_name} = True """ ) result = pytester.runpytest() diff --git a/testing/test_mark.py b/testing/test_mark.py index a3adbf29322..8d76ea310eb 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -184,7 +184,7 @@ def test_hello(): @pytest.mark.parametrize( - "option_name", ["--strict-markers", "--strict", "strict_markers"] + "option_name", ["--strict-markers", "--strict", "strict_markers", "strict"] ) def test_strict_prohibits_unregistered_markers( pytester: Pytester, option_name: str @@ -197,11 +197,11 @@ def test_hello(): pass """ ) - if option_name == "strict_markers": + if option_name in ("strict_markers", "strict"): pytester.makeini( - """ + f""" [pytest] - strict_markers = true + {option_name} = true """ ) result = pytester.runpytest() diff --git a/testing/test_skipping.py b/testing/test_skipping.py index c1f5868d4a4..e1e25e45468 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -684,13 +684,14 @@ def test_foo(): assert result.ret == 0 @pytest.mark.parametrize("strict_val", ["true", "false"]) + @pytest.mark.parametrize("option_name", ["strict_xfail", "strict"]) def test_strict_xfail_default_from_file( - self, pytester: Pytester, strict_val + self, pytester: Pytester, strict_val: str, option_name: str ) -> None: pytester.makeini( f""" [pytest] - strict_xfail = {strict_val} + {option_name} = {strict_val} """ ) p = pytester.makepyfile( From 18fbe172634f77cd1ccf2d8de3511fe57f87be59 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 26 Oct 2025 20:16:40 +0200 Subject: [PATCH 186/270] doc/reference: add a couple of missing confval entries --- doc/en/how-to/logging.rst | 2 +- doc/en/reference/reference.rst | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index 300e9f6e6c2..a40aeb1cbe0 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -230,7 +230,7 @@ option names are: * ``log_file_date_format`` You can call ``set_log_path()`` to customize the log_file path dynamically. This functionality -is considered **experimental**. Note that ``set_log_path()`` respects the ``log_file_mode`` option. +is considered **experimental**. Note that ``set_log_path()`` respects the :confval:`log_file_mode` option. .. _log_colors: diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index d5f8716d7b4..764663fc12e 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1470,6 +1470,19 @@ passed multiple times. The expected format is ``name=value``. For example:: as this is considered less error prone, see :issue:`3155` for more details. +.. confval:: enable_assertion_pass_hook + + Enables the :hook:`pytest_assertion_pass` hook. + Make sure to delete any previously generated ``.pyc`` cache files. + + .. tab:: ini + + .. code-block:: ini + + [pytest] + enable_assertion_pass_hook = true + + .. confval:: faulthandler_timeout Dumps the tracebacks of all threads if a test takes longer than ``X`` seconds to run (including @@ -1702,6 +1715,21 @@ passed multiple times. The expected format is ``name=value``. For example:: For more information, see :ref:`logging`. +.. confval:: log_file_mode + + Sets the mode that the logging file is opened with. + The options are ``"w"`` to recreate the file (the default) or ``"a"`` to append to the file. + + .. tab:: ini + + .. code-block:: ini + + [pytest] + log_file_mode = a + + For more information, see :ref:`logging`. + + .. confval:: log_file_date_format From cc400d1fba5ca6ce0421880166d0a2948454f6ff Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 26 Oct 2025 18:11:26 +0200 Subject: [PATCH 187/270] config: consider empty .pytest.ini as config file Fix #13849. --- changelog/13849.bugfix.rst | 2 ++ src/_pytest/config/findpaths.py | 2 +- testing/test_config.py | 11 +++++++---- testing/test_findpaths.py | 5 +++-- 4 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 changelog/13849.bugfix.rst diff --git a/changelog/13849.bugfix.rst b/changelog/13849.bugfix.rst new file mode 100644 index 00000000000..cdcc7b83591 --- /dev/null +++ b/changelog/13849.bugfix.rst @@ -0,0 +1,2 @@ +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/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index db0b829a530..5b190d3174b 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -68,7 +68,7 @@ def load_config_dict_from_file( } else: # "pytest.ini" files are always the source of configuration, even if empty. - if filepath.name == "pytest.ini": + if filepath.name in {"pytest.ini", ".pytest.ini"}: return {} # '.cfg' files are considered if they contain a "[tool:pytest]" section. diff --git a/testing/test_config.py b/testing/test_config.py index 01907132cd1..34fab5272e8 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1826,13 +1826,16 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: assert parsed_inipath == inipath assert ini_config["x"] == ConfigValue("10", origin="file") - @pytest.mark.parametrize("name", ["setup.cfg", "tox.ini"]) - def test_pytestini_overrides_empty_other(self, tmp_path: Path, name: str) -> None: - inipath = tmp_path / "pytest.ini" + @pytest.mark.parametrize("pytest_ini", ["pytest.ini", ".pytest.ini"]) + @pytest.mark.parametrize("other", ["setup.cfg", "tox.ini"]) + def test_pytestini_overrides_empty_other( + self, tmp_path: Path, pytest_ini: str, other: str + ) -> None: + inipath = tmp_path / pytest_ini inipath.touch() a = tmp_path / "a" a.mkdir() - (a / name).touch() + (a / other).touch() rootpath, parsed_inipath, *_ = determine_setup( inifile=None, override_ini=None, diff --git a/testing/test_findpaths.py b/testing/test_findpaths.py index e8e70f9c6fb..0ed53a02418 100644 --- a/testing/test_findpaths.py +++ b/testing/test_findpaths.py @@ -15,9 +15,10 @@ class TestLoadConfigDictFromFile: - def test_empty_pytest_ini(self, tmp_path: Path) -> None: + @pytest.mark.parametrize("filename", ["pytest.ini", ".pytest.ini"]) + def test_empty_pytest_ini(self, tmp_path: Path, filename: str) -> None: """pytest.ini files are always considered for configuration, even if empty""" - fn = tmp_path / "pytest.ini" + fn = tmp_path / filename fn.write_text("", encoding="utf-8") assert load_config_dict_from_file(fn) == {} From 9fc738c5a97d2ab14bd43029204252fe4799230d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 05:08:50 +0100 Subject: [PATCH 188/270] build(deps): Bump actions/download-artifact from 5 to 6 (#13850) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 00d7b4125a1..eb3940b6fef 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -50,7 +50,7 @@ jobs: persist-credentials: true - name: Download Package - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v6 with: name: Packages path: dist @@ -86,7 +86,7 @@ jobs: persist-credentials: false - name: Download Package - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v6 with: name: Packages path: dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6b27572aae0..fbee593f7c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -256,7 +256,7 @@ jobs: persist-credentials: false - name: Download Package - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v6 with: name: Packages path: dist From 147467db1cd00cdb5e1e56b954bd2cf95ddedf4b Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 24 Oct 2025 22:44:03 +0300 Subject: [PATCH 189/270] config: generalize from INI format This prepares the code and documentation for adding another configuration file format, TOML. Add a `mode` field to `ConfigValue` to track the parsing mode. Add tabs to all configuration file snippets in the docs, so that we may show both toml and ini in a nice way once toml is added. Uses the sphinx-inline-tabs package that I saw used by tox documentation. Avoid references to "pytest.ini" and "ini file" in docs, instead refer to "configuration file" (I'm sure I missed some). --- doc/en/conf.py | 1 + doc/en/deprecations.rst | 18 +- doc/en/example/markers.rst | 13 +- doc/en/example/pythoncollection.rst | 57 ++-- doc/en/example/simple.rst | 11 +- doc/en/explanation/goodpractices.rst | 22 +- doc/en/how-to/capture-warnings.rst | 48 ++- doc/en/how-to/doctest.rst | 30 +- doc/en/how-to/fixtures.rst | 11 +- doc/en/how-to/logging.rst | 54 ++-- doc/en/how-to/mark.rst | 40 ++- doc/en/how-to/output.rst | 28 +- doc/en/how-to/parametrize.rst | 10 +- doc/en/how-to/plugins.rst | 18 +- doc/en/how-to/skipping.rst | 8 +- doc/en/how-to/writing_plugins.rst | 11 +- doc/en/reference/customize.rst | 89 +++--- doc/en/reference/reference.rst | 419 ++++++++++++++++----------- doc/en/requirements.txt | 1 + src/_pytest/config/__init__.py | 73 +++-- src/_pytest/config/argparsing.py | 26 +- src/_pytest/config/findpaths.py | 22 +- src/_pytest/fixtures.py | 2 +- src/_pytest/helpconfig.py | 4 +- src/_pytest/hookspec.py | 18 +- src/_pytest/python.py | 2 +- testing/logging/test_reporting.py | 3 +- testing/test_collection.py | 2 +- testing/test_config.py | 24 +- testing/test_conftest.py | 2 +- testing/test_doctest.py | 4 +- testing/test_findpaths.py | 22 +- testing/test_python_path.py | 4 +- testing/test_terminal.py | 2 +- testing/test_warnings.py | 2 +- 35 files changed, 625 insertions(+), 476 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index c89e14d07fa..81156493131 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -34,6 +34,7 @@ "sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx_removed_in", + "sphinx_inline_tabs", "sphinxcontrib_trio", "sphinxcontrib.towncrier.ext", # provides `towncrier-draft-entries` directive "sphinx_issues", # implements `:issue:`, `:pr:` and other GH-related roles diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 790e1d89f29..af8bc4108a6 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -845,20 +845,24 @@ that manipulate this type of file (for example, Jenkins, Azure Pipelines, etc.). Users are recommended to try the new ``xunit2`` format and see if their tooling that consumes the JUnit XML file supports it. -To use the new format, update your ``pytest.ini``: +To use the new format, update your configuration file: -.. code-block:: ini +.. tab:: ini - [pytest] - junit_family=xunit2 + .. code-block:: ini + + [pytest] + junit_family = xunit2 If you discover that your tooling does not support the new format, and want to keep using the legacy version, set the option to ``legacy`` instead: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - [pytest] - junit_family=legacy + [pytest] + junit_family = legacy By using ``legacy`` you will keep using the legacy/xunit1 format when upgrading to pytest 6.0, where the default format will be ``xunit2``. diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 071869c07b4..944047c583d 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -239,13 +239,14 @@ Registering markers Registering markers for your test suite is simple: -.. code-block:: ini +.. tab:: ini - # content of pytest.ini - [pytest] - markers = - webtest: mark a test as a webtest. - slow: mark test as slow. + .. code-block:: ini + + [pytest] + markers = + webtest: mark a test as a webtest. + slow: mark test as slow. Multiple custom markers can be registered, by defining each one in its own line, as shown in above example. diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 9aada00345a..e0020384864 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -88,13 +88,14 @@ Example: Changing directory recursion ----------------------------------------------------- -You can set the :confval:`norecursedirs` option in an ini-file, for example your ``pytest.ini`` in the project root directory: +You can set the :confval:`norecursedirs` option in a configuration file: -.. code-block:: ini +.. tab:: ini - # content of pytest.ini - [pytest] - norecursedirs = .svn _build tmp* + .. code-block:: ini + + [pytest] + norecursedirs = .svn _build tmp* This would tell ``pytest`` to not recurse into typical subversion or sphinx-build directories or into any ``tmp`` prefixed directory. @@ -108,14 +109,15 @@ the :confval:`python_files`, :confval:`python_classes` and :confval:`python_functions` in your :ref:`configuration file `. Here is an example: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - # content of pytest.ini - # Example 1: have pytest look for "check" instead of "test" - [pytest] - python_files = check_*.py - python_classes = Check - python_functions = *_check + # Example 1: have pytest look for "check" instead of "test" + [pytest] + python_files = check_*.py + python_classes = Check + python_functions = *_check This would make ``pytest`` look for tests in files that match the ``check_* .py`` glob-pattern, ``Check`` prefixes in classes, and functions and methods @@ -152,12 +154,13 @@ The test collection would look like this: You can check for multiple glob patterns by adding a space between the patterns: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - # Example 2: have pytest look for files with "test" and "example" - # content of pytest.ini - [pytest] - python_files = test_*.py example_*.py + # Example 2: have pytest look for files with "test" and "example" + [pytest] + python_files = test_*.py example_*.py .. note:: @@ -178,14 +181,15 @@ example if you have unittest2 installed you can type: pytest --pyargs unittest2.test.test_skipping -q which would run the respective test module. Like with -other options, through an ini-file and the :confval:`addopts` option you +other options, through a configuration file and the :confval:`addopts` option you can make this change more permanently: -.. code-block:: ini +.. tab:: ini - # content of pytest.ini - [pytest] - addopts = --pyargs + .. code-block:: ini + + [pytest] + addopts = --pyargs Now a simple invocation of ``pytest NAME`` will check if NAME exists as an importable package/module and otherwise @@ -224,11 +228,12 @@ Customizing test collection You can easily instruct ``pytest`` to discover tests from every Python file: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - # content of pytest.ini - [pytest] - python_files = *.py + [pytest] + python_files = *.py However, many projects will have a ``setup.py`` which they don't want to be imported. Moreover, there may files only importable by a specific python diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index c1a444bea18..7c1822efae5 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -11,11 +11,12 @@ every time you use ``pytest``. For example, if you always want to see detailed info on skipped and xfailed tests, as well as have terser "dot" progress output, you can write it into a configuration file: -.. code-block:: ini +.. tab:: ini - # content of pytest.ini - [pytest] - addopts = -ra -q + .. code-block:: ini + + [pytest] + addopts = -ra -q Alternatively, you can set a ``PYTEST_ADDOPTS`` environment variable to add command @@ -29,7 +30,7 @@ Here's how the command-line is built in the presence of ``addopts`` or the envir .. code-block:: text - $PYTEST_ADDOPTS + $PYTEST_ADDOPTS So if the user executes in the command-line: diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 51c0b960aed..70a2e1d3872 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -94,14 +94,14 @@ This has the following benefits: For new projects, we recommend to use ``importlib`` :ref:`import mode ` (see which-import-mode_ for a detailed explanation). -To this end, add the following to your ``pyproject.toml``: +To this end, add the following to your configuration file: -.. code-block:: toml +.. tab:: ini + + .. code-block:: ini - [tool.pytest.ini_options] - addopts = [ - "--import-mode=importlib", - ] + [pytest] + addopts = --import-mode=importlib .. _src-layout: @@ -126,12 +126,14 @@ which are better explained in this excellent `blog post`_ by Ionel Cristian Măr PYTHONPATH=src pytest or in a permanent manner by using the :confval:`pythonpath` configuration variable and adding the - following to your ``pyproject.toml``: + following to your configuration file: + + .. tab:: ini - .. code-block:: toml + .. code-block:: ini - [tool.pytest.ini_options] - pythonpath = "src" + [pytest] + pythonpath = src .. note:: diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index a9bd894b6fd..71a5cd6f9b8 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -80,30 +80,20 @@ as an error: FAILED test_show_warnings.py::test_one - UserWarning: api v1, should use ... 1 failed in 0.12s -The same option can be set in the ``pytest.ini`` or ``pyproject.toml`` file using the -``filterwarnings`` ini option. For example, the configuration below will ignore all +The same option can be set in the configuration file using the +:confval:`filterwarnings` configuration option. For example, the configuration below will ignore all user warnings and specific deprecation warnings matching a regex, but will transform all other warnings into errors. -.. code-block:: ini +.. tab:: ini - # pytest.ini - [pytest] - filterwarnings = - error - ignore::UserWarning - ignore:function ham\(\) is deprecated:DeprecationWarning - -.. code-block:: toml + .. code-block:: ini - # pyproject.toml - [tool.pytest.ini_options] - filterwarnings = [ - "error", - "ignore::UserWarning", - # note the use of single quote below to denote "raw" strings in TOML - 'ignore:function ham\(\) is deprecated:DeprecationWarning', - ] + [pytest] + filterwarnings = + error + ignore::UserWarning + ignore:function ham\(\) is deprecated:DeprecationWarning When a warning matches more than one option in the list, the action for the last matching option @@ -112,7 +102,7 @@ is performed. .. note:: - The ``-W`` flag and the ``filterwarnings`` ini option use warning filters that are + The ``-W`` flag and the :confval:`filterwarnings` configuration option use warning filters that are similar in structure, but each configuration option interprets its filter differently. For example, *message* in ``filterwarnings`` is a string containing a regular expression that the start of the warning message must match, @@ -169,7 +159,7 @@ You can specify multiple filters with separate decorators: Filters applied using a mark take precedence over filters passed on the command line or configured -by the :confval:`filterwarnings` ini option. +by the :confval:`filterwarnings` configuration option. You may apply a filter to all tests of a class by using the :ref:`filterwarnings ` mark as a class decorator or to all tests in a module by setting the :globalvar:`pytestmark` variable: @@ -202,7 +192,9 @@ warning summary entirely from the test run output. Disabling warning capture entirely ---------------------------------- -This plugin is enabled by default but can be disabled entirely in your ``pytest.ini`` file with: +This plugin is enabled by default but can be disabled entirely in your configuration file with: + +.. tab:: ini .. code-block:: ini @@ -227,16 +219,18 @@ However, in the specific case where users capture any type of warnings in their no warning will be displayed at all. Sometimes it is useful to hide some specific deprecation warnings that happen in code that you have no control over -(such as third-party libraries), in which case you might use the warning filters options (ini or marks) to ignore +(such as third-party libraries), in which case you might use the warning filters options (configuration or marks) to ignore those warnings. For example: -.. code-block:: ini +.. tab:: ini - [pytest] - filterwarnings = - ignore:.*U.*mode is deprecated:DeprecationWarning + .. code-block:: ini + + [pytest] + filterwarnings = + ignore:.*U.*mode is deprecated:DeprecationWarning This will ignore all warnings of type ``DeprecationWarning`` where the start of the message matches diff --git a/doc/en/how-to/doctest.rst b/doc/en/how-to/doctest.rst index 0a778a8a246..981abc31aa6 100644 --- a/doc/en/how-to/doctest.rst +++ b/doc/en/how-to/doctest.rst @@ -68,13 +68,14 @@ and functions, including from test modules: ============================ 2 passed in 0.12s ============================= You can make these changes permanent in your project by -putting them into a pytest.ini file like this: +putting them into a configuration file like this: -.. code-block:: ini +.. tab:: ini - # content of pytest.ini - [pytest] - addopts = --doctest-modules + .. code-block:: ini + + [pytest] + addopts = --doctest-modules Encoding @@ -82,13 +83,14 @@ Encoding The default encoding is **UTF-8**, but you can specify the encoding that will be used for those doctest files using the -``doctest_encoding`` ini option: +:confval:`doctest_encoding` configuration option: + +.. tab:: ini -.. code-block:: ini + .. code-block:: ini - # content of pytest.ini - [pytest] - doctest_encoding = latin1 + [pytest] + doctest_encoding = latin1 .. _using doctest options: @@ -102,10 +104,12 @@ configuration file. For example, to make pytest ignore trailing whitespaces and ignore lengthy exception stack traces you can just write: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - [pytest] - doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL + [pytest] + doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL Alternatively, options can be enabled by an inline comment in the doc test itself: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 7f1a7610bb8..974c460d5f3 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -1736,13 +1736,14 @@ and you may specify fixture usage at the test module level using :globalvar:`pyt It is also possible to put fixtures required by all tests in your project -into an ini-file: +into a configuration file: -.. code-block:: ini +.. tab:: ini - # content of pytest.ini - [pytest] - usefixtures = cleandir + .. code-block:: ini + + [pytest] + usefixtures = cleandir .. warning:: diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index a40aeb1cbe0..8e636dea6b6 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -47,13 +47,15 @@ Shows failed tests like so: text going to stderr ==================== 2 failed in 0.02 seconds ===================== -These options can also be customized through ``pytest.ini`` file: +These options can also be customized through a configuration file: -.. code-block:: ini +.. tab:: ini - [pytest] - log_format = %(asctime)s %(levelname)s %(message)s - log_date_format = %Y-%m-%d %H:%M:%S + .. code-block:: ini + + [pytest] + log_format = %(asctime)s %(levelname)s %(message)s + log_date_format = %Y-%m-%d %H:%M:%S Specific loggers can be disabled via ``--log-disable={logger_name}``. This argument can be passed multiple times: @@ -198,12 +200,12 @@ Additionally, you can also specify ``--log-cli-format`` and ``--log-date-format`` if not provided, but are applied only to the console logging handler. -All of the CLI log options can also be set in the configuration INI file. The +All of the CLI log options can also be set in the configuration file. The option names are: -* ``log_cli_level`` -* ``log_cli_format`` -* ``log_cli_date_format`` +* :confval:`log_cli_level` +* :confval:`log_cli_format` +* :confval:`log_cli_date_format` If you need to record the whole test suite logging calls to a file, you can pass ``--log-file=/path/to/log/file``. This log file is opened in write mode by default which @@ -220,14 +222,14 @@ Additionally, you can also specify ``--log-file-format`` and ``--log-file-date-format`` which are equal to ``--log-format`` and ``--log-date-format`` but are applied to the log file logging handler. -All of the log file options can also be set in the configuration INI file. The +All of the log file options can also be set in the configuration file. The option names are: -* ``log_file`` -* ``log_file_mode`` -* ``log_file_level`` -* ``log_file_format`` -* ``log_file_date_format`` +* :confval:`log_file` +* :confval:`log_file_mode` +* :confval:`log_file_level` +* :confval:`log_file_format` +* :confval:`log_file_date_format` You can call ``set_log_path()`` to customize the log_file path dynamically. This functionality is considered **experimental**. Note that ``set_log_path()`` respects the :confval:`log_file_mode` option. @@ -266,12 +268,14 @@ This feature was introduced as a drop-in replacement for the with each other. The backward compatibility API with ``pytest-capturelog`` has been dropped when this feature was introduced, so if for that reason you still need ``pytest-catchlog`` you can disable the internal feature by -adding to your ``pytest.ini``: +adding to your configuration file: + +.. tab:: ini -.. code-block:: ini + .. code-block:: ini - [pytest] - addopts=-p no:logging + [pytest] + addopts = -p no:logging .. _log_changes_3_4: @@ -293,13 +297,15 @@ made in ``3.4`` after community feedback: * :ref:`Live Logs ` are now sent to ``sys.stdout`` and no longer require the ``-s`` command-line option to work. -If you want to partially restore the logging behavior of version ``3.3``, you can add this options to your ``ini`` +If you want to partially restore the logging behavior of version ``3.3``, you can add this options to your configuration file: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - [pytest] - log_cli=true - log_level=NOTSET + [pytest] + log_cli = true + log_level = NOTSET More details about the discussion that lead to this changes can be read in :issue:`3013`. diff --git a/doc/en/how-to/mark.rst b/doc/en/how-to/mark.rst index 40ee14c36fd..36b4058af8f 100644 --- a/doc/en/how-to/mark.rst +++ b/doc/en/how-to/mark.rst @@ -34,24 +34,16 @@ See :ref:`mark examples` for examples which also serve as documentation. Registering marks ----------------- -You can register custom marks in your ``pytest.ini`` file like this: +You can register custom marks in your configuration file like this: -.. code-block:: ini +.. tab:: ini - [pytest] - markers = - slow: marks tests as slow (deselect with '-m "not slow"') - serial + .. code-block:: ini -or in your ``pyproject.toml`` file like this: - -.. code-block:: toml - - [tool.pytest.ini_options] - markers = [ - "slow: marks tests as slow (deselect with '-m \"not slow\"')", - "serial", - ] + [pytest] + markers = + slow: marks tests as slow (deselect with '-m "not slow"') + serial Note that everything past the ``:`` after the mark name is an optional description. @@ -77,17 +69,19 @@ Raising errors on unknown marks Unregistered marks applied with the ``@pytest.mark.name_of_the_mark`` decorator will always emit a warning in order to avoid silently doing something surprising due to mistyped names. As described in the previous section, you can disable -the warning for custom marks by registering them in your ``pytest.ini`` file or +the warning for custom marks by registering them in your configuration file or using a custom ``pytest_configure`` hook. -When the :confval:`strict_markers` ini option is set, any unknown marks applied +When the :confval:`strict_markers` configuration option is set, any unknown marks applied with the ``@pytest.mark.name_of_the_mark`` decorator will trigger an error. You can enforce this validation in your project by setting :confval:`strict_markers` in your configuration: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - [pytest] - strict_markers = True - markers = - slow: marks tests as slow (deselect with '-m "not slow"') - serial + [pytest] + strict_markers = true + markers = + slow: marks tests as slow (deselect with '-m "not slow"') + serial diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index bc98b816484..5fc437c44e0 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -558,13 +558,15 @@ Modifying truncation limits .. versionadded: 8.4 Default truncation limits are 8 lines or 640 characters, whichever comes first. -To set custom truncation limits you can use following ``pytest.ini`` file options: +To set custom truncation limits you can use the following configuration file options: -.. code-block:: ini +.. tab:: ini - [pytest] - truncation_limit_lines = 10 - truncation_limit_chars = 90 + .. code-block:: ini + + [pytest] + truncation_limit_lines = 10 + truncation_limit_chars = 90 That will cause pytest to truncate the assertions to 10 lines or 90 characters, whichever comes first. @@ -588,10 +590,12 @@ to create an XML file at ``path``. To set the name of the root test suite xml item, you can configure the ``junit_suite_name`` option in your config file: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - [pytest] - junit_suite_name = my_suite + [pytest] + junit_suite_name = my_suite .. versionadded:: 4.0 @@ -602,10 +606,12 @@ should report total test execution times, including setup and teardown It is the default pytest behavior. To report just call durations instead, configure the ``junit_duration_report`` option like this: -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - [pytest] - junit_duration_report = call + [pytest] + junit_duration_report = call .. _record_property example: diff --git a/doc/en/how-to/parametrize.rst b/doc/en/how-to/parametrize.rst index fe186146434..bd83fe7b5df 100644 --- a/doc/en/how-to/parametrize.rst +++ b/doc/en/how-to/parametrize.rst @@ -88,12 +88,14 @@ them in turn: for the parametrization because it has several downsides. If however you would like to use unicode strings in parametrization and see them in the terminal as is (non-escaped), use this option - in your ``pytest.ini``: + in your configuration file: - .. code-block:: ini + .. tab:: ini - [pytest] - disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True + .. code-block:: ini + + [pytest] + disable_test_id_escaping_and_forfeit_all_rights_to_community_support = true Keep in mind however that this might cause unwanted side effects and even bugs depending on the OS used and plugins currently installed, diff --git a/doc/en/how-to/plugins.rst b/doc/en/how-to/plugins.rst index b2cb1cda5c3..74e309c5be9 100644 --- a/doc/en/how-to/plugins.rst +++ b/doc/en/how-to/plugins.rst @@ -120,12 +120,14 @@ This means that any subsequent try to activate/load the named plugin will not work. If you want to unconditionally disable a plugin for a project, you can add -this option to your ``pytest.ini`` file: +this option to your configuration file: -.. code-block:: ini +.. tab:: ini - [pytest] - addopts = -p no:NAME + .. code-block:: ini + + [pytest] + addopts = -p no:NAME Alternatively to disable it only in certain environments (for example in a CI server), you can set ``PYTEST_ADDOPTS`` environment variable to @@ -151,10 +153,12 @@ manually specify each plugin with ``-p`` or :envvar:`PYTEST_PLUGINS`, you can us pytest --disable-plugin-autoload -p NAME,NAME2 -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - [pytest] - addopts = + [pytest] + addopts = --disable-plugin-autoload -p NAME -p NAME2 diff --git a/doc/en/how-to/skipping.rst b/doc/en/how-to/skipping.rst index 10c45c23ed2..ab68587c8ff 100644 --- a/doc/en/how-to/skipping.rst +++ b/doc/en/how-to/skipping.rst @@ -333,10 +333,12 @@ This will make ``XPASS`` ("unexpectedly passing") results from this test to fail You can change the default value of the ``strict`` parameter using the ``strict_xfail`` ini option: -.. code-block:: ini +.. tab:: ini - [pytest] - strict_xfail=true + .. code-block:: ini + + [pytest] + strict_xfail = true Ignoring xfail diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 1bba9644649..71d42140e8d 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -420,13 +420,14 @@ before running pytest on it. This way we can abstract the tested logic to separa which is especially useful for longer tests and/or longer ``conftest.py`` files. Note that for ``pytester.copy_example`` to work we need to set `pytester_example_dir` -in our ``pytest.ini`` to tell pytest where to look for example files. +in our configuration file to tell pytest where to look for example files. -.. code-block:: ini +.. tab:: ini - # content of pytest.ini - [pytest] - pytester_example_dir = . + .. code-block:: ini + + [pytest] + pytester_example_dir = . .. code-block:: python diff --git a/doc/en/reference/customize.rst b/doc/en/reference/customize.rst index 373223ec913..2e5d4a7356f 100644 --- a/doc/en/reference/customize.rst +++ b/doc/en/reference/customize.rst @@ -4,8 +4,7 @@ Configuration Command line options and configuration file settings ----------------------------------------------------------------- -You can get help on command line options and values in INI-style -configurations files by using the general help option: +You can get help on command line and configuration options by using the general help option: .. code-block:: bash @@ -31,15 +30,17 @@ pytest.ini Alternatively, the hidden version ``.pytest.ini`` can be used. -.. code-block:: ini +.. tab:: ini - # pytest.ini or .pytest.ini - [pytest] - minversion = 6.0 - addopts = -ra -q - testpaths = - tests - integration + .. code-block:: ini + + # pytest.ini or .pytest.ini + [pytest] + minversion = 6.0 + addopts = -ra -q + testpaths = + tests + integration pyproject.toml @@ -47,28 +48,20 @@ pyproject.toml .. versionadded:: 6.0 -``pyproject.toml`` are considered for configuration when they contain a ``tool.pytest.ini_options`` table. - -.. code-block:: toml - - # pyproject.toml - [tool.pytest.ini_options] - minversion = "6.0" - addopts = "-ra -q" - testpaths = [ - "tests", - "integration", - ] +``pyproject.toml`` files are supported for configuration. -.. note:: +.. tab:: ini - One might wonder why ``[tool.pytest.ini_options]`` instead of ``[tool.pytest]`` as is the - case with other tools. + .. code-block:: toml - The reason is that the pytest team intends to fully utilize the rich TOML data format - for configuration in the future, reserving the ``[tool.pytest]`` table for that. - The ``ini_options`` table is being used, for now, as a bridge between the existing - ``.ini`` configuration system and the future configuration format. + # pyproject.toml + [tool.pytest.ini_options] + minversion = "6.0" + addopts = "-ra -q" + testpaths = [ + "tests", + "integration", + ] tox.ini ~~~~~~~ @@ -76,15 +69,17 @@ tox.ini ``tox.ini`` files are the configuration files of the `tox `__ project, and can also be used to hold pytest configuration if they have a ``[pytest]`` section. -.. code-block:: ini +.. tab:: ini - # tox.ini - [pytest] - minversion = 6.0 - addopts = -ra -q - testpaths = - tests - integration + .. code-block:: ini + + # tox.ini + [pytest] + minversion = 6.0 + addopts = -ra -q + testpaths = + tests + integration setup.cfg @@ -93,15 +88,17 @@ setup.cfg ``setup.cfg`` files are general purpose configuration files, used originally by ``distutils`` (now deprecated) and :std:doc:`setuptools `, and can also be used to hold pytest configuration if they have a ``[tool:pytest]`` section. -.. code-block:: ini +.. tab:: ini + + .. code-block:: ini - # setup.cfg - [tool:pytest] - minversion = 6.0 - addopts = -ra -q - testpaths = - tests - integration + # setup.cfg + [tool:pytest] + minversion = 6.0 + addopts = -ra -q + testpaths = + tests + integration .. warning:: @@ -138,7 +135,7 @@ influence how modules are imported. See :ref:`pythonpath` for more details. The ``--rootdir=path`` command-line option can be used to force a specific directory. Note that contrary to other command-line options, ``--rootdir`` cannot be used with -:confval:`addopts` inside ``pytest.ini`` because the ``rootdir`` is used to *find* ``pytest.ini`` +:confval:`addopts` inside a configuration file because the ``rootdir`` is used to *find* the configuration file already. Finding the ``rootdir`` diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 764663fc12e..3c25d1de3a0 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1318,13 +1318,14 @@ passed multiple times. The expected format is ``name=value``. For example:: .. confval:: addopts Add the specified ``OPTS`` to the set of command line arguments as if they - had been specified by the user. Example: if you have this ini file content: + had been specified by the user. Example: if you have this configuration file content: - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - # content of pytest.ini - [pytest] - addopts = --maxfail=2 -rf # exit after 2 failures, report fail info + [pytest] + addopts = --maxfail=2 -rf # exit after 2 failures, report fail info issuing ``pytest test_hello.py`` actually means: @@ -1351,10 +1352,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Setting this to ``false`` will make pytest collect classes/functions from test files **only** if they are defined in that file (as opposed to imported there). - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - collect_imported_tests = false + [pytest] + collect_imported_tests = false Default: ``true`` @@ -1404,11 +1407,12 @@ passed multiple times. The expected format is ``name=value``. For example:: The default is ``progress``, but you can fallback to ``classic`` if you prefer or the new mode is causing unexpected problems: - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - # content of pytest.ini - [pytest] - console_output_style = classic + [pytest] + console_output_style = classic .. confval:: disable_test_id_escaping_and_forfeit_all_rights_to_community_support @@ -1419,12 +1423,14 @@ passed multiple times. The expected format is ``name=value``. For example:: for the parametrization because it has several downsides. If however you would like to use unicode strings in parametrization and see them in the terminal as is (non-escaped), use this option - in your ``pytest.ini``: + in your configuration file: - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True + [pytest] + disable_test_id_escaping_and_forfeit_all_rights_to_community_support = true Keep in mind however that this might cause unwanted side effects and even bugs depending on the OS used and plugins currently installed, @@ -1458,11 +1464,12 @@ passed multiple times. The expected format is ``name=value``. For example:: * ``xfail`` marks tests with an empty parameterset as xfail(run=False) * ``fail_at_collect`` raises an exception if parametrize collects an empty parameter set - .. code-block:: ini + .. tab:: ini - # content of pytest.ini - [pytest] - empty_parameter_set_mark = xfail + .. code-block:: ini + + [pytest] + empty_parameter_set_mark = xfail .. note:: @@ -1489,11 +1496,12 @@ passed multiple times. The expected format is ``name=value``. For example:: fixture setup and teardown). Implemented using the :func:`faulthandler.dump_traceback_later` function, so all caveats there apply. - .. code-block:: ini + .. tab:: ini - # content of pytest.ini - [pytest] - faulthandler_timeout=5 + .. code-block:: ini + + [pytest] + faulthandler_timeout = 5 For more information please refer to :ref:`faulthandler`. @@ -1507,12 +1515,13 @@ passed multiple times. The expected format is ``name=value``. For example:: This option is set to 'false' by default. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - # content of pytest.ini - [pytest] - faulthandler_timeout=5 - faulthandler_exit_on_timeout=true + [pytest] + faulthandler_timeout = 5 + faulthandler_exit_on_timeout = true For more information please refer to :ref:`faulthandler`. @@ -1524,13 +1533,14 @@ passed multiple times. The expected format is ``name=value``. For example:: warnings. By default all warnings emitted during the test session will be displayed in a summary at the end of the test session. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - # content of pytest.ini - [pytest] - filterwarnings = - error - ignore::DeprecationWarning + [pytest] + filterwarnings = + error + ignore::DeprecationWarning This tells pytest to ignore deprecation warnings and turn all other warnings into errors. For more information please refer to :ref:`warnings`. @@ -1545,10 +1555,12 @@ passed multiple times. The expected format is ``name=value``. For example:: * ``total`` (the default): duration times reported include setup, call, and teardown times. * ``call``: duration times reported include only call times, excluding setup and teardown. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - junit_duration_report = call + [pytest] + junit_duration_report = call .. confval:: junit_family @@ -1562,10 +1574,12 @@ passed multiple times. The expected format is ``name=value``. For example:: * ``xunit1`` (or ``legacy``): produces old style output, compatible with the xunit 1.0 format. * ``xunit2``: produces `xunit 2.0 style output `__, which should be more compatible with latest Jenkins versions. **This is the default**. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - junit_family = xunit2 + [pytest] + junit_family = xunit2 .. confval:: junit_logging @@ -1583,10 +1597,12 @@ passed multiple times. The expected format is ``name=value``. For example:: * ``all``: write captured ``logging``, ``stdout`` and ``stderr`` contents. * ``no`` (the default): no captured output is written. - .. code-block:: ini + .. tab:: ini - [pytest] - junit_logging = system-out + .. code-block:: ini + + [pytest] + junit_logging = system-out .. confval:: junit_log_passing_tests @@ -1596,20 +1612,24 @@ passed multiple times. The expected format is ``name=value``. For example:: If ``junit_logging != "no"``, configures if the captured output should be written to the JUnit XML file for **passing** tests. Default is ``True``. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - junit_log_passing_tests = False + [pytest] + junit_log_passing_tests = False .. confval:: junit_suite_name To set the name of the root test suite xml item, you can configure the ``junit_suite_name`` option in your config file: - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - junit_suite_name = my_suite + [pytest] + junit_suite_name = my_suite .. confval:: log_auto_indent @@ -1624,10 +1644,12 @@ passed multiple times. The expected format is ``name=value``. For example:: * False or "Off" or 0 - Do not auto-indent multiline log messages (the default behavior) * [positive integer] - auto-indent multiline log messages by [value] spaces - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - log_auto_indent = False + [pytest] + log_auto_indent = false Supports passing kwarg ``extra={"auto_indent": [value]}`` to calls to ``logging.log()`` to specify auto-indentation behavior for @@ -1639,10 +1661,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Enable log display during test run (also known as :ref:`"live logging" `). The default is ``False``. - .. code-block:: ini + .. tab:: ini - [pytest] - log_cli = True + .. code-block:: ini + + [pytest] + log_cli = true .. confval:: log_cli_date_format @@ -1650,10 +1674,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets a :py:func:`time.strftime`-compatible string that will be used when formatting dates for live logging. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - log_cli_date_format = %Y-%m-%d %H:%M:%S + [pytest] + log_cli_date_format = %Y-%m-%d %H:%M:%S For more information, see :ref:`live_logs`. @@ -1663,10 +1689,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets a :py:mod:`logging`-compatible string used to format live logging messages. - .. code-block:: ini + .. tab:: ini - [pytest] - log_cli_format = %(asctime)s %(levelname)s %(message)s + .. code-block:: ini + + [pytest] + log_cli_format = %(asctime)s %(levelname)s %(message)s For more information, see :ref:`live_logs`. @@ -1678,10 +1706,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets the minimum log message level that should be captured for live logging. The integer value or the names of the levels can be used. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - log_cli_level = INFO + [pytest] + log_cli_level = INFO For more information, see :ref:`live_logs`. @@ -1692,10 +1722,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets a :py:func:`time.strftime`-compatible string that will be used when formatting dates for logging capture. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - log_date_format = %Y-%m-%d %H:%M:%S + [pytest] + log_date_format = %Y-%m-%d %H:%M:%S For more information, see :ref:`logging`. @@ -1707,10 +1739,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets a file name relative to the current working directory where log messages should be written to, in addition to the other logging facilities that are active. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - log_file = logs/pytest-logs.txt + [pytest] + log_file = logs/pytest-logs.txt For more information, see :ref:`logging`. @@ -1736,10 +1770,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets a :py:func:`time.strftime`-compatible string that will be used when formatting dates for the logging file. - .. code-block:: ini + .. tab:: ini - [pytest] - log_file_date_format = %Y-%m-%d %H:%M:%S + .. code-block:: ini + + [pytest] + log_file_date_format = %Y-%m-%d %H:%M:%S For more information, see :ref:`logging`. @@ -1749,10 +1785,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets a :py:mod:`logging`-compatible string used to format logging messages redirected to the logging file. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - log_file_format = %(asctime)s %(levelname)s %(message)s + [pytest] + log_file_format = %(asctime)s %(levelname)s %(message)s For more information, see :ref:`logging`. @@ -1763,10 +1801,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets the minimum log message level that should be captured for the logging file. The integer value or the names of the levels can be used. - .. code-block:: ini + .. tab:: ini - [pytest] - log_file_level = INFO + .. code-block:: ini + + [pytest] + log_file_level = INFO For more information, see :ref:`logging`. @@ -1777,10 +1817,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets a :py:mod:`logging`-compatible string used to format captured logging messages. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - log_format = %(asctime)s %(levelname)s %(message)s + [pytest] + log_format = %(asctime)s %(levelname)s %(message)s For more information, see :ref:`logging`. @@ -1792,10 +1834,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets the minimum log message level that should be captured for logging capture. The integer value or the names of the levels can be used. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - log_level = INFO + [pytest] + log_level = INFO For more information, see :ref:`logging`. @@ -1806,27 +1850,30 @@ passed multiple times. The expected format is ``name=value``. For example:: only known markers - defined in code by core pytest or some plugin - are allowed. You can list additional markers in this setting to add them to the whitelist, - in which case you probably want to set :confval:`strict_markers` to ``True`` + in which case you probably want to set :confval:`strict_markers` to ``true`` to avoid future regressions: - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - strict_markers = True - markers = - slow - serial + [pytest] + strict_markers = true + markers = + slow + serial .. confval:: minversion Specifies a minimal pytest version required for running tests. - .. code-block:: ini + .. tab:: ini - # content of pytest.ini - [pytest] - minversion = 3.0 # will fail if we run with pytest-2.8 + .. code-block:: ini + + [pytest] + minversion = 3.0 # will fail if we run with pytest-2.8 .. confval:: norecursedirs @@ -1846,10 +1893,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Setting a ``norecursedirs`` replaces the default. Here is an example of how to avoid certain directories: - .. code-block:: ini + .. tab:: ini - [pytest] - norecursedirs = .svn _build tmp* + .. code-block:: ini + + [pytest] + norecursedirs = .svn _build tmp* This would tell ``pytest`` to not look into typical subversion or sphinx-build directories or into any ``tmp`` prefixed directory. @@ -1872,10 +1921,12 @@ passed multiple times. The expected format is ``name=value``. For example:: class prefixed with ``Test`` as a test collection. Here is an example of how to collect tests from classes that end in ``Suite``: - .. code-block:: ini + .. tab:: ini - [pytest] - python_classes = *Suite + .. code-block:: ini + + [pytest] + python_classes = *Suite Note that ``unittest.TestCase`` derived classes are always collected regardless of this option, as ``unittest``'s own collection framework is used @@ -1888,20 +1939,22 @@ passed multiple times. The expected format is ``name=value``. For example:: are considered as test modules. Search for multiple glob patterns by adding a space between patterns: - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - python_files = test_*.py check_*.py example_*.py + [pytest] + python_files = test_*.py check_*.py example_*.py - Or one per line: + Or one per line: - .. code-block:: ini + .. code-block:: ini - [pytest] - python_files = - test_*.py - check_*.py - example_*.py + [pytest] + python_files = + test_*.py + check_*.py + example_*.py By default, files matching ``test_*.py`` and ``*_test.py`` will be considered test modules. @@ -1915,10 +1968,12 @@ passed multiple times. The expected format is ``name=value``. For example:: function prefixed with ``test`` as a test. Here is an example of how to collect test functions and methods that end in ``_test``: - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - python_functions = *_test + [pytest] + python_functions = *_test Note that this has no effect on methods that live on a ``unittest.TestCase`` derived class, as ``unittest``'s own collection framework is used @@ -1936,10 +1991,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Paths are relative to the :ref:`rootdir ` directory. Directories remain in path for the duration of the test session. - .. code-block:: ini + .. tab:: ini - [pytest] - pythonpath = src1 src2 + .. code-block:: ini + + [pytest] + pythonpath = src1 src2 .. confval:: required_plugins @@ -1949,10 +2006,12 @@ passed multiple times. The expected format is ``name=value``. For example:: their name. Whitespace between different version specifiers is not allowed. If any one of the plugins is not found, emit an error. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - required_plugins = pytest-django>=3.0.0,<4.0.0 pytest-html pytest-xdist>=1.0.0 + [pytest] + required_plugins = pytest-django>=3.0.0,<4.0.0 pytest-html pytest-xdist>=1.0.0 .. confval:: testpaths @@ -1966,10 +2025,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Useful when all project tests are in a known location to speed up test collection and to avoid picking up undesired tests by accident. - .. code-block:: ini + .. tab:: ini - [pytest] - testpaths = testing doc + .. code-block:: ini + + [pytest] + testpaths = testing doc This configuration means that executing: @@ -1988,10 +2049,12 @@ passed multiple times. The expected format is ``name=value``. For example:: How many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - tmp_path_retention_count = 3 + [pytest] + tmp_path_retention_count = 3 Default: ``3`` @@ -2007,10 +2070,12 @@ passed multiple times. The expected format is ``name=value``. For example:: * `failed`: retains directories only for tests with outcome `error` or `failed`. * `none`: directories are always removed after each test ends, regardless of the outcome. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - tmp_path_retention_policy = all + [pytest] + tmp_path_retention_policy = all Default: ``all`` @@ -2021,10 +2086,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Setting value to ``0`` disables the character limit for truncation. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - truncation_limit_chars = 640 + [pytest] + truncation_limit_chars = 640 pytest truncates the assert messages to a certain limit by default to prevent comparison with large data to overload the console output. @@ -2041,10 +2108,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Setting value to ``0`` disables the lines limit for truncation. - .. code-block:: ini + .. tab:: ini - [pytest] - truncation_limit_lines = 8 + .. code-block:: ini + + [pytest] + truncation_limit_lines = 8 pytest truncates the assert messages to a certain limit by default to prevent comparison with large data to overload the console output. @@ -2061,21 +2130,25 @@ passed multiple times. The expected format is ``name=value``. For example:: the ``@pytest.mark.usefixtures`` marker to all test functions. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - usefixtures = - clean_db + [pytest] + usefixtures = + clean_db .. confval:: verbosity_assertions Set a verbosity level specifically for assertion related output, overriding the application wide level. - .. code-block:: ini + .. tab:: ini - [pytest] - verbosity_assertions = 2 + .. code-block:: ini + + [pytest] + verbosity_assertions = 2 Defaults to application wide verbosity level (via the ``-v`` command-line option). A special value of "auto" can be used to explicitly use the global verbosity level. @@ -2085,10 +2158,12 @@ passed multiple times. The expected format is ``name=value``. For example:: Set a verbosity level specifically for test case execution related output, overriding the application wide level. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - verbosity_test_cases = 2 + [pytest] + verbosity_test_cases = 2 Defaults to application wide verbosity level (via the ``-v`` command-line option). A special value of "auto" can be used to explicitly use the global verbosity level. @@ -2096,7 +2171,7 @@ passed multiple times. The expected format is ``name=value``. For example:: .. confval:: strict - If set to ``True``, enables all strictness options: + If set to ``true``, enables all strictness options: * :confval:`strict_config` * :confval:`strict_markers` @@ -2112,25 +2187,28 @@ passed multiple times. The expected format is ``name=value``. For example:: We therefore only recommend using this option when using a locked version of pytest, or if you want to proactively adopt new strictness options as they are added. - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - [pytest] - strict = True + [pytest] + strict = true .. versionadded:: 9.0 .. confval:: strict_xfail - If set to ``True``, tests marked with ``@pytest.mark.xfail`` that actually succeed will by default fail the + If set to ``true``, tests marked with ``@pytest.mark.xfail`` that actually succeed will by default fail the test suite. For more information, see :ref:`xfail strict tutorial`. + .. tab:: ini - .. code-block:: ini + .. code-block:: ini - [pytest] - strict_xfail = True + [pytest] + strict_xfail = true You can also enable this option via the :confval:`strict` option. @@ -2141,39 +2219,44 @@ passed multiple times. The expected format is ``name=value``. For example:: .. confval:: strict_config - If set to ``True``, any warnings encountered while parsing the ``pytest`` section of the configuration file will raise errors. + If set to ``true``, any warnings encountered while parsing the ``pytest`` section of the configuration file will raise errors. - .. code-block:: ini + .. tab:: ini - [pytest] - strict_config = True + .. code-block:: ini + + [pytest] + strict_config = true You can also enable this option via the :confval:`strict` option. .. confval:: strict_markers - If set to ``True``, markers not registered in the ``markers`` section of the configuration file will raise errors. + If set to ``true``, markers not registered in the ``markers`` section of the configuration file will raise errors. - .. code-block:: ini + .. tab:: ini - [pytest] - strict_markers = True + .. code-block:: ini - You can also enable this option via the :confval:`strict` option. + [pytest] + strict_markers = true + You can also enable this option via the :confval:`strict` option. .. confval:: strict_parametrization_ids - If set, pytest emits an error if it detects non-unique parameter set IDs. + If set to ``true``, pytest emits an error if it detects non-unique parameter set IDs. If not set (the default), pytest automatically handles this by adding `0`, `1`, ... to duplicate IDs, making them unique. - .. code-block:: ini + .. tab:: ini - [pytest] - strict_parametrization_ids = True + .. code-block:: ini + + [pytest] + strict_parametrization_ids = true You can also enable this option via the :confval:`strict` option. diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index ddcb7efb99b..5483bb46063 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -8,3 +8,4 @@ sphinxcontrib-svg2pdfconverter furo sphinxcontrib-towncrier sphinx-issues +sphinx-inline-tabs diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index e6d34ffc5c4..6ce5223beaa 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1,5 +1,5 @@ # mypy: allow-untyped-defs -"""Command line options, ini-file and conftest.py processing.""" +"""Command line options, config-file and conftest.py processing.""" from __future__ import annotations @@ -52,6 +52,7 @@ from _pytest._code import filter_traceback from _pytest._code.code import TracebackStyle from _pytest._io import TerminalWriter +from _pytest.compat import assert_never from _pytest.config.argparsing import Argument from _pytest.config.argparsing import Parser import _pytest.deprecated @@ -993,7 +994,7 @@ class InvocationParams: .. note:: Note that the environment variable ``PYTEST_ADDOPTS`` and the ``addopts`` - ini option are handled by pytest, not being included in the ``args`` attribute. + configuration option are handled by pytest, not being included in the ``args`` attribute. Plugins accessing ``InvocationParams`` must be aware of that. """ @@ -1451,8 +1452,8 @@ def _preparse(self, args: list[str], addopts: bool = True) -> None: @hookimpl(wrapper=True) def pytest_collection(self) -> Generator[None, object, object]: - # Validate invalid ini keys after collection is done so we take in account - # options added by late-loading conftest files. + # Validate invalid configuration keys after collection is done so we + # take in account options added by late-loading conftest files. try: return (yield) finally: @@ -1588,7 +1589,7 @@ def issue_config_time_warning(self, warning: Warning, stacklevel: int) -> None: ) def addinivalue_line(self, name: str, line: str) -> None: - """Add a line to an ini-file option. The option must have been + """Add a line to a configuration option. The option must have been declared but might not yet be set in which case the line becomes the first line in its value.""" x = self.getini(name) @@ -1596,11 +1597,11 @@ def addinivalue_line(self, name: str, line: str) -> None: x.append(line) # modifies the cached list inline def getini(self, name: str) -> Any: - """Return configuration value from an :ref:`ini file `. + """Return configuration value the an :ref:`configuration file `. - If a configuration value is not defined in an - :ref:`ini file `, then the ``default`` value provided while - registering the configuration through + If a configuration value is not defined in a + :ref:`configuration file `, then the ``default`` value + provided while registering the configuration through :func:`parser.addini ` will be returned. Please note that you can even provide ``None`` as a valid default value. @@ -1629,8 +1630,9 @@ def getini(self, name: str) -> Any: try: return self._inicache[canonical_name] except KeyError: - self._inicache[canonical_name] = val = self._getini(canonical_name) - return val + pass + self._inicache[canonical_name] = val = self._getini(canonical_name) + return val # Meant for easy monkeypatching by legacypath plugin. # Can be inlined back (with no cover removed) once legacypath is gone. @@ -1666,22 +1668,42 @@ def _getini(self, name: str): # 2. Canonical name takes precedence over alias. selected = max(candidates, key=lambda x: (x[0].origin == "override", x[1]))[0] value = selected.value + mode = selected.mode - # Coerce the values based on types. - # - # Note: some coercions are only required if we are reading from .ini files, because - # the file format doesn't contain type information, but when reading from toml we will - # get either str or list of str values (see _parse_ini_config_from_pyproject_toml). - # For example: + if mode == "ini": + # In ini mode, values are always str | list[str]. + assert isinstance(value, (str, list)) + return self._getini_ini(name, canonical_name, type, value, default) + else: + assert_never(mode) + + def _getini_ini( + self, + name: str, + canonical_name: str, + type: str, + value: str | list[str], + default: Any, + ): + """Handle config values read in INI mode. + + In INI mode, values are stored as str or list[str] only, and coerced + from string based on the registered type. + """ + # Note: some coercions are only required if we are reading from .ini + # files, because the file format doesn't contain type information, but + # when reading from toml (in ini mode) we will get either str or list of + # str values (see load_config_dict_from_file). For example: # # ini: # a_line_list = "tests acceptance" - # in this case, we need to split the string to obtain a list of strings. # - # toml: + # in this case, we need to split the string to obtain a list of strings. + # + # toml (ini mode): # a_line_list = ["tests", "acceptance"] - # in this case, we already have a list ready to use. # + # in this case, we already have a list ready to use. if type == "paths": dp = ( self.inipath.parent @@ -1790,11 +1812,12 @@ def get_verbosity(self, verbosity_type: str | None = None) -> int: Example: - .. code-block:: ini + .. tab:: ini + + .. code-block:: ini - # content of pytest.ini - [pytest] - verbosity_assertions = 2 + [pytest] + verbosity_assertions = 2 .. code-block:: console @@ -1828,7 +1851,7 @@ def _verbosity_ini_name(verbosity_type: str) -> str: def _add_verbosity_ini(parser: Parser, verbosity_type: str, help: str) -> None: """Add a output verbosity configuration option for the given output type. - :param parser: Parser for command line arguments and ini-file values. + :param parser: Parser for command line arguments and config-file values. :param verbosity_type: Fine-grained verbosity category. :param help: Description of the output this type controls. diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 67b89bbbb16..99835884848 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -30,7 +30,7 @@ def __repr__(self) -> str: @final class Parser: - """Parser for command line arguments and ini-file values. + """Parser for command line arguments and config-file values. :ivar extra_info: Dict of generic param -> value to display in case there's an error processing the command line arguments. @@ -183,12 +183,12 @@ def addini( *, aliases: Sequence[str] = (), ) -> None: - """Register an ini-file option. + """Register a configuration file option. :param name: - Name of the ini-variable. + Name of the configuration. :param type: - Type of the variable. Can be: + Type of the configuration. Can be: * ``string``: a string * ``bool``: a boolean @@ -203,19 +203,19 @@ def addini( The ``float`` and ``int`` types. - For ``paths`` and ``pathlist`` types, they are considered relative to the ini-file. - In case the execution is happening without an ini-file defined, + For ``paths`` and ``pathlist`` types, they are considered relative to the config-file. + In case the execution is happening without a config-file defined, they will be considered relative to the current working directory (for example with ``--override-ini``). .. versionadded:: 7.0 The ``paths`` variable type. .. versionadded:: 8.1 - Use the current working directory to resolve ``paths`` and ``pathlist`` in the absence of an ini-file. + Use the current working directory to resolve ``paths`` and ``pathlist`` in the absence of a config-file. Defaults to ``string`` if ``None`` or not passed. :param default: - Default value if no ini-file option exists but is queried. + Default value if no config-file option exists but is queried. :param aliases: Additional names by which this option can be referenced. Aliases resolve to the canonical name. @@ -223,7 +223,7 @@ def addini( .. versionadded:: 9.0 The ``aliases`` parameter. - The value of ini-variables can be retrieved via a call to + The value of configuration keys can be retrieved via a call to :py:func:`config.getini(name) `. """ assert type in ( @@ -246,7 +246,9 @@ def addini( for alias in aliases: if alias in self._inidict: - raise ValueError(f"alias {alias!r} conflicts with existing ini option") + raise ValueError( + f"alias {alias!r} conflicts with existing configuration option" + ) if (already := self._ini_aliases.get(alias)) is not None: raise ValueError(f"{alias!r} is already an alias of {already!r}") self._ini_aliases[alias] = name @@ -258,7 +260,7 @@ def get_ini_default_for_type( ], ) -> Any: """ - Used by addini to get the default value for a given ini-option type, when + Used by addini to get the default value for a given config option type, when default is not supplied. """ if type in ("paths", "pathlist", "args", "linelist"): @@ -553,7 +555,7 @@ class OverrideIniAction(argparse.Action): """Custom argparse action that makes a CLI flag equivalent to overriding an option, in addition to behaving like `store_true`. - This can simplify things since code only needs to inspect the ini option + This can simplify things since code only needs to inspect the config option and not consider the CLI flag. """ diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index 5b190d3174b..6fa900f0e9b 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -21,19 +21,21 @@ @dataclass(frozen=True) class ConfigValue: - """Represents a configuration value with its origin. + """Represents a configuration value with its origin and parsing mode. This allows tracking whether a value came from a configuration file or from a CLI override (--override-ini), which is important for determining precedence when dealing with ini option aliases. + + The mode tracks the parsing mode/data model used for the value: + - "ini": from INI files or [tool.pytest.ini_options], where the only + supported value types are `str` or `list[str]`. """ - # Even though TOML supports richer data types, all values are converted to - # str/list[str] during parsing to maintain compatibility with the rest of - # the configuration system. - value: str | list[str] + value: object _: KW_ONLY origin: Literal["file", "override"] + mode: Literal["ini"] ConfigDict: TypeAlias = dict[str, ConfigValue] @@ -64,7 +66,8 @@ def load_config_dict_from_file( if "pytest" in iniconfig: return { - k: ConfigValue(v, origin="file") for k, v in iniconfig["pytest"].items() + k: ConfigValue(v, origin="file", mode="ini") + for k, v in iniconfig["pytest"].items() } else: # "pytest.ini" files are always the source of configuration, even if empty. @@ -77,7 +80,7 @@ def load_config_dict_from_file( if "tool:pytest" in iniconfig.sections: return { - k: ConfigValue(v, origin="file") + k: ConfigValue(v, origin="file", mode="ini") for k, v in iniconfig["tool:pytest"].items() } elif "pytest" in iniconfig.sections: @@ -107,7 +110,8 @@ def make_scalar(v: object) -> str | list[str]: return v if isinstance(v, list) else str(v) return { - k: ConfigValue(make_scalar(v), origin="file") for k, v in result.items() + k: ConfigValue(make_scalar(v), origin="file", mode="ini") + for k, v in result.items() } return None @@ -224,7 +228,7 @@ def parse_override_ini(override_ini: Sequence[str] | None) -> ConfigDict: f"-o/--override-ini expects option=value style (got: {ini_config!r})." ) from e else: - overrides[key] = ConfigValue(user_ini_value, origin="override") + overrides[key] = ConfigValue(user_ini_value, origin="override", mode="ini") return overrides diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index b3597615ba9..27846db13a4 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1520,7 +1520,7 @@ class FixtureManager: relevant for a particular function. An initial list of fixtures is assembled like this: - - ini-defined usefixtures + - config-defined usefixtures - autouse-marked fixtures along the collection chain up from the function - usefixtures markers at module/class/function level - test function funcargs diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index 32b807029fb..1b8c885bcdb 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -102,7 +102,7 @@ def pytest_addoption(parser: Parser) -> None: "--override-ini", dest="override_ini", action="append", - help='Override ini option with "option=value" style, ' + help='Override configuration option with "option=value" style, ' "e.g. `-o strict_xfail=True -o cache_dir=cache`.", ) @@ -176,7 +176,7 @@ def showhelp(config: Config) -> None: tw.write(config._parser.optparser.format_help()) tw.line() tw.line( - "[pytest] ini-options in the first " + "[pytest] configuration options in the first " "pytest.ini|tox.ini|setup.cfg|pyproject.toml file found:" ) tw.line() diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 12653ea11fe..29ad272af23 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -98,13 +98,13 @@ def pytest_plugin_registered( @hookspec(historic=True) def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager) -> None: - """Register argparse-style options and ini-style config values, + """Register argparse-style options and config-style config values, called once at the beginning of a test run. :param parser: To add command line options, call :py:func:`parser.addoption(...) `. - To add ini-file values call :py:func:`parser.addini(...) + To add config-file values call :py:func:`parser.addini(...) `. :param pluginmanager: @@ -119,7 +119,7 @@ def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager) -> None retrieve the value of a command line option. - :py:func:`config.getini(name) ` to retrieve - a value read from an ini-style file. + a value read from a configuration file. The config object is passed around on many internal objects via the ``.config`` attribute or can be retrieved as the ``pytestconfig`` fixture. @@ -998,13 +998,15 @@ def pytest_assertion_pass(item: Item, lineno: int, orig: str, expl: str) -> None and the pytest introspected assertion information is available in the `expl` string. - This hook must be explicitly enabled by the ``enable_assertion_pass_hook`` - ini-file option: + This hook must be explicitly enabled by the :confval:`enable_assertion_pass_hook` + configuration option: - .. code-block:: ini + .. tab:: ini - [pytest] - enable_assertion_pass_hook=true + .. code-block:: ini + + [pytest] + enable_assertion_pass_hook = true You need to **clean the .pyc** files in your project directory and interpreter libraries when enabling this option, as assertions will require to be re-written. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 67b1c0474f7..e63751877a4 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -383,7 +383,7 @@ def istestclass(self, obj: object, name: str) -> bool: def _matches_prefix_or_glob_option(self, option_name: str, name: str) -> bool: """Check if the given name matches the prefix or glob-pattern defined - in ini configuration.""" + in configuration.""" for option in self.config.getini(option_name): if name.startswith(option): return True diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index cf54788e246..4974532e888 100644 --- a/testing/logging/test_reporting.py +++ b/testing/logging/test_reporting.py @@ -589,7 +589,8 @@ def test_log_cli(request): ) def test_log_cli_auto_enable(pytester: Pytester, cli_args: str) -> None: """Check that live logs are enabled if --log-level or --log-cli-level is passed on the CLI. - It should not be auto enabled if the same configs are set on the INI file. + + It should not be auto enabled if the same configs are set on the configuration file. """ pytester.makepyfile( """ diff --git a/testing/test_collection.py b/testing/test_collection.py index cd8e13c8790..39753d80cac 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1353,7 +1353,7 @@ def test_collect_pyargs_with_testpaths( def test_initial_conftests_with_testpaths(pytester: Pytester) -> None: - """The testpaths ini option should load conftests in those paths as 'initial' (#10987).""" + """The testpaths config option should load conftests in those paths as 'initial' (#10987).""" p = pytester.mkdir("some_path") p.joinpath("conftest.py").write_text( textwrap.dedent( diff --git a/testing/test_config.py b/testing/test_config.py index 34fab5272e8..dd42c80992f 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -58,9 +58,9 @@ def test_getcfg_and_config( encoding="utf-8", ) _, _, cfg, _ = locate_config(Path.cwd(), [sub]) - assert cfg["name"] == ConfigValue("value", origin="file") + assert cfg["name"] == ConfigValue("value", origin="file", mode="ini") config = pytester.parseconfigure(str(sub)) - assert config.inicfg["name"] == ConfigValue("value", origin="file") + assert config.inicfg["name"] == ConfigValue("value", origin="file", mode="ini") def test_setupcfg_uses_toolpytest_with_pytest(self, pytester: Pytester) -> None: p1 = pytester.makepyfile("def test(): pass") @@ -1043,7 +1043,7 @@ def pytest_addoption(parser): assert config.getini("old_name") == "hello" def test_addini_aliases_with_canonical_in_file(self, pytester: Pytester) -> None: - """Test that canonical name takes precedence over alias in ini file.""" + """Test that canonical name takes precedence over alias in configuration file.""" pytester.makeconftest( """ def pytest_addoption(parser): @@ -1160,7 +1160,7 @@ def pytest_addoption(parser): try: parser.addini("new_option", "second option", aliases=["existing"]) except ValueError as e: - assert "alias 'existing' conflicts with existing ini option" in str(e) + assert "alias 'existing' conflicts with existing configuration option" in str(e) else: assert False, "Should have raised ValueError" """ @@ -1330,7 +1330,9 @@ def test_inifilename(self, tmp_path: Path) -> None: # this indicates this is the file used for getting configuration values assert config.inipath == inipath - assert config.inicfg.get("name") == ConfigValue("value", origin="file") + assert config.inicfg.get("name") == ConfigValue( + "value", origin="file", mode="ini" + ) assert config.inicfg.get("should_not_be_set") is None @@ -1824,7 +1826,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None: ) assert rootpath == tmp_path assert parsed_inipath == inipath - assert ini_config["x"] == ConfigValue("10", origin="file") + assert ini_config["x"] == ConfigValue("10", origin="file", mode="ini") @pytest.mark.parametrize("pytest_ini", ["pytest.ini", ".pytest.ini"]) @pytest.mark.parametrize("other", ["setup.cfg", "tox.ini"]) @@ -1901,7 +1903,7 @@ def test_with_specific_inifile( ) assert rootpath == tmp_path assert inipath == p - assert ini_config["x"] == ConfigValue("10", origin="file") + assert ini_config["x"] == ConfigValue("10", origin="file", mode="ini") def test_explicit_config_file_sets_rootdir( self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch @@ -2147,7 +2149,7 @@ def test_override_ini_usage_error_bad_style(self, pytester: Pytester) -> None: def test_override_ini_handled_asap( self, pytester: Pytester, with_ini: bool ) -> None: - """-o should be handled as soon as possible and always override what's in ini files (#2238)""" + """-o should be handled as soon as possible and always override what's in config files (#2238)""" if with_ini: pytester.makeini( """ @@ -2172,7 +2174,7 @@ def test_addopts_before_initini( config = _config_for_test config._preparse([], addopts=True) assert config.inicfg.get("cache_dir") == ConfigValue( - cache_dir, origin="override" + cache_dir, origin="override", mode="ini" ) def test_addopts_from_env_not_concatenated( @@ -2189,7 +2191,7 @@ def test_addopts_from_env_not_concatenated( ) def test_addopts_from_ini_not_concatenated(self, pytester: Pytester) -> None: - """`addopts` from ini should not take values from normal args (#4265).""" + """`addopts` from configuration should not take values from normal args (#4265).""" pytester.makeini( """ [pytest] @@ -2212,7 +2214,7 @@ def test_override_ini_does_not_contain_paths( config = _config_for_test config._preparse(["-o", "cache_dir=/cache", "/some/test/path"]) assert config.inicfg.get("cache_dir") == ConfigValue( - "/cache", origin="override" + "/cache", origin="override", mode="ini" ) def test_multiple_override_ini_options(self, pytester: Pytester) -> None: diff --git a/testing/test_conftest.py b/testing/test_conftest.py index bd083574ffc..4de61bceb90 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -654,7 +654,7 @@ def test_parsefactories_relative_node_ids( def test_search_conftest_up_to_inifile( pytester: Pytester, confcutdir: str, passed: int, error: int ) -> None: - """Test that conftest files are detected only up to an ini file, unless + """Test that conftest files are detected only up to a configuration file, unless an explicit --confcutdir option is given. """ root = pytester.path diff --git a/testing/test_doctest.py b/testing/test_doctest.py index e2ca1119e92..8b71dabbc77 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -907,7 +907,7 @@ class TestLiterals: def test_allow_unicode(self, pytester, config_mode): """Test that doctests which output unicode work in all python versions tested by pytest when the ALLOW_UNICODE option is used (either in - the ini file or by an inline comment). + the configuration file or by an inline comment). """ if config_mode == "ini": pytester.makeini( @@ -942,7 +942,7 @@ def foo(): def test_allow_bytes(self, pytester, config_mode): """Test that doctests which output bytes work in all python versions tested by pytest when the ALLOW_BYTES option is used (either in - the ini file or by an inline comment)(#1287). + the configuration file or by an inline comment)(#1287). """ if config_mode == "ini": pytester.makeini( diff --git a/testing/test_findpaths.py b/testing/test_findpaths.py index 0ed53a02418..674ae79b4fe 100644 --- a/testing/test_findpaths.py +++ b/testing/test_findpaths.py @@ -26,13 +26,17 @@ def test_pytest_ini(self, tmp_path: Path) -> None: """[pytest] section in pytest.ini files is read correctly""" fn = tmp_path / "pytest.ini" fn.write_text("[pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", origin="file")} + assert load_config_dict_from_file(fn) == { + "x": ConfigValue("1", origin="file", mode="ini") + } def test_custom_ini(self, tmp_path: Path) -> None: """[pytest] section in any .ini file is read correctly""" fn = tmp_path / "custom.ini" fn.write_text("[pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", origin="file")} + assert load_config_dict_from_file(fn) == { + "x": ConfigValue("1", origin="file", mode="ini") + } def test_custom_ini_without_section(self, tmp_path: Path) -> None: """Custom .ini files without [pytest] section are not considered for configuration""" @@ -50,7 +54,9 @@ def test_valid_cfg_file(self, tmp_path: Path) -> None: """Custom .cfg files with [tool:pytest] section are read correctly""" fn = tmp_path / "custom.cfg" fn.write_text("[tool:pytest]\nx=1", encoding="utf-8") - assert load_config_dict_from_file(fn) == {"x": ConfigValue("1", origin="file")} + assert load_config_dict_from_file(fn) == { + "x": ConfigValue("1", origin="file", mode="ini") + } def test_unsupported_pytest_section_in_cfg_file(self, tmp_path: Path) -> None: """.cfg files with [pytest] section are no longer supported and should fail to alert users""" @@ -98,11 +104,11 @@ def test_valid_toml_file(self, tmp_path: Path) -> None: encoding="utf-8", ) assert load_config_dict_from_file(fn) == { - "x": ConfigValue("1", origin="file"), - "y": ConfigValue("20.0", origin="file"), - "values": ConfigValue(["tests", "integration"], origin="file"), - "name": ConfigValue("foo", origin="file"), - "heterogeneous_array": ConfigValue([1, "str"], origin="file"), # type: ignore[list-item] + "x": ConfigValue("1", origin="file", mode="ini"), + "y": ConfigValue("20.0", origin="file", mode="ini"), + "values": ConfigValue(["tests", "integration"], origin="file", mode="ini"), + "name": ConfigValue("foo", origin="file", mode="ini"), + "heterogeneous_array": ConfigValue([1, "str"], origin="file", mode="ini"), } diff --git a/testing/test_python_path.py b/testing/test_python_path.py index d12ef96115f..f75bcb6bb57 100644 --- a/testing/test_python_path.py +++ b/testing/test_python_path.py @@ -92,8 +92,8 @@ def test_module_not_found(pytester: Pytester, file_structure) -> None: result.stdout.fnmatch_lines([expected_error]) -def test_no_ini(pytester: Pytester, file_structure) -> None: - """If no ini file, test should error.""" +def test_no_config_file(pytester: Pytester, file_structure) -> None: + """If no configuration file, test should error.""" result = pytester.runpytest("test_foo.py") assert result.ret == pytest.ExitCode.INTERRUPTED result.assert_outcomes(errors=1) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index e6b77ae5546..cfc668fa6ad 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -940,7 +940,7 @@ def test_header(self, pytester: Pytester) -> None: pytester.path.joinpath("tests").mkdir() pytester.path.joinpath("gui").mkdir() - # no ini file + # no configuration file result = pytester.runpytest() result.stdout.fnmatch_lines(["rootdir: *test_header0"]) diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 4800a916eac..d13ed72a2d4 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -382,7 +382,7 @@ def test_bar(): def test_option_precedence_cmdline_over_ini( pytester: Pytester, ignore_on_cmdline ) -> None: - """Filters defined in the command-line should take precedence over filters in ini files (#3946).""" + """Filters defined in the command-line should take precedence over filters in config files (#3946).""" pytester.makeini( """ [pytest] From 7672dafb2a4dc0d9d9d0ae07a05c0b74ce57bd96 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 24 Oct 2025 22:48:47 +0300 Subject: [PATCH 190/270] config: add native TOML configuration Add support for using native TOML configuration, while maintaining full backwards compatibility with the existing INI-based configuration system. In pyproject.toml, the native configuration is under ``[pytest.tool]``. Also add support for ``pytest.toml``/``.pytest.toml`` files. `--override-ini` always uses "ini" mode for compatibility. --- changelog/13743.feature.rst | 37 +++ doc/en/deprecations.rst | 14 ++ doc/en/example/markers.rst | 7 + doc/en/example/pythoncollection.rst | 39 +++ doc/en/example/simple.rst | 7 + doc/en/explanation/goodpractices.rst | 14 ++ doc/en/how-to/capture-warnings.rst | 28 +++ doc/en/how-to/doctest.rst | 21 ++ doc/en/how-to/fixtures.rst | 7 + doc/en/how-to/logging.rst | 23 ++ doc/en/how-to/mark.rst | 21 ++ doc/en/how-to/output.rst | 22 ++ doc/en/how-to/parametrize.rst | 7 + doc/en/how-to/plugins.rst | 14 ++ doc/en/how-to/skipping.rst | 7 + doc/en/how-to/writing_plugins.rst | 7 + doc/en/reference/customize.rst | 60 ++++- doc/en/reference/reference.rst | 340 ++++++++++++++++++++++++++- src/_pytest/config/__init__.py | 94 ++++++++ src/_pytest/config/findpaths.py | 68 ++++-- src/_pytest/helpconfig.py | 2 +- src/_pytest/hookspec.py | 7 + src/_pytest/pytester.py | 10 + testing/test_config.py | 274 ++++++++++++++++++++- testing/test_findpaths.py | 59 ++++- testing/test_legacypath.py | 16 +- 26 files changed, 1170 insertions(+), 35 deletions(-) create mode 100644 changelog/13743.feature.rst diff --git a/changelog/13743.feature.rst b/changelog/13743.feature.rst new file mode 100644 index 00000000000..b36782487f5 --- /dev/null +++ b/changelog/13743.feature.rst @@ -0,0 +1,37 @@ +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/doc/en/deprecations.rst b/doc/en/deprecations.rst index af8bc4108a6..65a05823517 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -847,6 +847,13 @@ XML file supports it. To use the new format, update your configuration file: +.. tab:: toml + + .. code-block:: toml + + [pytest] + junit_family = "xunit2" + .. tab:: ini .. code-block:: ini @@ -857,6 +864,13 @@ To use the new format, update your configuration file: If you discover that your tooling does not support the new format, and want to keep using the legacy version, set the option to ``legacy`` instead: +.. tab:: toml + + .. code-block:: toml + + [pytest] + junit_family = "legacy" + .. tab:: ini .. code-block:: ini diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 944047c583d..ed830b9fb2e 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -239,6 +239,13 @@ Registering markers Registering markers for your test suite is simple: +.. tab:: toml + + .. code-block:: toml + + [pytest] + markers = ["webtest: mark a test as a webtest.", "slow: mark test as slow."] + .. tab:: ini .. code-block:: ini diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index e0020384864..5ff3ae20247 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -90,6 +90,13 @@ Changing directory recursion You can set the :confval:`norecursedirs` option in a configuration file: +.. tab:: toml + + .. code-block:: toml + + [pytest] + norecursedirs = [".svn", "_build", "tmp*"] + .. tab:: ini .. code-block:: ini @@ -109,6 +116,16 @@ the :confval:`python_files`, :confval:`python_classes` and :confval:`python_functions` in your :ref:`configuration file `. Here is an example: +.. tab:: toml + + .. code-block:: toml + + # Example 1: have pytest look for "check" instead of "test" + [pytest] + python_files = ["check_*.py"] + python_classes = ["Check"] + python_functions = ["*_check"] + .. tab:: ini .. code-block:: ini @@ -154,6 +171,14 @@ The test collection would look like this: You can check for multiple glob patterns by adding a space between the patterns: +.. tab:: toml + + .. code-block:: toml + + # Example 2: have pytest look for files with "test" and "example" + [pytest] + python_files = ["test_*.py", "example_*.py"] + .. tab:: ini .. code-block:: ini @@ -184,6 +209,13 @@ which would run the respective test module. Like with other options, through a configuration file and the :confval:`addopts` option you can make this change more permanently: +.. tab:: toml + + .. code-block:: toml + + [pytest] + addopts = ["--pyargs"] + .. tab:: ini .. code-block:: ini @@ -228,6 +260,13 @@ Customizing test collection You can easily instruct ``pytest`` to discover tests from every Python file: +.. tab:: toml + + .. code-block:: toml + + [pytest] + python_files = ["*.py"] + .. tab:: ini .. code-block:: ini diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 7c1822efae5..7effb480480 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -11,6 +11,13 @@ every time you use ``pytest``. For example, if you always want to see detailed info on skipped and xfailed tests, as well as have terser "dot" progress output, you can write it into a configuration file: +.. tab:: toml + + .. code-block:: toml + + [pytest] + addopts = ["-ra", "-q"] + .. tab:: ini .. code-block:: ini diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 70a2e1d3872..83c6a5f4b56 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -96,6 +96,13 @@ For new projects, we recommend to use ``importlib`` :ref:`import mode