diff --git a/AUTHORS b/AUTHORS index 972f39aa45e..9094100cb4e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -89,6 +89,7 @@ Charles Machalow Charles-Meldhine Madi Mnemoi (cmnemoi) Charnjit SiNGH (CCSJ) Cheuk Ting Ho +Chris Burr Chris Mahoney Chris Lamb Chris NeJame diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index d9b95a2c95f..fcfb88536c3 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-9.1.1 release-9.1.0 release-9.0.3 release-9.0.2 diff --git a/doc/en/announce/release-9.1.1.rst b/doc/en/announce/release-9.1.1.rst new file mode 100644 index 00000000000..c4becceefd0 --- /dev/null +++ b/doc/en/announce/release-9.1.1.rst @@ -0,0 +1,17 @@ +pytest-9.1.1 +======================================= + +pytest 9.1.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 +* Ran Benita + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 3184c9a22e2..97ea7b426a9 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:1563 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1564 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 b15c7e48aba..c5601712b00 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -31,6 +31,25 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 9.1.1 (2026-06-19) +========================= + +Bug fixes +--------- + +- `#14220 `_: Fixed a logic bug in :class:`pytest.RaisesGroup` which would might cause it to display incorrect "It matches `FooError()` which was paired with `BarError`" messages. + + +- `#14591 `_: Fixed a regression in pytest 9.1.0 which caused overriding a parametrized fixture with an indirect `@pytest.mark.parametrize` to fail with "duplicate parametrization of ''". + + +- `#14606 `_: Fixed ``list-item`` typing errors from mypy in :ref:`@pytest.mark.parametrize ` ``argvalues`` parameter. + + +- `#14608 `_: Fixed a regression in pytest 9.1.0 where ``conftest.py`` files located in ``/test*`` were no longer loaded as initial conftests when invoked without arguments. + This could cause certain hooks (like :hook:`pytest_addoption`) in these files to not fire. + + pytest 9.1.0 (2026-06-13) ========================= diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 7e118d0b2ca..8e7e58f9829 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 4f11f0d4dba..3dd87a71cb7 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -142,7 +142,7 @@ The test collection would look like this: configfile: pytest.toml collected 2 items - + @@ -205,7 +205,7 @@ You can always peek at the collection tree without running tests like this: configfile: pytest.toml collected 3 items - + diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index a07927280ae..dff53488c88 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -165,7 +165,7 @@ Now we'll get feedback on a bad argument: $ pytest -q --cmdopt=type3 ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...] - pytest: error: argument --cmdopt: invalid choice: 'type3' (choose from type1, type2) + pytest: error: argument --cmdopt: invalid choice: 'type3' (choose from 'type1', 'type2') inifile: None rootdir: /home/sweet/project diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 1bef840b891..f8deae77e3e 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -20,7 +20,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 9.1.0 + pytest 9.1.1 .. _`simpletest`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index c89d38c4bab..0ffc0778f9f 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -1049,7 +1049,8 @@ without having to repeat all those steps again. class TestLandingPageSuccess: @pytest.fixture(scope="class", autouse=True) - def login(self, driver, base_url, user): + @classmethod + def login(cls, driver, base_url, user): driver.get(urljoin(base_url, "/login")) page = LoginPage(driver) page.login(user) @@ -1092,7 +1093,8 @@ could handle it by adding something like this to the test file: class TestLandingPageBadCredentials: @pytest.fixture(scope="class") - def faux_user(self, user): + @classmethod + def faux_user(cls, user): _user = deepcopy(user) _user.password = "badpass" return _user @@ -1423,7 +1425,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/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 3c088d661df..e4c986f353d 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 :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Apr 07, 2023 N/A N/A :pypi:`pytest-abstracts` A pytest fixture for testing abstract interface implementations May 15, 2026 4 - Beta pytest>=7.4.0 - :pypi:`pytest-accept` Mar 01, 2026 N/A pytest>=7 + :pypi:`pytest-accept` Jun 11, 2026 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-adbc-replay` pytest plugin to record and replay ADBC database queries Mar 13, 2026 5 - Production/Stable pytest>=8.0 + :pypi:`pytest-adbc-replay` pytest plugin to record and replay ADBC database queries Jun 17, 2026 5 - Production/Stable pytest>=8.0 :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -70,7 +70,7 @@ This list contains 2004 plugins. :pypi:`pytest-aioboto3` Aioboto3 Pytest with Moto Jan 17, 2025 N/A N/A :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiogram` May 06, 2023 N/A N/A - :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Jan 23, 2025 4 - Beta pytest>=6.1.0 + :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Jun 07, 2026 4 - Beta pytest>=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-aiohutils` Pytest plugin providing fixtures and configuration for aiohutils projects (offline, record, cleanup modes). Apr 23, 2026 N/A pytest @@ -93,10 +93,12 @@ This list contains 2004 plugins. :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 Feb 18, 2026 4 - Beta pytest>=6.2.0 + :pypi:`pytest-amgi` Pytest helpers for AMGI applications Jun 14, 2026 N/A pytest>=9.0.3 :pypi:`pytest-ampel-core` A plugin to provide AmpelContext fixtures in pytest Dec 17, 2025 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 :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jul 31, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-anki2` A pytest plugin for testing Anki add-ons Jun 10, 2026 5 - Production/Stable pytest>=7.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 Apr 01, 2026 5 - Production/Stable pytest>=6 @@ -191,7 +193,7 @@ This list contains 2004 plugins. :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. 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-balance` Intelligent test distribution for pytest based on actual execution times, not file count Apr 09, 2026 3 - Alpha pytest>=8 + :pypi:`pytest-balance` Load-balanced test sharding for pytest, by real execution time Jun 15, 2026 4 - Beta pytest>=8 :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 @@ -212,12 +214,13 @@ This list contains 2004 plugins. :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-beartype-tests` Pytest plugin that applies @beartype to every collected test function. Apr 26, 2026 4 - Beta pytest>=8 - :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 05, 2026 3 - Alpha pytest + :pypi:`pytest-bec-e2e` BEC pytest plugin for end-to-end tests Jun 17, 2026 3 - Alpha pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-beehave` A pytest plugin that generates test stubs from Gherkin feature files, checks consistency, and displays BDD steps in pytest output May 20, 2026 5 - Production/Stable pytest>=9.0.3; extra == "dev" :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 :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Nov 09, 2025 5 - Production/Stable pytest>=8.1 + :pypi:`pytest-benchmem` The memory companion to pytest-benchmark: a memray peak-memory pass on the same test, plus dims-aware plots and cross-version sweeps. Jun 16, 2026 3 - Alpha pytest>=7 :pypi:`pytest-better-datadir` A small example package Mar 13, 2023 N/A N/A :pypi:`pytest-better-parametrize` Better description of parametrized test cases Mar 05, 2024 4 - Beta pytest >=6.2.0 :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) @@ -234,7 +237,7 @@ This list contains 2004 plugins. :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. Dec 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-bluezenv` pytest BlueZ environment plugin May 12, 2026 3 - Alpha pytest>=8 + :pypi:`pytest-bluezenv` pytest BlueZ environment plugin Jun 13, 2026 3 - Alpha pytest>=8 :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. May 13, 2026 N/A pytest :pypi:`pytest-bods-v04-fixtures` Pytest plugin providing a parametrized fixture over the canonical BODS v0.4 fixtures pack Apr 20, 2026 N/A pytest>=7.0 @@ -348,8 +351,8 @@ This list contains 2004 plugins. :pypi:`pytest-cocotb-cov` Pytest plugin for measuring HDL coverage. Nov 09, 2025 5 - Production/Stable pytest :pypi:`pytest-cocotb-fusesoc` Pytest plugin to integrate FuseSoC with Cocotb. Jan 07, 2026 5 - Production/Stable pytest :pypi:`pytest-cocotb-pyuvm` Pytest plugin that enables using pytest as the regression manager for running pyuvm tests. Nov 09, 2025 5 - Production/Stable pytest - :pypi:`pytest-codeblock` Pytest plugin to collect and test code blocks in reStructuredText and Markdown files. Apr 07, 2026 4 - Beta pytest - :pypi:`pytest_codeblocks` Test code blocks in your READMEs Sep 17, 2023 5 - Production/Stable pytest >= 7.0.0 + :pypi:`pytest-codeblock` Pytest plugin to collect and test code blocks in reStructuredText and Markdown files. Jun 09, 2026 4 - Beta pytest + :pypi:`pytest-codeblocks` Test code blocks in your READMEs Jun 15, 2026 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-codecarbon` Pytest plugin for measuring carbon emissions Jun 15, 2022 N/A pytest :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Mar 25, 2025 4 - Beta pytest>=4.6.0 @@ -382,7 +385,7 @@ This list contains 2004 plugins. :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 - :pypi:`pytest-conversational` pytest plugin for multi-turn dialogue testing with a pluggable bot adapter. Rule-based, no LLM dependency. May 23, 2026 3 - Alpha pytest>=7.0; extra == "dev" + :pypi:`pytest-conversational` pytest plugin for multi-turn dialogue testing with a pluggable bot adapter. Rule-based, no LLM dependency. Jun 12, 2026 3 - Alpha pytest>=7.0; extra == "dev" :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 📒 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 @@ -476,7 +479,7 @@ This list contains 2004 plugins. :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 Dec 12, 2025 5 - Production/Stable pytest<10,>=6 + :pypi:`pytest-describe` Describe-style plugin for pytest Jun 12, 2026 5 - Production/Stable pytest<10,>=7 :pypi:`pytest-describe-beautifully` Beautiful terminal and HTML output for pytest-describe. Jan 28, 2026 4 - Beta pytest>=7.0 :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 @@ -602,16 +605,16 @@ This list contains 2004 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. May 15, 2026 5 - Production/Stable pytest>=7.0 - :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. May 15, 2026 5 - Production/Stable N/A - :pypi:`pytest-embedded-arduino-cli` A pytest plugin to test Arduino projects using pytest-embedded and arduino-cli May 20, 2026 N/A pytest>=8 - :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. May 15, 2026 5 - Production/Stable N/A - :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. May 15, 2026 5 - Production/Stable N/A - :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. May 15, 2026 5 - Production/Stable N/A - :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. May 15, 2026 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. May 15, 2026 5 - Production/Stable N/A - :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. May 15, 2026 5 - Production/Stable N/A - :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. May 15, 2026 5 - Production/Stable N/A + :pypi:`pytest-embedded` A pytest plugin that designed for embedded testing. Jun 16, 2026 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-embedded-arduino` Make pytest-embedded plugin work with Arduino. Jun 16, 2026 5 - Production/Stable N/A + :pypi:`pytest-embedded-arduino-cli` A pytest plugin to test Arduino projects using pytest-embedded and arduino-cli Jun 17, 2026 N/A pytest>=8 + :pypi:`pytest-embedded-idf` Make pytest-embedded plugin work with ESP-IDF. Jun 16, 2026 5 - Production/Stable N/A + :pypi:`pytest-embedded-jtag` Make pytest-embedded plugin work with JTAG. Jun 16, 2026 5 - Production/Stable N/A + :pypi:`pytest-embedded-nuttx` Make pytest-embedded plugin work with NuttX. Jun 16, 2026 5 - Production/Stable N/A + :pypi:`pytest-embedded-qemu` Make pytest-embedded plugin work with QEMU. Jun 16, 2026 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial` Make pytest-embedded plugin work with Serial. Jun 16, 2026 5 - Production/Stable N/A + :pypi:`pytest-embedded-serial-esp` Make pytest-embedded plugin work with Espressif target boards. Jun 16, 2026 5 - Production/Stable N/A + :pypi:`pytest-embedded-wokwi` Make pytest-embedded plugin work with the Wokwi CLI. Jun 16, 2026 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) @@ -654,6 +657,7 @@ This list contains 2004 plugins. :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-exec-core` Core execution engine for an HTTP-triggered pytest runner: output parsing and summarisation, test input provisioning, and command assembly. Jun 17, 2026 4 - Beta N/A :pypi:`pytest-executable` pytest plugin for testing executables Oct 07, 2023 N/A pytest <8,>=5 :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A :pypi:`pytest-exit-code` A pytest plugin that overrides the built-in exit codes to retain more information about the test results. May 06, 2024 4 - Beta pytest>=6.2.0 @@ -661,7 +665,8 @@ This list contains 2004 plugins. :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A :pypi:`pytest-expectdir` A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one Mar 19, 2023 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-expected` Record and play back your expectations Feb 26, 2025 N/A pytest - :pypi:`pytest-expecter` Better testing with expecter and pytest. Sep 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-expected-json` A reusable pytest fixture for loading expected test data from JSON files Jun 09, 2026 3 - Alpha pytest>=7.0 + :pypi:`pytest-expecter` Better testing with expecter and pytest. Jun 13, 2026 5 - Production/Stable N/A :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) :pypi:`pytest-expect-test` A fixture to support expect tests in pytest Apr 10, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) @@ -675,7 +680,7 @@ This list contains 2004 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 Mar 09, 2026 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 Jun 11, 2026 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 @@ -690,7 +695,9 @@ This list contains 2004 plugins. :pypi:`pytest-fakellm` Pytest fixtures for the fakellm mock OpenAI/Anthropic server — spin up, reset, and assert with zero boilerplate. May 21, 2026 4 - Beta pytest>=7.0 :pypi:`pytest-faker` Faker integration with the pytest framework. Dec 19, 2016 6 - Mature N/A :pypi:`pytest-falcon` Pytest helpers for Falcon. Sep 07, 2016 4 - Beta N/A + :pypi:`pytest-familywise` Pytest plugin for Holm-Bonferroni correction of randomized tests Jun 12, 2026 N/A pytest>=7.0 :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A + :pypi:`pytest-fast` Resident forkserver-based pytest accelerator — collect once, fork warm workers, idempotently respawn on source/env change. POSIX only (uses forkserver). Jun 14, 2026 N/A pytest>=8.0 :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-fastcollect` A high-performance pytest plugin that replaces test collection with a Rust-based implementation Nov 19, 2025 N/A pytest>=7.0.0 @@ -743,7 +750,7 @@ This list contains 2004 plugins. :pypi:`pytest-flakehunter` Re-run tests N times, visualize failure heatmaps, and get AI root cause hypotheses Apr 07, 2026 N/A pytest>=7.0 :pypi:`pytest-flakemark` Differential execution tracer that finds the exact file, line, and root cause of any flaky test. May 01, 2026 4 - Beta pytest>=7.0 :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) - :pypi:`pytest-flakiness` Pytest reporter for Flakiness.io May 15, 2026 N/A pytest>=9.0.2 + :pypi:`pytest-flakiness` Pytest reporter for Flakiness.io Jun 12, 2026 N/A pytest>=9.0.2 :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Oct 23, 2023 5 - Production/Stable pytest >=5.2 :pypi:`pytest-flask-ligand` May 14, 2026 4 - Beta pytest>=7.3 @@ -752,7 +759,7 @@ This list contains 2004 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 Jun 06, 2026 3 - Alpha pytest + :pypi:`pytest-fly` pytest runner and observer Jun 15, 2026 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 @@ -793,7 +800,7 @@ This list contains 2004 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 02, 2026 N/A pytest>=3.6 + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jun 16, 2026 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 Dec 28, 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 @@ -821,7 +828,6 @@ This list contains 2004 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 Dec 24, 2025 N/A pytest<9.0.0,>=8.3.3 :pypi:`pytest-green-light` Pytest plugin that gives SQLAlchemy async engines the green light - automatically fixes MissingGreenlet errors Nov 03, 2025 3 - Alpha pytest>=7.0.0 :pypi:`pytest-greet` Oct 21, 2025 N/A N/A :pypi:`pytest-gremlins` Fast-first mutation testing for pytest. Let the gremlins loose, see which ones survive. Apr 03, 2026 3 - Alpha pytest>=7.0.0 @@ -851,8 +857,8 @@ This list contains 2004 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 06, 2026 3 - Alpha pytest==9.0.3 - :pypi:`pytest-homeassistant-custom-component-framework` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 06, 2026 3 - Alpha pytest==9.0.3 + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 13, 2026 3 - Alpha pytest==9.0.3 + :pypi:`pytest-homeassistant-custom-component-framework` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 13, 2026 3 - Alpha pytest==9.0.3 :pypi:`pytest-Honda-report` Enterprise-grade pytest HTML report plugin with Chinese UI, API details, and historical trends Apr 11, 2026 4 - Beta pytest>=7.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 @@ -870,7 +876,7 @@ This list contains 2004 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. Mar 30, 2026 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` Generate Actionable, automatic screenshots, unified Mobile friendly Pytest HTML report in less than 3 seconds — no hooks, merge plugins, no config, xdist-ready. May 07, 2026 5 - Production/Stable N/A + :pypi:`pytest-html-plus` Generate Actionable, automatic screenshots, unified Mobile friendly Pytest HTML report in less than 3 seconds — no hooks, merge plugins, no config, xdist-ready. Jun 10, 2026 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-report-builder` A pytest plugin that generates self-contained HTML automation reports with visual charts. Apr 22, 2026 N/A pytest>=7.0 @@ -880,13 +886,13 @@ This list contains 2004 plugins. :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 Jun 04, 2026 5 - Production/Stable N/A - :pypi:`pytest-httpchain-core` Shared base types for pytest-httpchain Jun 04, 2026 N/A N/A - :pypi:`pytest-httpchain-jsonref` JSON reference ($ref) support for pytest-httpchain Jun 04, 2026 N/A N/A + :pypi:`pytest-httpchain` pytest plugin for HTTP testing using JSON files Jun 15, 2026 5 - Production/Stable pytest>=8.4 + :pypi:`pytest-httpchain-core` Shared base types for pytest-httpchain Jun 15, 2026 N/A N/A + :pypi:`pytest-httpchain-jsonref` JSON reference ($ref) support for pytest-httpchain Jun 15, 2026 N/A N/A :pypi:`pytest-httpchain-mcp` MCP server for pytest-httpchain Apr 02, 2026 N/A N/A - :pypi:`pytest-httpchain-models` Pydantic models for pytest-httpchain Jun 04, 2026 N/A N/A - :pypi:`pytest-httpchain-templates` Templating support for pytest-httpchain Jun 04, 2026 N/A N/A - :pypi:`pytest-httpchain-userfunc` User functions support for pytest-httpchain Jun 04, 2026 N/A N/A + :pypi:`pytest-httpchain-models` Pydantic models for pytest-httpchain Jun 15, 2026 N/A N/A + :pypi:`pytest-httpchain-templates` Templating support for pytest-httpchain Jun 15, 2026 N/A N/A + :pypi:`pytest-httpchain-userfunc` User functions support for pytest-httpchain Jun 15, 2026 N/A N/A :pypi:`pytest-httpdbg` A pytest plugin to record HTTP(S) requests with stack trace. Mar 29, 2026 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 @@ -957,9 +963,9 @@ This list contains 2004 plugins. :pypi:`pytest-ipso` pytest plugin for running ipso notebook cell tests Mar 24, 2026 N/A pytest :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 14, 2026 N/A pytest + :pypi:`pytest-ipywidgets` Jun 16, 2026 N/A pytest :pypi:`pytest-isolate` Run pytest tests in isolated subprocesses Jun 01, 2026 4 - Beta pytest - :pypi:`pytest-isolated` Run marked pytest tests in grouped subprocesses (cross-platform). Mar 04, 2026 4 - Beta pytest>=7.0 + :pypi:`pytest-isolated` Run marked pytest tests in grouped subprocesses (cross-platform). Jun 15, 2026 4 - Beta pytest>=7.0 :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-issues` Decorators for pytest tests that should issue exceptions or warnings May 29, 2026 5 - Production/Stable pytest>=8 @@ -983,7 +989,7 @@ This list contains 2004 plugins. :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-jscov` Pytest plugin for JavaScript coverage via Playwright CDP Apr 04, 2026 N/A pytest :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A - :pypi:`pytest-json-ctrf` Pytest plugin to generate json report in CTRF (Common Test Report Format) Apr 30, 2026 N/A pytest>6.0.0 + :pypi:`pytest-json-ctrf` Pytest plugin to generate json report in CTRF (Common Test Report Format) Jun 09, 2026 N/A pytest>6.0.0 :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) @@ -991,11 +997,11 @@ This list contains 2004 plugins. :pypi:`pytest-jsonschema` A pytest plugin to perform JSONSchema validations Nov 07, 2025 5 - Production/Stable pytest>=6.2.0 :pypi:`pytest-jsonschema-snapshot` Pytest plugin for automatic JSON Schema generation and validation from examples Mar 29, 2026 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 Apr 07, 2026 N/A pytest>=8.3.5 + :pypi:`pytest-jubilant` Add your description here Jun 09, 2026 N/A pytest>=8.3.5 :pypi:`pytest-junit-logging` A pytest plugin for embedding log output into JUnit XML reports Nov 27, 2025 4 - Beta pytest>=6.0 :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-jupyter-deploy` Pytest plugin for E2E testing of jupyter-deploy templates May 27, 2026 3 - Alpha pytest>=8.3.5 + :pypi:`pytest-jupyter-deploy` Pytest plugin for E2E testing of jupyter-deploy templates Jun 11, 2026 3 - Alpha pytest>=8.3.5 :pypi:`pytest-jupyterhub` A reusable JupyterHub pytest plugin Apr 25, 2023 5 - Production/Stable pytest :pypi:`pytest-just` A pytest plugin for testing justfile recipes Mar 22, 2026 3 - Alpha pytest>=8.0.0 :pypi:`pytest-jux` A pytest plugin for signing and publishing JUnit XML test reports to the Jux REST API Jan 08, 2026 3 - Alpha pytest>=7.4 @@ -1035,7 +1041,7 @@ This list contains 2004 plugins. :pypi:`pytest-leak-finder` Find the test that's leaking before the one that fails Dec 19, 2025 4 - Beta pytest>=3.5.0 :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-leaping` A simple plugin to use with pytest Mar 27, 2024 4 - Beta pytest>=6.2.0 - :pypi:`pytest-leela` Type-aware mutation testing for Python — fast, opinionated, pytest-native Apr 27, 2026 3 - Alpha pytest>=7.0 + :pypi:`pytest-leela` Type-aware mutation testing for Python — fast, opinionated, pytest-native Jun 10, 2026 3 - Alpha pytest>=7.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. Feb 27, 2026 4 - Beta pytest>=8.3.5 @@ -1052,6 +1058,7 @@ This list contains 2004 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-live-pause` Pytest plugin and protocol for pausing live test execution and resuming in-process Jun 10, 2026 N/A pytest>=9.0.3 :pypi:`pytest-liveview` Pytest plugin that shows a real-time test dashboard in a local web server Mar 09, 2026 N/A pytest>=7.0 :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-llm-agent` LLM Agent for working with pytest Dec 16, 2025 N/A pytest>=9.0.2 @@ -1061,7 +1068,7 @@ This list contains 2004 plugins. :pypi:`pytest-llm-rubric` A pytest plugin for rubric-based LLM-as-judge testing with auto-discovery and preflight Apr 07, 2026 3 - Alpha pytest>=7.2 :pypi:`pytest-llmtest` The pytest for LLMs — fast, Pydantic-based assertions for AI applications Mar 08, 2026 3 - Alpha pytest>=7.0; extra == "dev" :pypi:`pytest-lobster` Pytest to generate lobster tracing files Jul 26, 2025 N/A pytest>=7.0 - :pypi:`pytest-local-badge` Pytest plugin that writes self-hosted SVG status and coverage badges to your repo — no third-party shield service required. May 22, 2026 5 - Production/Stable pytest>=8.4 + :pypi:`pytest-local-badge` Pytest plugin that writes self-hosted SVG badges (tests, coverage, skipped, xfailed, warnings, duration) to your repo — no third-party shield service required. Jun 08, 2026 5 - Production/Stable pytest>=8.4 :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Nov 16, 2025 5 - Production/Stable pytest :pypi:`pytest-localserver` pytest plugin to test server connections locally. Nov 24, 2025 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) @@ -1096,7 +1103,7 @@ This list contains 2004 plugins. :pypi:`pytest-markdir` Feb 01, 2026 N/A pytest<10,>=8.0 :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) - :pypi:`pytest-markdown-console` A pytest extension to test console code blocks in markdown files. May 31, 2026 N/A pytest>=8 + :pypi:`pytest-markdown-console` A pytest extension to test console code blocks in markdown files. Jun 07, 2026 N/A pytest>=8 :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Mar 23, 2026 N/A pytest>=7.0.0 :pypi:`pytest-markdown-report` Token-efficient markdown test reports for LLM-based TDD agents Jan 10, 2026 N/A pytest>=7.0 :pypi:`pytest-markdown-summary` A Pytest plugin for generating reports in Markdown format. Apr 30, 2026 3 - Alpha pytest<10,>=7 @@ -1138,8 +1145,8 @@ This list contains 2004 plugins. :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. May 19, 2026 N/A pytest<9,>=7.2.1 - :pypi:`pytest-mfd-logging` Module for handling PyTest logging. Nov 14, 2025 N/A pytest<9,>=7.2.1 + :pypi:`pytest-mfd-config` Pytest Plugin that handles test and topology configs and all their belongings like helper fixtures. Jun 10, 2026 N/A pytest<10,>=9.0.3 + :pypi:`pytest-mfd-logging` Module for handling PyTest logging. Jun 15, 2026 N/A pytest<10,>=9.0.3 :pypi:`pytest-mg` A tiny plugin for pytest which runs MongoDB in Docker May 11, 2026 5 - Production/Stable pytest>=8.0 :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) @@ -1192,7 +1199,7 @@ This list contains 2004 plugins. :pypi:`pytest-mpl-oggm` pytest plugin to help with testing figures output from Matplotlib - OGGM fork Mar 09, 2026 5 - Production/Stable pytest>=6.2.5 :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Mar 27, 2026 4 - Beta pytest>=6 :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Jan 28, 2026 5 - Production/Stable pytest<10; extra == "test" - :pypi:`pytest-mrt` Catch database migration rollback failures before they reach production Jun 06, 2026 5 - Production/Stable pytest>=7.0 + :pypi:`pytest-mrt` Catch database migration rollback failures before they reach production Jun 16, 2026 5 - Production/Stable pytest>=7.0 :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 Dec 28, 2025 N/A pytest :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 05, 2024 N/A N/A @@ -1227,6 +1234,7 @@ This list contains 2004 plugins. :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jun 03, 2026 N/A pytest<10.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-nijam` pytest plugin for Nijam — captures test runs and ships them to the Nijam API. Jun 13, 2026 N/A pytest>=7.0 :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 :pypi:`pytest-nocustom` Run all tests without custom markers Aug 05, 2024 5 - Production/Stable N/A :pypi:`pytest-node-dependency` pytest plugin for controlling execution flow Apr 10, 2024 5 - Production/Stable N/A @@ -1245,7 +1253,7 @@ This list contains 2004 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, 2026 N/A pytest>=7.1.2; extra == "dev" + :pypi:`pytest-oarepo` Jun 07, 2026 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) @@ -1271,13 +1279,13 @@ This list contains 2004 plugins. :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) 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 tests in a specific order Apr 26, 2026 5 - Production/Stable pytest>=6.2.4; python_version < "3.14" + :pypi:`pytest-order` pytest plugin to run tests in a specific order Jun 13, 2026 5 - Production/Stable pytest>=6.2.4; python_version < "3.14" :pypi:`pytest-ordered` Declare the order in which tests should run in your pytest.ini Nov 09, 2025 N/A pytest>=6.2.0 :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-order-modify` 新增run_marker 来自定义用例的执行顺序 Nov 04, 2022 N/A N/A :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 29, 2026 N/A pytest==9.0.3 + :pypi:`pytest-otel` OpenTelemetry plugin for Pytest Jun 15, 2026 N/A pytest==9.1.0 :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 @@ -1344,7 +1352,7 @@ This list contains 2004 plugins. :pypi:`pytest-playwright-artifacts` Capture screenshots, HTML, and console logs on Playwright test failures May 21, 2026 N/A N/A :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 May 18, 2026 N/A pytest<10.0.0,>=6.2.4 - :pypi:`pytest-playwright-axe` An axe-core integration for accessibility testing using Playwright Python. Jun 05, 2026 5 - Production/Stable N/A + :pypi:`pytest-playwright-axe` An axe-core integration for accessibility testing using Playwright Python. Jun 12, 2026 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-playwright-json` Generate Playwright-compatible JSON reports from pytest-playwright test runs Jan 06, 2026 4 - Beta pytest>=7.0.0 :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A @@ -1449,7 +1457,7 @@ This list contains 2004 plugins. :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-qemu-pic32mk` pytest plugin for QEMU-based functional tests targeting PIC32MK (MIPS32) firmware May 17, 2026 N/A pytest>=7.0 - :pypi:`pytest-qfield` A pytest plugin for testing QField qml plugins Jun 05, 2026 N/A N/A + :pypi:`pytest-qfield` A pytest plugin for testing QField qml plugins Jun 12, 2026 N/A N/A :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Apr 01, 2026 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 @@ -1497,7 +1505,7 @@ This list contains 2004 plugins. :pypi:`pytest_relay` A plugin to relay test information and control from and to pytest Jan 31, 2026 4 - Beta pytest>=6.2.0 :pypi:`pytest-relay-run` A pytest wrapper using for pytest-relay with pytest-relay-ws to control pytest executions. Jan 31, 2026 4 - Beta pytest>=6.2.0 :pypi:`pytest_relay_ws` An extension plugin to pytest-relay to relay pytest information via websockets Jan 31, 2026 4 - Beta pytest>=6.2.0 - :pypi:`pytest-remaster` Pytest plugin for golden master (characterisation) testing with automatic expected file regeneration. Apr 09, 2026 3 - Alpha pytest>=7 + :pypi:`pytest-remaster` Pytest plugin for golden master (characterisation) testing with automatic expected file regeneration. Jun 15, 2026 3 - Alpha pytest>=7 :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Sep 26, 2023 5 - Production/Stable pytest >=4.6 :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Apr 26, 2023 5 - Production/Stable pytest (>=4.6) @@ -1539,6 +1547,7 @@ This list contains 2004 plugins. :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures May 22, 2026 5 - Production/Stable pytest!=8.2.2,>=8.1 :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 30, 2025 4 - Beta pytest + :pypi:`pytest-resilience-agent` pytest plugin that auto-generates resilience tests for LLM apps using Lark MCP and TrueFoundry AI Gateway Jun 13, 2026 3 - Alpha pytest>=8.0 :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Apr 29, 2026 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 17, 2026 5 - Production/Stable pytest>=3.5.0 @@ -1582,7 +1591,7 @@ This list contains 2004 plugins. :pypi:`pytest-route-coverage` pytest plugin to generate reports on routes coverage for web applications. Apr 02, 2026 N/A pytest>=7.2.2 :pypi:`pytest-routes` Property-based smoke testing for ASGI application routes Dec 01, 2025 3 - Alpha pytest>=7.0 :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-rs` A fast, drop-in compatible pytest runner written in Rust Jun 06, 2026 3 - Alpha N/A + :pypi:`pytest-rs` A fast, drop-in compatible pytest runner written in Rust Jun 16, 2026 3 - Alpha N/A :pypi:`pytest-r-snapshot` A pytest plugin for snapshot testing against R code outputs Jan 02, 2026 3 - Alpha pytest>=7.0.0 :pypi:`pytest-rst` Test code from RST documents with pytest Feb 22, 2026 N/A N/A :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A @@ -1608,7 +1617,7 @@ This list contains 2004 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 05, 2026 5 - Production/Stable N/A + :pypi:`pytest-sbase` SeleniumBase is a framework for web crawling, scraping, and testing. Supports pytest. CDP Mode adds stealth. Includes many tools. Jun 16, 2026 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 18, 2026 5 - Production/Stable pytest<10,>=7.4 :pypi:`pytest-scenarios` Add your description here Jan 03, 2026 N/A N/A @@ -1621,7 +1630,7 @@ This list contains 2004 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 05, 2026 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` SeleniumBase is a framework for web crawling, scraping, and testing. Supports pytest. CDP Mode adds stealth. Includes many tools. Jun 16, 2026 5 - Production/Stable N/A :pypi:`pytest-selenium-driver` A zero-boilerplate Selenium WebDriver fixture for pytest Mar 07, 2026 4 - Beta pytest>=7.0 :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 @@ -1727,7 +1736,7 @@ This list contains 2004 plugins. :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 - :pypi:`pytest-sqlalchemy-alembic` Pytest plugin to manage databases, sessions and migrations for sqlalchemy-based projects Jun 05, 2026 N/A pytest>=8.4.0 + :pypi:`pytest-sqlalchemy-alembic` Pytest plugin to manage databases, sessions and migrations for sqlalchemy-based projects Jun 15, 2026 N/A pytest>=8.4 :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Aug 10, 2024 3 - Alpha pytest>=7.0.0 :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 @@ -1776,6 +1785,7 @@ This list contains 2004 plugins. :pypi:`pytest-swag` Generate OpenAPI documentation from pytest tests Apr 14, 2026 3 - Alpha pytest>=7.0 :pypi:`pytest-swarm` Run parametrized test variants in parallel threads — with correct fixture lifecycle May 29, 2026 N/A pytest>=7.0 :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A + :pypi:`pytest-synapse` A pytest plugin for OpenAPI contract test coverage Jun 11, 2026 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A :pypi:`pytest_tagging` a pytest plugin to tag tests Nov 08, 2024 N/A pytest>=7.1.3 @@ -1820,7 +1830,7 @@ This list contains 2004 plugins. :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Mar 03, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-test-observer` A pytest plugin for observing test execution events. May 23, 2026 3 - Alpha pytest>=7.0 + :pypi:`pytest-test-observer` A pytest plugin for observing test execution events. Jun 13, 2026 3 - Alpha pytest>=7.0 :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` A pytest plugin for creating TestRail runs and adding results Jan 25, 2026 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-testrail2` A pytest plugin to upload results to TestRail. Feb 10, 2023 N/A pytest (<8.0,>=7.2.0) @@ -1897,7 +1907,7 @@ This list contains 2004 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-run` TUI runner for \`pytest\` tests Jun 05, 2026 N/A pytest + :pypi:`pytest-tui-run` TUI for running pytest Jun 12, 2026 N/A pytest :pypi:`pytest-tui-runner` Textual-based terminal UI for running pytest tests Dec 12, 2025 N/A pytest<=9.0.1,>=7.4 :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 @@ -1913,6 +1923,7 @@ This list contains 2004 plugins. :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-u2device` Pytest plugin for exposing uiautomator2 Android devices as fixtures Jun 10, 2026 N/A pytest>=9.0.3 :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 @@ -1925,7 +1936,7 @@ This list contains 2004 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 Jun 04, 2026 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-unordered` Test equality of unordered collections in pytest Jun 16, 2026 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. Dec 23, 2025 4 - Beta pytest>7.3.2 :pypi:`pytest-unused-port` pytest fixture finding an unused local port Oct 22, 2025 N/A pytest @@ -1979,6 +1990,7 @@ This list contains 2004 plugins. :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-why` A pytest plugin that explains failing tests like a senior engineer. Jun 14, 2026 3 - Alpha pytest>=7 :pypi:`pytest-win32consoletitle` Pytest progress in console title (Win32 only) Aug 08, 2021 N/A N/A :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A :pypi:`pytest-wirefracture` Pytest fixtures for wirefracture Dec 31, 2025 N/A N/A @@ -2093,7 +2105,7 @@ This list contains 2004 plugins. A pytest fixture for testing abstract interface implementations :pypi:`pytest-accept` - *last release*: Mar 01, 2026, + *last release*: Jun 11, 2026, *status*: N/A, *requires*: pytest>=7 @@ -2114,7 +2126,7 @@ This list contains 2004 plugins. pytest plugin for generating test execution results within Jira Test Management (tm4j) :pypi:`pytest-adbc-replay` - *last release*: Mar 13, 2026, + *last release*: Jun 17, 2026, *status*: 5 - Production/Stable, *requires*: pytest>=8.0 @@ -2296,7 +2308,7 @@ This list contains 2004 plugins. :pypi:`pytest-aiohttp` - *last release*: Jan 23, 2025, + *last release*: Jun 07, 2026, *status*: 4 - Beta, *requires*: pytest>=6.1.0 @@ -2456,6 +2468,13 @@ This list contains 2004 plugins. Fixture to automate running Amaranth simulations + :pypi:`pytest-amgi` + *last release*: Jun 14, 2026, + *status*: N/A, + *requires*: pytest>=9.0.3 + + Pytest helpers for AMGI applications + :pypi:`pytest-ampel-core` *last release*: Dec 17, 2025, *status*: 4 - Beta, @@ -2484,6 +2503,13 @@ This list contains 2004 plugins. A pytest plugin for testing Anki add-ons + :pypi:`pytest-anki2` + *last release*: Jun 10, 2026, + *status*: 5 - Production/Stable, + *requires*: pytest>=7.0 + + A pytest plugin for testing Anki add-ons + :pypi:`pytest-annotate` *last release*: Jun 07, 2022, *status*: 3 - Alpha, @@ -3143,11 +3169,11 @@ This list contains 2004 plugins. Formatting PyTest output for Azure Pipelines UI :pypi:`pytest-balance` - *last release*: Apr 09, 2026, - *status*: 3 - Alpha, + *last release*: Jun 15, 2026, + *status*: 4 - Beta, *requires*: pytest>=8 - Intelligent test distribution for pytest based on actual execution times, not file count + Load-balanced test sharding for pytest, by real execution time :pypi:`pytest-bandit` *last release*: Feb 23, 2021, @@ -3290,7 +3316,7 @@ This list contains 2004 plugins. Pytest plugin that applies @beartype to every collected test function. :pypi:`pytest-bec-e2e` - *last release*: Jun 05, 2026, + *last release*: Jun 17, 2026, *status*: 3 - Alpha, *requires*: pytest @@ -3331,6 +3357,13 @@ This list contains 2004 plugins. A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. + :pypi:`pytest-benchmem` + *last release*: Jun 16, 2026, + *status*: 3 - Alpha, + *requires*: pytest>=7 + + The memory companion to pytest-benchmark: a memray peak-memory pass on the same test, plus dims-aware plots and cross-version sweeps. + :pypi:`pytest-better-datadir` *last release*: Mar 13, 2023, *status*: N/A, @@ -3444,7 +3477,7 @@ This list contains 2004 plugins. A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. :pypi:`pytest-bluezenv` - *last release*: May 12, 2026, + *last release*: Jun 13, 2026, *status*: 3 - Alpha, *requires*: pytest>=8 @@ -4242,16 +4275,16 @@ This list contains 2004 plugins. Pytest plugin that enables using pytest as the regression manager for running pyuvm tests. :pypi:`pytest-codeblock` - *last release*: Apr 07, 2026, + *last release*: Jun 09, 2026, *status*: 4 - Beta, *requires*: pytest Pytest plugin to collect and test code blocks in reStructuredText and Markdown files. - :pypi:`pytest_codeblocks` - *last release*: Sep 17, 2023, + :pypi:`pytest-codeblocks` + *last release*: Jun 15, 2026, *status*: 5 - Production/Stable, - *requires*: pytest >= 7.0.0 + *requires*: pytest>=7.0.0 Test code blocks in your READMEs @@ -4480,7 +4513,7 @@ This list contains 2004 plugins. A pytest plugin to run tests continuously until failure or interruption. :pypi:`pytest-conversational` - *last release*: May 23, 2026, + *last release*: Jun 12, 2026, *status*: 3 - Alpha, *requires*: pytest>=7.0; extra == "dev" @@ -5138,9 +5171,9 @@ This list contains 2004 plugins. A simple plugin to use with pytest :pypi:`pytest-describe` - *last release*: Dec 12, 2025, + *last release*: Jun 12, 2026, *status*: 5 - Production/Stable, - *requires*: pytest<10,>=6 + *requires*: pytest<10,>=7 Describe-style plugin for pytest @@ -6020,70 +6053,70 @@ This list contains 2004 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 A pytest plugin that designed for embedded testing. :pypi:`pytest-embedded-arduino` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Arduino. :pypi:`pytest-embedded-arduino-cli` - *last release*: May 20, 2026, + *last release*: Jun 17, 2026, *status*: N/A, *requires*: pytest>=8 A pytest plugin to test Arduino projects using pytest-embedded and arduino-cli :pypi:`pytest-embedded-idf` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with ESP-IDF. :pypi:`pytest-embedded-jtag` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with JTAG. :pypi:`pytest-embedded-nuttx` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with NuttX. :pypi:`pytest-embedded-qemu` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with QEMU. :pypi:`pytest-embedded-serial` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Serial. :pypi:`pytest-embedded-serial-esp` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A Make pytest-embedded plugin work with Espressif target boards. :pypi:`pytest-embedded-wokwi` - *last release*: May 15, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A @@ -6383,6 +6416,13 @@ This list contains 2004 plugins. Walk your code through exception script to check it's resiliency to failures. + :pypi:`pytest-exec-core` + *last release*: Jun 17, 2026, + *status*: 4 - Beta, + *requires*: N/A + + Core execution engine for an HTTP-triggered pytest runner: output parsing and summarisation, test input provisioning, and command assembly. + :pypi:`pytest-executable` *last release*: Oct 07, 2023, *status*: N/A, @@ -6432,8 +6472,15 @@ This list contains 2004 plugins. Record and play back your expectations + :pypi:`pytest-expected-json` + *last release*: Jun 09, 2026, + *status*: 3 - Alpha, + *requires*: pytest>=7.0 + + A reusable pytest fixture for loading expected test data from JSON files + :pypi:`pytest-expecter` - *last release*: Sep 18, 2022, + *last release*: Jun 13, 2026, *status*: 5 - Production/Stable, *requires*: N/A @@ -6531,7 +6578,7 @@ This list contains 2004 plugins. Additional pytest markers to dynamically enable/disable tests viia CLI flags :pypi:`pytest-f3ts` - *last release*: Mar 09, 2026, + *last release*: Jun 11, 2026, *status*: N/A, *requires*: pytest<8.0.0,>=7.2.1 @@ -6635,6 +6682,13 @@ This list contains 2004 plugins. Pytest helpers for Falcon. + :pypi:`pytest-familywise` + *last release*: Jun 12, 2026, + *status*: N/A, + *requires*: pytest>=7.0 + + Pytest plugin for Holm-Bonferroni correction of randomized tests + :pypi:`pytest-fantasy` *last release*: Mar 14, 2019, *status*: N/A, @@ -6642,6 +6696,13 @@ This list contains 2004 plugins. Pytest plugin for Flask Fantasy Framework + :pypi:`pytest-fast` + *last release*: Jun 14, 2026, + *status*: N/A, + *requires*: pytest>=8.0 + + Resident forkserver-based pytest accelerator — collect once, fork warm workers, idempotently respawn on source/env change. POSIX only (uses forkserver). + :pypi:`pytest-fastapi` *last release*: Dec 27, 2020, *status*: N/A, @@ -7007,7 +7068,7 @@ This list contains 2004 plugins. pytest plugin to check source code with pyflakes :pypi:`pytest-flakiness` - *last release*: May 15, 2026, + *last release*: Jun 12, 2026, *status*: N/A, *requires*: pytest>=9.0.2 @@ -7070,7 +7131,7 @@ This list contains 2004 plugins. A pytest plugin in order to provide logs via fluentbit :pypi:`pytest-fly` - *last release*: Jun 06, 2026, + *last release*: Jun 15, 2026, *status*: 3 - Alpha, *requires*: pytest @@ -7357,7 +7418,7 @@ This list contains 2004 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Jun 02, 2026, + *last release*: Jun 16, 2026, *status*: N/A, *requires*: pytest>=3.6 @@ -7552,13 +7613,6 @@ This list contains 2004 plugins. Green progress dots - :pypi:`pytest-greener` - *last release*: Dec 24, 2025, - *status*: N/A, - *requires*: pytest<9.0.0,>=8.3.3 - - Pytest plugin for Greener - :pypi:`pytest-green-light` *last release*: Nov 03, 2025, *status*: 3 - Alpha, @@ -7763,14 +7817,14 @@ This list contains 2004 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 06, 2026, + *last release*: Jun 13, 2026, *status*: 3 - Alpha, *requires*: pytest==9.0.3 Experimental package to automatically extract test plugins for Home Assistant custom components :pypi:`pytest-homeassistant-custom-component-framework` - *last release*: Jun 06, 2026, + *last release*: Jun 13, 2026, *status*: 3 - Alpha, *requires*: pytest==9.0.3 @@ -7896,7 +7950,7 @@ This list contains 2004 plugins. Pytest report plugin for send HTML report on object-storage :pypi:`pytest-html-plus` - *last release*: May 07, 2026, + *last release*: Jun 10, 2026, *status*: 5 - Production/Stable, *requires*: N/A @@ -7966,21 +8020,21 @@ This list contains 2004 plugins. Easily test your HTTP library against a local copy of httpbin :pypi:`pytest-httpchain` - *last release*: Jun 04, 2026, + *last release*: Jun 15, 2026, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest>=8.4 pytest plugin for HTTP testing using JSON files :pypi:`pytest-httpchain-core` - *last release*: Jun 04, 2026, + *last release*: Jun 15, 2026, *status*: N/A, *requires*: N/A Shared base types for pytest-httpchain :pypi:`pytest-httpchain-jsonref` - *last release*: Jun 04, 2026, + *last release*: Jun 15, 2026, *status*: N/A, *requires*: N/A @@ -7994,21 +8048,21 @@ This list contains 2004 plugins. MCP server for pytest-httpchain :pypi:`pytest-httpchain-models` - *last release*: Jun 04, 2026, + *last release*: Jun 15, 2026, *status*: N/A, *requires*: N/A Pydantic models for pytest-httpchain :pypi:`pytest-httpchain-templates` - *last release*: Jun 04, 2026, + *last release*: Jun 15, 2026, *status*: N/A, *requires*: N/A Templating support for pytest-httpchain :pypi:`pytest-httpchain-userfunc` - *last release*: Jun 04, 2026, + *last release*: Jun 15, 2026, *status*: N/A, *requires*: N/A @@ -8505,7 +8559,7 @@ This list contains 2004 plugins. Pytest plugin to run tests in Jupyter Notebooks :pypi:`pytest-ipywidgets` - *last release*: May 14, 2026, + *last release*: Jun 16, 2026, *status*: N/A, *requires*: pytest @@ -8519,7 +8573,7 @@ This list contains 2004 plugins. Run pytest tests in isolated subprocesses :pypi:`pytest-isolated` - *last release*: Mar 04, 2026, + *last release*: Jun 15, 2026, *status*: 4 - Beta, *requires*: pytest>=7.0 @@ -8687,7 +8741,7 @@ This list contains 2004 plugins. Generate JSON test reports :pypi:`pytest-json-ctrf` - *last release*: Apr 30, 2026, + *last release*: Jun 09, 2026, *status*: N/A, *requires*: pytest>6.0.0 @@ -8743,7 +8797,7 @@ This list contains 2004 plugins. pytest plugin supporting json test report output :pypi:`pytest-jubilant` - *last release*: Apr 07, 2026, + *last release*: Jun 09, 2026, *status*: N/A, *requires*: pytest>=8.3.5 @@ -8771,7 +8825,7 @@ This list contains 2004 plugins. A pytest plugin for testing Jupyter libraries and extensions. :pypi:`pytest-jupyter-deploy` - *last release*: May 27, 2026, + *last release*: Jun 11, 2026, *status*: 3 - Alpha, *requires*: pytest>=8.3.5 @@ -9051,7 +9105,7 @@ This list contains 2004 plugins. A simple plugin to use with pytest :pypi:`pytest-leela` - *last release*: Apr 27, 2026, + *last release*: Jun 10, 2026, *status*: 3 - Alpha, *requires*: pytest>=7.0 @@ -9169,6 +9223,13 @@ This list contains 2004 plugins. Live results for pytest + :pypi:`pytest-live-pause` + *last release*: Jun 10, 2026, + *status*: N/A, + *requires*: pytest>=9.0.3 + + Pytest plugin and protocol for pausing live test execution and resuming in-process + :pypi:`pytest-liveview` *last release*: Mar 09, 2026, *status*: N/A, @@ -9233,11 +9294,11 @@ This list contains 2004 plugins. Pytest to generate lobster tracing files :pypi:`pytest-local-badge` - *last release*: May 22, 2026, + *last release*: Jun 08, 2026, *status*: 5 - Production/Stable, *requires*: pytest>=8.4 - Pytest plugin that writes self-hosted SVG status and coverage badges to your repo — no third-party shield service required. + Pytest plugin that writes self-hosted SVG badges (tests, coverage, skipped, xfailed, warnings, duration) to your repo — no third-party shield service required. :pypi:`pytest-localftpserver` *last release*: Nov 16, 2025, @@ -9478,7 +9539,7 @@ This list contains 2004 plugins. Test your markdown docs with pytest :pypi:`pytest-markdown-console` - *last release*: May 31, 2026, + *last release*: Jun 07, 2026, *status*: N/A, *requires*: pytest>=8 @@ -9772,16 +9833,16 @@ This list contains 2004 plugins. Custom metrics report for pytest :pypi:`pytest-mfd-config` - *last release*: May 19, 2026, + *last release*: Jun 10, 2026, *status*: N/A, - *requires*: pytest<9,>=7.2.1 + *requires*: pytest<10,>=9.0.3 Pytest Plugin that handles test and topology configs and all their belongings like helper fixtures. :pypi:`pytest-mfd-logging` - *last release*: Nov 14, 2025, + *last release*: Jun 15, 2026, *status*: N/A, - *requires*: pytest<9,>=7.2.1 + *requires*: pytest<10,>=9.0.3 Module for handling PyTest logging. @@ -10150,7 +10211,7 @@ This list contains 2004 plugins. pytest-mqtt supports testing systems based on MQTT :pypi:`pytest-mrt` - *last release*: Jun 06, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: pytest>=7.0 @@ -10394,6 +10455,13 @@ This list contains 2004 plugins. A small snippet for nicer PyTest's Parametrize + :pypi:`pytest-nijam` + *last release*: Jun 13, 2026, + *status*: N/A, + *requires*: pytest>=7.0 + + pytest plugin for Nijam — captures test runs and ships them to the Nijam API. + :pypi:`pytest_nlcov` *last release*: Aug 05, 2024, *status*: N/A, @@ -10521,7 +10589,7 @@ This list contains 2004 plugins. PyTest plugin for the OAR testing framework :pypi:`pytest-oarepo` - *last release*: Jun 06, 2026, + *last release*: Jun 07, 2026, *status*: N/A, *requires*: pytest>=7.1.2; extra == "dev" @@ -10703,7 +10771,7 @@ This list contains 2004 plugins. A pytest plugin for orchestrating tests :pypi:`pytest-order` - *last release*: Apr 26, 2026, + *last release*: Jun 13, 2026, *status*: 5 - Production/Stable, *requires*: pytest>=6.2.4; python_version < "3.14" @@ -10745,9 +10813,9 @@ This list contains 2004 plugins. A pytest plugin for instrumenting test runs via OpenTelemetry :pypi:`pytest-otel` - *last release*: Apr 29, 2026, + *last release*: Jun 15, 2026, *status*: N/A, - *requires*: pytest==9.0.3 + *requires*: pytest==9.1.0 OpenTelemetry plugin for Pytest @@ -11214,7 +11282,7 @@ This list contains 2004 plugins. A pytest wrapper with async fixtures for Playwright to automate web browsers :pypi:`pytest-playwright-axe` - *last release*: Jun 05, 2026, + *last release*: Jun 12, 2026, *status*: 5 - Production/Stable, *requires*: N/A @@ -11949,7 +12017,7 @@ This list contains 2004 plugins. pytest plugin for QEMU-based functional tests targeting PIC32MK (MIPS32) firmware :pypi:`pytest-qfield` - *last release*: Jun 05, 2026, + *last release*: Jun 12, 2026, *status*: N/A, *requires*: N/A @@ -12285,7 +12353,7 @@ This list contains 2004 plugins. An extension plugin to pytest-relay to relay pytest information via websockets :pypi:`pytest-remaster` - *last release*: Apr 09, 2026, + *last release*: Jun 15, 2026, *status*: 3 - Alpha, *requires*: pytest>=7 @@ -12578,6 +12646,13 @@ This list contains 2004 plugins. Pytest fixture for recording and replaying serial port traffic. + :pypi:`pytest-resilience-agent` + *last release*: Jun 13, 2026, + *status*: 3 - Alpha, + *requires*: pytest>=8.0 + + pytest plugin that auto-generates resilience tests for LLM apps using Lark MCP and TrueFoundry AI Gateway + :pypi:`pytest-resilient-circuits` *last release*: Apr 29, 2026, *status*: N/A, @@ -12880,7 +12955,7 @@ This list contains 2004 plugins. Extend py.test for RPC OpenStack testing. :pypi:`pytest-rs` - *last release*: Jun 06, 2026, + *last release*: Jun 16, 2026, *status*: 3 - Alpha, *requires*: N/A @@ -13062,11 +13137,11 @@ This list contains 2004 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 05, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A - A complete web automation framework for end-to-end testing. + SeleniumBase is a framework for web crawling, scraping, and testing. Supports pytest. CDP Mode adds stealth. Includes many tools. :pypi:`pytest-scenario` *last release*: Feb 06, 2017, @@ -13153,11 +13228,11 @@ This list contains 2004 plugins. pytest plugin to automatically capture screenshots upon selenium webdriver events :pypi:`pytest-seleniumbase` - *last release*: Jun 05, 2026, + *last release*: Jun 16, 2026, *status*: 5 - Production/Stable, *requires*: N/A - A complete web automation framework for end-to-end testing. + SeleniumBase is a framework for web crawling, scraping, and testing. Supports pytest. CDP Mode adds stealth. Includes many tools. :pypi:`pytest-selenium-driver` *last release*: Mar 07, 2026, @@ -13895,9 +13970,9 @@ This list contains 2004 plugins. pytest plugin with sqlalchemy related fixtures :pypi:`pytest-sqlalchemy-alembic` - *last release*: Jun 05, 2026, + *last release*: Jun 15, 2026, *status*: N/A, - *requires*: pytest>=8.4.0 + *requires*: pytest>=8.4 Pytest plugin to manage databases, sessions and migrations for sqlalchemy-based projects @@ -14237,6 +14312,13 @@ This list contains 2004 plugins. pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. + :pypi:`pytest-synapse` + *last release*: Jun 11, 2026, + *status*: 5 - Production/Stable, + *requires*: pytest>=7.0.0 + + A pytest plugin for OpenAPI contract test coverage + :pypi:`pytest-system-statistics` *last release*: Feb 16, 2022, *status*: 5 - Production/Stable, @@ -14546,7 +14628,7 @@ This list contains 2004 plugins. Plugin to use TestObject Suites with Pytest :pypi:`pytest-test-observer` - *last release*: May 23, 2026, + *last release*: Jun 13, 2026, *status*: 3 - Alpha, *requires*: pytest>=7.0 @@ -15085,11 +15167,11 @@ This list contains 2004 plugins. Text User Interface (TUI) and HTML report for Pytest test runs :pypi:`pytest-tui-run` - *last release*: Jun 05, 2026, + *last release*: Jun 12, 2026, *status*: N/A, *requires*: pytest - TUI runner for \`pytest\` tests + TUI for running pytest :pypi:`pytest-tui-runner` *last release*: Dec 12, 2025, @@ -15196,6 +15278,13 @@ This list contains 2004 plugins. A Pytest plugin that transparently re-runs tests under a matrix of timezones and locales. + :pypi:`pytest-u2device` + *last release*: Jun 10, 2026, + *status*: N/A, + *requires*: pytest>=9.0.3 + + Pytest plugin for exposing uiautomator2 Android devices as fixtures + :pypi:`pytest-ubersmith` *last release*: Apr 13, 2015, *status*: N/A, @@ -15281,7 +15370,7 @@ This list contains 2004 plugins. Run only unmarked tests :pypi:`pytest-unordered` - *last release*: Jun 03, 2025, + *last release*: Jun 16, 2026, *status*: 4 - Beta, *requires*: pytest>=7.0.0 @@ -15658,6 +15747,13 @@ This list contains 2004 plugins. pytest addon for displaying the whole node id for failures + :pypi:`pytest-why` + *last release*: Jun 14, 2026, + *status*: 3 - Alpha, + *requires*: pytest>=7 + + A pytest plugin that explains failing tests like a senior engineer. + :pypi:`pytest-win32consoletitle` *last release*: Aug 08, 2021, *status*: N/A, diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index bc75c1e16fc..96b3dd6a86a 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -645,18 +645,18 @@ def _set_initial_conftests( if i != -1: path = path[:i] anchor = absolutepath(invocation_dir / path) - # Ensure we do not break if what appears to be an anchor # is in fact a very long option (#10169, #11394). - if safe_exists(anchor): - anchors.append(anchor) - # Let's also consider test* subdirs. - if anchor.is_dir(): - for x in anchor.glob("test*"): - if x.is_dir(): - anchors.append(x) + if not safe_exists(anchor): + continue + + anchors.append(anchor) + # Let's also consider test* subdirs. + if anchor.is_dir(): + anchors.extend(x for x in anchor.glob("test*") if x.is_dir()) if not anchors: - anchors = [invocation_dir] + anchors.append(invocation_dir) + anchors.extend(x for x in invocation_dir.glob("test*") if x.is_dir()) for anchor in anchors: self._loadconftestmodules( diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index c60823ed510..f4ca2eac455 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -64,6 +64,7 @@ from _pytest.deprecated import PARSEFACTORIES_NODEID_DEPRECATED from _pytest.deprecated import YIELD_FIXTURE from _pytest.main import Session +from _pytest.mark import Mark from _pytest.mark import ParameterSet from _pytest.mark.structures import MarkDecorator from _pytest.outcomes import fail @@ -1898,10 +1899,23 @@ def sort_by_scope(arg_name: str) -> Scope: def pytest_generate_tests(self, metafunc: Metafunc) -> None: """Generate new tests based on parametrized fixtures used by the given metafunc""" + + def get_parametrize_mark_argnames(mark: Mark) -> Sequence[str]: + args, _ = ParameterSet._parse_parametrize_args(*mark.args, **mark.kwargs) + return args + for argname in metafunc.fixturenames: # Get the FixtureDefs for the argname. fixture_defs = metafunc._arg2fixturedefs.get(argname, ()) + # If the test itself parametrizes using this argname, give it + # precedence. + if any( + argname in get_parametrize_mark_argnames(mark) + for mark in metafunc.definition.iter_markers("parametrize") + ): + continue + # In the common case we only look at the fixture def with the # closest scope (last in the list). But if the fixture overrides # another fixture, while requesting the super fixture, keep going diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 35fd24f8f96..5449b17a1c6 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -21,7 +21,6 @@ import warnings from .._code import getfslineno -from ..compat import deprecated from ..compat import NOTSET from ..compat import NotSetType from _pytest.config import Config @@ -537,31 +536,16 @@ def __call__( ) -> MarkDecorator: ... class _ParametrizeMarkDecorator(MarkDecorator): - @overload # type: ignore[override,no-overload-impl] - def __call__( - self, - argnames: str | Sequence[str], - argvalues: Collection[ParameterSet | Sequence[object] | object], - *, - indirect: bool | Sequence[str] = ..., - ids: Iterable[None | str | float | int | bool | _HiddenParam] - | Callable[[Any], object | None] - | None = ..., - scope: ScopeName | None = ..., - ) -> MarkDecorator: ... - - @overload - @deprecated( - "Passing a non-Collection iterable to the 'argvalues' parameter of @pytest.mark.parametrize is deprecated. " - "Convert argvalues to a list or tuple.", - ) - def __call__( + def __call__( # type: ignore[override] self, argnames: str | Sequence[str], argvalues: Iterable[ParameterSet | Sequence[object] | object], + # TODO(pytest10): Change to below after PARAMETRIZE_NON_COLLECTION_ITERABLE deprecation. + # Overload doesn't work, see #14606. + # argvalues: Collection[ParameterSet | Sequence[object] | object], *, indirect: bool | Sequence[str] = ..., - ids: Iterable[None | str | float | int | bool] + ids: Iterable[None | str | float | int | bool | _HiddenParam] | Callable[[Any], object | None] | None = ..., scope: ScopeName | None = ..., diff --git a/src/_pytest/raises.py b/src/_pytest/raises.py index aeaf82bee5c..ef91cc2c9fb 100644 --- a/src/_pytest/raises.py +++ b/src/_pytest/raises.py @@ -1354,7 +1354,7 @@ def _check_exceptions( f"\n{indent_1}{self._repr_expected(self.expected_exceptions[i_failed])}" ) for i_actual, actual in enumerate(actual_exceptions): - if results.get_result(i_exp, i_actual) is None: + if results.get_result(i_failed, i_actual) is None: # we print full repr of match target s += ( f"\n{indent_2}It matches {backquote(repr(actual))} which was paired with " diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index de3f7764aa7..7000eeccbbd 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -1185,10 +1185,13 @@ def test_setupdecorator_and_xunit(self, pytester: Pytester) -> None: pytester.makepyfile( """ import pytest + values = [] + @pytest.fixture(scope='module', autouse=True) def setup_module(): values.append("module") + @pytest.fixture(autouse=True) def setup_function(): values.append("function") @@ -1196,18 +1199,28 @@ def setup_function(): def test_func(): pass - class TestClass(object): + class TestClass: @pytest.fixture(scope="class", autouse=True) - def setup_class(self): + @classmethod + def setup_class(cls): values.append("class") + @pytest.fixture(autouse=True) def setup_method(self): values.append("method") + def test_method(self): pass + def test_all(): - assert values == ["module", "function", "class", - "function", "method", "function"] + assert values == [ + "module", + "function", + "class", + "function", + "method", + "function", + ] """ ) reprec = pytester.inline_run("-v") @@ -2467,7 +2480,8 @@ def pytest_generate_tests(metafunc): class TestClass: @pytest.fixture(scope="class", autouse=True) - def setup_teardown(self, item): + @classmethod + def setup_teardown(cls, item): values.append("setup-%d" % item) yield values.append("teardown-%d" % item) @@ -2624,6 +2638,32 @@ def test_foo(fixt, val): reprec = pytester.inline_run() reprec.assertoutcome(passed=2) + def test_override_parametrized_fixture_with_indirect( + self, pytester: Pytester + ) -> None: + """Make sure a parametrized argument can override a parametrized fixture. + + This was a regression introduced in the fix for #736. + """ + pytester.makepyfile( + """ + import pytest + + @pytest.fixture(params=["a"]) + def fixt(request): + return request.param * 2 + + def test_fixt(fixt): + assert fixt == "aa" + + @pytest.mark.parametrize("fixt", ['b'], indirect=True) + def test_indirect(fixt): + assert fixt == "bb" + """ + ) + reprec = pytester.inline_run() + reprec.assertoutcome(passed=2) + def test_scope_session(self, pytester: Pytester) -> None: pytester.makepyfile( """ @@ -3246,21 +3286,26 @@ def param1(request): values = [] class TestClass(object): - @classmethod @pytest.fixture(scope="class", autouse=True) - def setup1(self, request, param1): + @classmethod + def setup1(cls, request, param1): values.append(1) - request.addfinalizer(self.teardown1) + request.addfinalizer(cls.teardown1) + @classmethod def teardown1(self): assert values.pop() == 1 + @pytest.fixture(scope="class", autouse=True) - def setup2(self, request, param1): + @classmethod + def setup2(cls, request, param1): values.append(2) - request.addfinalizer(self.teardown2) + request.addfinalizer(cls.teardown2) + @classmethod - def teardown2(self): + def teardown2(cls): assert values.pop() == 2 + def test(self): pass diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 96c4819e127..916bf1fdbd2 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -1743,7 +1743,8 @@ def test_2(): class Test: @pytest.fixture(scope="class") - def fixture(self, fixture): + @classmethod + def fixture(cls, fixture): pass @pytest.mark.parametrize("fixture", [0], indirect=True) diff --git a/testing/python/raises_group.py b/testing/python/raises_group.py index 8b311bd0eed..950e71753c2 100644 --- a/testing/python/raises_group.py +++ b/testing/python/raises_group.py @@ -1350,3 +1350,21 @@ def test_tuples() -> None: ), ): RaisesGroup((ValueError, IndexError)) # type: ignore[call-overload] + + +def test_expected_matching_only_on_matching() -> None: + """Regression test for #14220, logic error which caused the "which was + paired with" message to appear for wrong pairs.""" + with ( + fails_raises_group( + "\n" + "1 matched exception. \n" + "Too few exceptions raised!\n" + "The following expected exceptions did not find a match:\n" + " ValueError\n" + " TypeError\n" + " It matches `TypeError()` which was paired with `TypeError`", + ), + RaisesGroup(TypeError, ValueError, TypeError), + ): + raise ExceptionGroup("", [TypeError()]) diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 60bcbbf1d41..23a0db81c39 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -440,6 +440,28 @@ def pytest_addoption(parser): result.stdout.fnmatch_lines(["*--xyz*"]) +def test_conftests_in_invocation_dir_tests_is_initial(pytester: Pytester) -> None: + """An option registered in a conftest under ``test*`` subdir of the + invocation dir is loaded as initial when no command-line arguments + or `testpaths` are given (#14608). + """ + pytester.makepyfile( + **{ + "tests/conftest.py": """ + def pytest_addoption(parser): + parser.addoption("--db-url") + """, + "test_it.py": """ + def test_it(request): + assert request.config.getoption("--db-url") == "scheme://host/db" + """, + } + ) + result = pytester.runpytest("--db-url", "scheme://host/db") + assert result.ret == ExitCode.OK + result.assert_outcomes(passed=1) + + def test_conftest_import_order(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: ct1 = pytester.makeconftest("") sub = pytester.mkdir("sub") diff --git a/testing/test_unittest.py b/testing/test_unittest.py index 5d74d514c3c..20287d12cb3 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -867,9 +867,11 @@ def test_unittest_setup_interaction(pytester: Pytester, stmt: str) -> None: import pytest class MyTestCase(unittest.TestCase): @pytest.fixture(scope="class", autouse=True) - def perclass(self, request): + @classmethod + def perclass(cls, request): request.cls.hello = "world" {stmt} + @pytest.fixture(scope="function", autouse=True) def perfunction(self, request): request.instance.funcname = request.function.__name__ diff --git a/testing/typing_checks.py b/testing/typing_checks.py index 455313d61aa..1179f3f5d19 100644 --- a/testing/typing_checks.py +++ b/testing/typing_checks.py @@ -67,15 +67,14 @@ def test_hidden_param(x: int) -> None: pass -# Test @pytest.mark.parametrize iterator argvalues deprecation. -# Will be complain about unused type ignore if doesn't work. -@pytest.mark.parametrize("x", iter(range(10))) # type: ignore[deprecated] -def test_it(x: int) -> None: - pass - - # Issue #14137. def check_scope_typing() -> None: custom_scope: ScopeName = "function" assert_type(custom_scope, ScopeName) + + +# Issue #14606. +@pytest.mark.parametrize("x", [ImportError, AttributeError]) +def check_mypy_bug_with_argvalues(x) -> None: + pass