From f3053017b9a540fc14fddbb4e40066348ac8c25c Mon Sep 17 00:00:00 2001 From: Aaron Berdy Date: Sat, 12 Mar 2022 14:44:52 -0800 Subject: [PATCH 001/255] fix typo in pytester docs --- src/_pytest/pytester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 8368f944122..359e2aebd38 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -832,7 +832,7 @@ def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: return self._makefile(ext, args, kwargs) def makeconftest(self, source: str) -> Path: - """Write a contest.py file with 'source' as contents.""" + """Write a conftest.py file with 'source' as contents.""" return self.makepyfile(conftest=source) def makeini(self, source: str) -> Path: From 61f2b265a37f3deb04a09981e6f22818f3b6649a Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 13 Mar 2022 00:15:56 +0000 Subject: [PATCH 002/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 158 +++++++++++++++++++------------ 1 file changed, 99 insertions(+), 59 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index be6a5318d7f..4dd206c87a1 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1007 plugins. +This list contains 1012 plugins. .. only:: not latex @@ -29,12 +29,12 @@ This list contains 1007 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Feb 24, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Mar 12, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Feb 08, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Mar 12, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -66,7 +66,7 @@ This list contains 1007 plugins. :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) + :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 03, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 25, 2022 N/A N/A @@ -102,7 +102,7 @@ This list contains 1007 plugins. :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :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-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. Oct 29, 2021 N/A pytest (==6.2.5) ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. Mar 11, 2022 N/A pytest ; extra == 'dev' :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 @@ -126,7 +126,7 @@ This list contains 1007 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Feb 19, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Mar 08, 2022 N/A pytest :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-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -201,6 +201,7 @@ This list contains 1007 plugins. :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest :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-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. Oct 07, 2018 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A @@ -285,7 +286,7 @@ This list contains 1007 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` Jun 25, 2021 N/A N/A - :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Feb 14, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Mar 07, 2022 5 - Production/Stable pytest (>=4.6) :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 Jun 03, 2021 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 @@ -299,14 +300,14 @@ This list contains 1007 plugins. :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Mar 04, 2022 N/A pytest (>=6.2.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 04, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 04, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 04, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 04, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Mar 08, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 08, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 04, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 04, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 08, 2022 N/A N/A :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 Oct 10, 2021 4 - Beta pytest (==6.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -425,7 +426,7 @@ This list contains 1007 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Mar 05, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 12, 2022 3 - Alpha pytest (==7.0.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-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -481,7 +482,7 @@ This list contains 1007 plugins. :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Dec 02, 2021 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 26, 2022 3 - Alpha pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Mar 09, 2022 3 - Alpha pytest :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) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -553,7 +554,7 @@ This list contains 1007 plugins. :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 Jan 28, 2022 5 - Production/Stable pytest (>=5.0) :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 Jan 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Mar 08, 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 @@ -589,11 +590,13 @@ This list contains 1007 plugins. :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) :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) :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A :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 Mar 08, 2022 N/A pytest (==6.2.5) :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 Jul 07, 2021 N/A N/A @@ -676,7 +679,7 @@ This list contains 1007 plugins. :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 19, 2021 5 - Production/Stable pytest :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest - :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Dec 22, 2021 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :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 @@ -765,10 +768,11 @@ This list contains 1007 plugins. :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 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-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Jan 20, 2022 N/A N/A + :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-resilient-circuits` Resilient Circuits fixtures for PyTest. Mar 07, 2022 N/A N/A :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 01, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Feb 04, 2022 5 - Production/Stable N/A + :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 Apr 26, 2021 N/A pytest (>=2.5) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A @@ -790,19 +794,19 @@ This list contains 1007 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A 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 Feb 19, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 12, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 12, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 12, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -857,8 +861,8 @@ This list contains 1007 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 Feb 18, 2022 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 01, 2022 N/A N/A + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 08, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 09, 2022 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 Mar 13, 2018 3 - Alpha N/A @@ -907,12 +911,12 @@ This list contains 1007 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Feb 10, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 01, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Dec 17, 2021 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Mar 11, 2022 N/A pytest (>=5.5) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -958,10 +962,11 @@ This list contains 1007 plugins. :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 11, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-xray` Typhoon HIL plugin for pytest Feb 14, 2022 4 - Beta N/A + :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :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 @@ -1022,7 +1027,7 @@ This list contains 1007 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :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 - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Feb 02, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Mar 10, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ @@ -1108,7 +1113,7 @@ This list contains 1007 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Feb 24, 2022, + *last release*: Mar 12, 2022, *status*: N/A, *requires*: pytest (>=6.2.5,<7.0.0) @@ -1143,7 +1148,7 @@ This list contains 1007 plugins. :pypi:`pytest-alembic` - *last release*: Feb 08, 2022, + *last release*: Mar 12, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1367,7 +1372,7 @@ This list contains 1007 plugins. Meta-package containing dependencies for testing :pypi:`pytest-astropy-header` - *last release*: Dec 27, 2021, + *last release*: Mar 10, 2022, *status*: 3 - Alpha, *requires*: pytest (>=4.6) @@ -1619,9 +1624,9 @@ This list contains 1007 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: Oct 29, 2021, + *last release*: Mar 11, 2022, *status*: N/A, - *requires*: pytest (==6.2.5) ; extra == 'dev' + *requires*: pytest ; extra == 'dev' Blender Pytest plugin. @@ -1787,7 +1792,7 @@ This list contains 1007 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Feb 19, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: pytest @@ -2311,6 +2316,13 @@ This list contains 1007 plugins. Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. + :pypi:`pytest-data-extractor` + *last release*: Mar 09, 2022, + *status*: N/A, + *requires*: pytest (>=7.0.1) + + A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) + :pypi:`pytest-data-file` *last release*: Dec 04, 2019, *status*: N/A, @@ -2900,7 +2912,7 @@ This list contains 1007 plugins. :pypi:`pytest-durations` - *last release*: Feb 14, 2022, + *last release*: Mar 07, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6) @@ -2998,35 +3010,35 @@ This list contains 1007 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, - *requires*: pytest (>=6.2.0) + *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A @@ -3040,14 +3052,14 @@ This list contains 1007 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A @@ -3880,7 +3892,7 @@ This list contains 1007 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 05, 2022, + *last release*: Mar 12, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.0.1) @@ -4272,7 +4284,7 @@ This list contains 1007 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Feb 26, 2022, + *last release*: Mar 09, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4776,7 +4788,7 @@ This list contains 1007 plugins. A mock API server with configurable routes and responses available as a fixture. :pypi:`pytest-mock-generator` - *last release*: Jan 05, 2022, + *last release*: Mar 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -5027,6 +5039,13 @@ This list contains 1007 plugins. A simple plugin to disable network on socket level. + :pypi:`pytest-network-endpoints` + *last release*: Mar 06, 2022, + *status*: N/A, + *requires*: pytest + + Network endpoints plugin for pytest + :pypi:`pytest-never-sleep` *last release*: May 05, 2021, *status*: 3 - Alpha, @@ -5062,6 +5081,13 @@ This list contains 1007 plugins. pytest ngs fixtures + :pypi:`pytest-nhsd-apim` + *last release*: Mar 08, 2022, + *status*: N/A, + *requires*: pytest (==6.2.5) + + Pytest plugin accessing NHSDigital's APIM proxies + :pypi:`pytest-nice` *last release*: May 04, 2019, *status*: 4 - Beta, @@ -5637,7 +5663,7 @@ This list contains 1007 plugins. Run PostgreSQL in Docker container in Pytest. :pypi:`pytest-postgresql` - *last release*: Dec 22, 2021, + *last release*: Mar 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.0) @@ -6259,8 +6285,15 @@ This list contains 1007 plugins. pytest plugin to re-run tests to eliminate flaky failures + :pypi:`pytest-rerunfailures-all-logs` + *last release*: Mar 07, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + pytest plugin to re-run tests to eliminate flaky failures + :pypi:`pytest-resilient-circuits` - *last release*: Jan 20, 2022, + *last release*: Mar 07, 2022, *status*: N/A, *requires*: N/A @@ -6281,7 +6314,7 @@ This list contains 1007 plugins. Provides path for uniform access to test resources in isolated directory :pypi:`pytest-responsemock` - *last release*: Feb 04, 2022, + *last release*: Mar 10, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6435,7 +6468,7 @@ This list contains 1007 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Feb 19, 2022, + *last release*: Mar 12, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6477,7 +6510,7 @@ This list contains 1007 plugins. :pypi:`pytest-sbase` - *last release*: Mar 02, 2022, + *last release*: Mar 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6519,7 +6552,7 @@ This list contains 1007 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 02, 2022, + *last release*: Mar 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6904,14 +6937,14 @@ This list contains 1007 plugins. :pypi:`pytest-splunk-addon` - *last release*: Feb 18, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Mar 01, 2022, + *last release*: Mar 09, 2022, *status*: N/A, *requires*: N/A @@ -7254,7 +7287,7 @@ This list contains 1007 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Mar 01, 2022, + *last release*: Mar 11, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7289,7 +7322,7 @@ This list contains 1007 plugins. A small example package :pypi:`pytest-testrail-api` - *last release*: Dec 17, 2021, + *last release*: Mar 11, 2022, *status*: N/A, *requires*: pytest (>=5.5) @@ -7610,6 +7643,13 @@ This list contains 1007 plugins. A simple plugin to use with tspwplib + :pypi:`pytest-tst` + *last release*: Mar 11, 2022, + *status*: N/A, + *requires*: pytest (>=5.0.0) + + Customize pytest options, output and exit code to make it compatible with tst + :pypi:`pytest-tstcls` *last release*: Mar 23, 2020, *status*: 5 - Production/Stable, @@ -7632,7 +7672,7 @@ This list contains 1007 plugins. Run type checkers on specified test files :pypi:`pytest-typhoon-xray` - *last release*: Feb 14, 2022, + *last release*: Mar 07, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8059,7 +8099,7 @@ This list contains 1007 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Feb 02, 2022, + *last release*: Mar 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From d87e1e67dd2beddbed276074c4908ce06c4080d1 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 13 Mar 2022 16:58:05 +0200 Subject: [PATCH 003/255] Merge pull request #9758 from pytest-dev/release-7.1.0 Prepare release 7.1.0 (cherry picked from commit 7d4d1ecde6cdc3feae9ee076ee5aab4e05393fa6) --- changelog/5192.improvement.rst | 3 - changelog/8242.bugfix.rst | 3 - changelog/8838.breaking.rst | 15 ----- changelog/9362.improvement.rst | 1 - changelog/9437.breaking.rst | 1 - changelog/9493.bugfix.rst | 10 ---- changelog/9536.improvement.rst | 1 - changelog/9626.bugfix.rst | 3 - changelog/9644.improvement.rst | 4 -- changelog/9645.bugfix.rst | 1 - changelog/9678.improvement.rst | 3 - changelog/9692.improvement.rst | 3 - changelog/9708.bugfix.rst | 1 - changelog/9730.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.1.0.rst | 48 ++++++++++++++++ doc/en/builtin.rst | 4 +- doc/en/changelog.rst | 92 +++++++++++++++++++++++++++++++ doc/en/example/reportingdemo.rst | 6 +- doc/en/getting-started.rst | 2 +- doc/en/how-to/assert.rst | 2 +- doc/en/how-to/output.rst | 4 +- 22 files changed, 150 insertions(+), 59 deletions(-) delete mode 100644 changelog/5192.improvement.rst delete mode 100644 changelog/8242.bugfix.rst delete mode 100644 changelog/8838.breaking.rst delete mode 100644 changelog/9362.improvement.rst delete mode 100644 changelog/9437.breaking.rst delete mode 100644 changelog/9493.bugfix.rst delete mode 100644 changelog/9536.improvement.rst delete mode 100644 changelog/9626.bugfix.rst delete mode 100644 changelog/9644.improvement.rst delete mode 100644 changelog/9645.bugfix.rst delete mode 100644 changelog/9678.improvement.rst delete mode 100644 changelog/9692.improvement.rst delete mode 100644 changelog/9708.bugfix.rst delete mode 100644 changelog/9730.bugfix.rst create mode 100644 doc/en/announce/release-7.1.0.rst diff --git a/changelog/5192.improvement.rst b/changelog/5192.improvement.rst deleted file mode 100644 index c51077ae5f1..00000000000 --- a/changelog/5192.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fixed test output for some data types where ``-v`` would show less information. - -Also, when showing diffs for sequences, ``-q`` would produce full diffs instead of the expected diff. diff --git a/changelog/8242.bugfix.rst b/changelog/8242.bugfix.rst deleted file mode 100644 index eaa46142eea..00000000000 --- a/changelog/8242.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -The deprecation of raising :class:`unittest.SkipTest` to skip collection of -tests during the pytest collection phase is reverted - this is now a supported -feature again. diff --git a/changelog/8838.breaking.rst b/changelog/8838.breaking.rst deleted file mode 100644 index f5c1fead874..00000000000 --- a/changelog/8838.breaking.rst +++ /dev/null @@ -1,15 +0,0 @@ -As per our policy, the following features have been deprecated in the 6.X series and are now -removed: - -* ``pytest._fillfuncargs`` function. - -* ``pytest_warning_captured`` hook - use ``pytest_warning_recorded`` instead. - -* ``-k -foobar`` syntax - use ``-k 'not foobar'`` instead. - -* ``-k foobar:`` syntax. - -* ``pytest.collect`` module - import from ``pytest`` directly. - -For more information consult -`Deprecations and Removals `__ in the docs. diff --git a/changelog/9362.improvement.rst b/changelog/9362.improvement.rst deleted file mode 100644 index ad7f8042ca9..00000000000 --- a/changelog/9362.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -pytest now avoids specialized assert formatting when it is detected that the default ``__eq__`` is overridden in ``attrs`` or ``dataclasses``. diff --git a/changelog/9437.breaking.rst b/changelog/9437.breaking.rst deleted file mode 100644 index 60d4337f420..00000000000 --- a/changelog/9437.breaking.rst +++ /dev/null @@ -1 +0,0 @@ -Dropped support for Python 3.6, which reached `end-of-life `__ at 2021-12-23. diff --git a/changelog/9493.bugfix.rst b/changelog/9493.bugfix.rst deleted file mode 100644 index d99c80b7d2c..00000000000 --- a/changelog/9493.bugfix.rst +++ /dev/null @@ -1,10 +0,0 @@ -Symbolic link components are no longer resolved in conftest paths. -This means that if a conftest appears twice in collection tree, using symlinks, it will be executed twice. -For example, given - - tests/real/conftest.py - tests/real/test_it.py - tests/link -> tests/real - -running ``pytest tests`` now imports the conftest twice, once as ``tests/real/conftest.py`` and once as ``tests/link/conftest.py``. -This is a fix to match a similar change made to test collection itself in pytest 6.0 (see :pull:`6523` for details). diff --git a/changelog/9536.improvement.rst b/changelog/9536.improvement.rst deleted file mode 100644 index c7769602f54..00000000000 --- a/changelog/9536.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -When ``-vv`` is given on command line, show skipping and xfail reasons in full instead of truncating them to fit the terminal width. diff --git a/changelog/9626.bugfix.rst b/changelog/9626.bugfix.rst deleted file mode 100644 index 44d3734a1d2..00000000000 --- a/changelog/9626.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fixed count of selected tests on terminal collection summary when there were errors or skipped modules. - -If there were errors or skipped modules on collection, pytest would mistakenly subtract those from the selected count. diff --git a/changelog/9644.improvement.rst b/changelog/9644.improvement.rst deleted file mode 100644 index 6e29fd57a79..00000000000 --- a/changelog/9644.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -More information about the location of resources that led Python to raise :class:`ResourceWarning` can now -be obtained by enabling :mod:`tracemalloc`. - -See :ref:`resource-warnings` for more information. diff --git a/changelog/9645.bugfix.rst b/changelog/9645.bugfix.rst deleted file mode 100644 index 089a783dee6..00000000000 --- a/changelog/9645.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed regression where ``--import-mode=importlib`` used together with :envvar:`PYTHONPATH` or :confval:`pythonpath` would cause import errors in test suites. diff --git a/changelog/9678.improvement.rst b/changelog/9678.improvement.rst deleted file mode 100644 index d7bb1083a4d..00000000000 --- a/changelog/9678.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -More types are now accepted in the ``ids`` argument to ``@pytest.mark.parametrize``. -Previously only `str`, `float`, `int` and `bool` were accepted; -now `bytes`, `complex`, `re.Pattern`, `Enum` and anything with a `__name__` are also accepted. diff --git a/changelog/9692.improvement.rst b/changelog/9692.improvement.rst deleted file mode 100644 index ecc57a68c22..00000000000 --- a/changelog/9692.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -:func:`pytest.approx` now raises a :class:`TypeError` when given an unordered sequence (such as :class:`set`). - -Note that this implies that custom classes which only implement ``__iter__`` and ``__len__`` are no longer supported as they don't guarantee order. diff --git a/changelog/9708.bugfix.rst b/changelog/9708.bugfix.rst deleted file mode 100644 index 9defbbd578f..00000000000 --- a/changelog/9708.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -:fixture:`pytester` now requests a :fixture:`monkeypatch` fixture instead of creating one internally. This solves some issues with tests that involve pytest environment variables. diff --git a/changelog/9730.bugfix.rst b/changelog/9730.bugfix.rst deleted file mode 100644 index df30ab7e360..00000000000 --- a/changelog/9730.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Malformed ``pyproject.toml`` files now produce a clearer error message. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 9505b0b9e46..e55dd33e81e 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.1.0 release-7.0.1 release-7.0.0 release-7.0.0rc1 diff --git a/doc/en/announce/release-7.1.0.rst b/doc/en/announce/release-7.1.0.rst new file mode 100644 index 00000000000..3361e1c8a32 --- /dev/null +++ b/doc/en/announce/release-7.1.0.rst @@ -0,0 +1,48 @@ +pytest-7.1.0 +======================================= + +The pytest team is proud to announce the 7.1.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: + +* Akuli +* Andrew Svetlov +* Anthony Sottile +* Brett Holman +* Bruno Oliveira +* Chris NeJame +* Dan Alvizu +* Elijah DeLee +* Emmanuel Arias +* Fabian Egli +* Florian Bruhin +* Gabor Szabo +* Hasan Ramezani +* Hugo van Kemenade +* Kian Meng, Ang +* Kojo Idrissa +* Masaru Tsuchiyama +* Olga Matoula +* P. L. Lim +* Ran Benita +* Tobias Deiminger +* Yuval Shimon +* eduardo naufel schettino +* Éric + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index c7e7863b218..455ae88121f 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -65,7 +65,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. - pytestconfig [session scope] -- .../_pytest/fixtures.py:1365 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1334 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -134,7 +134,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:483 + caplog -- .../_pytest/logging.py:487 Access and control log capturing. Captured logs are available through the following properties/methods:: diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 41a79ce5b2f..64a22cbc7b5 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,98 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.1.0 (2022-03-13) +========================= + +Breaking Changes +---------------- + +- `#8838 `_: As per our policy, the following features have been deprecated in the 6.X series and are now + removed: + + * ``pytest._fillfuncargs`` function. + + * ``pytest_warning_captured`` hook - use ``pytest_warning_recorded`` instead. + + * ``-k -foobar`` syntax - use ``-k 'not foobar'`` instead. + + * ``-k foobar:`` syntax. + + * ``pytest.collect`` module - import from ``pytest`` directly. + + For more information consult + `Deprecations and Removals `__ in the docs. + + +- `#9437 `_: Dropped support for Python 3.6, which reached `end-of-life `__ at 2021-12-23. + + + +Improvements +------------ + +- `#5192 `_: Fixed test output for some data types where ``-v`` would show less information. + + Also, when showing diffs for sequences, ``-q`` would produce full diffs instead of the expected diff. + + +- `#9362 `_: pytest now avoids specialized assert formatting when it is detected that the default ``__eq__`` is overridden in ``attrs`` or ``dataclasses``. + + +- `#9536 `_: When ``-vv`` is given on command line, show skipping and xfail reasons in full instead of truncating them to fit the terminal width. + + +- `#9644 `_: More information about the location of resources that led Python to raise :class:`ResourceWarning` can now + be obtained by enabling :mod:`tracemalloc`. + + See :ref:`resource-warnings` for more information. + + +- `#9678 `_: More types are now accepted in the ``ids`` argument to ``@pytest.mark.parametrize``. + Previously only `str`, `float`, `int` and `bool` were accepted; + now `bytes`, `complex`, `re.Pattern`, `Enum` and anything with a `__name__` are also accepted. + + +- `#9692 `_: :func:`pytest.approx` now raises a :class:`TypeError` when given an unordered sequence (such as :class:`set`). + + Note that this implies that custom classes which only implement ``__iter__`` and ``__len__`` are no longer supported as they don't guarantee order. + + + +Bug Fixes +--------- + +- `#8242 `_: The deprecation of raising :class:`unittest.SkipTest` to skip collection of + tests during the pytest collection phase is reverted - this is now a supported + feature again. + + +- `#9493 `_: Symbolic link components are no longer resolved in conftest paths. + This means that if a conftest appears twice in collection tree, using symlinks, it will be executed twice. + For example, given + + tests/real/conftest.py + tests/real/test_it.py + tests/link -> tests/real + + running ``pytest tests`` now imports the conftest twice, once as ``tests/real/conftest.py`` and once as ``tests/link/conftest.py``. + This is a fix to match a similar change made to test collection itself in pytest 6.0 (see :pull:`6523` for details). + + +- `#9626 `_: Fixed count of selected tests on terminal collection summary when there were errors or skipped modules. + + If there were errors or skipped modules on collection, pytest would mistakenly subtract those from the selected count. + + +- `#9645 `_: Fixed regression where ``--import-mode=importlib`` used together with :envvar:`PYTHONPATH` or :confval:`pythonpath` would cause import errors in test suites. + + +- `#9708 `_: :fixture:`pytester` now requests a :fixture:`monkeypatch` fixture instead of creating one internally. This solves some issues with tests that involve pytest environment variables. + + +- `#9730 `_: Malformed ``pyproject.toml`` files now produce a clearer error message. + + pytest 7.0.1 (2022-02-11) ========================= diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index cab93143615..4c1ae1c05af 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -155,7 +155,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert [0, 1, 2] == [0, 1, 3] E assert [0, 1, 2] == [0, 1, 3] E At index 2 diff: 2 != 3 - E Use -v to get the full diff + E Use -v to get more diff failure_demo.py:63: AssertionError ______________ TestSpecialisedExplanations.test_eq_list_long _______________ @@ -168,7 +168,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert a == b E assert [0, 0, 0, 0, 0, 0, ...] == [0, 0, 0, 0, 0, 0, ...] E At index 100 diff: 1 != 2 - E Use -v to get the full diff + E Use -v to get more diff failure_demo.py:68: AssertionError _________________ TestSpecialisedExplanations.test_eq_dict _________________ @@ -215,7 +215,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert [1, 2] == [1, 2, 3] E assert [1, 2] == [1, 2, 3] E Right contains one more item: 3 - E Use -v to get the full diff + E Use -v to get more diff failure_demo.py:77: AssertionError _________________ TestSpecialisedExplanations.test_in_list _________________ diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 79b88ced9e1..73f6fc53b48 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 7.0.1 + pytest 7.1.0 .. _`simpletest`: diff --git a/doc/en/how-to/assert.rst b/doc/en/how-to/assert.rst index cb70db6b8ed..65f16129142 100644 --- a/doc/en/how-to/assert.rst +++ b/doc/en/how-to/assert.rst @@ -201,7 +201,7 @@ if you run this module: E '1' E Extra items in the right set: E '5' - E Use -v to get the full diff + E Use -v to get more diff test_assert2.py:4: AssertionError ========================= short test summary info ========================== diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index 4b90988f49d..dc3a86ba29d 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -84,7 +84,7 @@ Executing pytest normally gives us this output (we are skipping the header to fo > assert fruits1 == fruits2 E AssertionError: assert ['banana', 'a...elon', 'kiwi'] == ['banana', 'a...elon', 'kiwi'] E At index 2 diff: 'grapes' != 'orange' - E Use -v to get the full diff + E Use -v to get more diff test_verbosity_example.py:8: AssertionError ____________________________ test_numbers_fail _____________________________ @@ -99,7 +99,7 @@ Executing pytest normally gives us this output (we are skipping the header to fo E {'1': 1, '2': 2, '3': 3, '4': 4} E Right contains 4 more items: E {'10': 10, '20': 20, '30': 30, '40': 40} - E Use -v to get the full diff + E Use -v to get more diff test_verbosity_example.py:14: AssertionError ___________________________ test_long_text_fail ____________________________ From e75cdae2bc92c8b1c53114addf5fd23a4dad796d Mon Sep 17 00:00:00 2001 From: Rowin Date: Mon, 14 Mar 2022 13:26:17 +0100 Subject: [PATCH 004/255] Typo correction A word was missing in the docstring of the warns function. --- src/_pytest/recwarn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 175b571a80c..b460668fea0 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -110,7 +110,7 @@ def warns( r"""Assert that code raises a particular class of warning. Specifically, the parameter ``expected_warning`` can be a warning class or - sequence of warning classes, and the inside the ``with`` block must issue a warning of that class or + sequence of warning classes, and the code inside the ``with`` block must issue a warning of that class or classes. This helper produces a list of :class:`warnings.WarningMessage` objects, From 37fa0fb4d34eb99df13434c533b096740693fafb Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 14 Mar 2022 22:27:52 +0200 Subject: [PATCH 005/255] testing: fix tests when run under `-v` or `-vv` Regressed in fac8f284cd6ffd44c7d401093c67799766473be1, didn't notice since we don't run tests in CI with `-v`. --- testing/test_assertrewrite.py | 48 +++++++---------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 8f18e89c94f..a515bbae96b 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -204,16 +204,8 @@ def f3() -> None: def f4() -> None: assert sys == 42 # type: ignore[comparison-overlap] - verbose = request.config.getoption("verbose") msg = getmsg(f4, {"sys": sys}) - if verbose > 0: - assert msg == ( - "assert == 42\n" - " +\n" - " -42" - ) - else: - assert msg == "assert sys == 42" + assert msg == "assert sys == 42" def f5() -> None: assert cls == 42 # type: ignore[name-defined] # noqa: F821 @@ -224,20 +216,7 @@ class X: msg = getmsg(f5, {"cls": X}) assert msg is not None lines = msg.splitlines() - if verbose > 1: - assert lines == [ - f"assert {X!r} == 42", - f" +{X!r}", - " -42", - ] - elif verbose > 0: - assert lines == [ - "assert .X'> == 42", - f" +{X!r}", - " -42", - ] - else: - assert lines == ["assert cls == 42"] + assert lines == ["assert cls == 42"] def test_assertrepr_compare_same_width(self, request) -> None: """Should use same width/truncation with same initial width.""" @@ -279,14 +258,11 @@ def f() -> None: msg = getmsg(f, {"cls": Y}) assert msg is not None lines = msg.splitlines() - if request.config.getoption("verbose") > 0: - assert lines == ["assert 3 == 2", " +3", " -2"] - else: - assert lines == [ - "assert 3 == 2", - " + where 3 = Y.foo", - " + where Y = cls()", - ] + assert lines == [ + "assert 3 == 2", + " + where 3 = Y.foo", + " + where Y = cls()", + ] def test_assert_already_has_message(self) -> None: def f(): @@ -663,10 +639,7 @@ def f(): assert len(values) == 11 msg = getmsg(f) - if request.config.getoption("verbose") > 0: - assert msg == "assert 10 == 11\n +10\n -11" - else: - assert msg == "assert 10 == 11\n + where 10 = len([0, 1, 2, 3, 4, 5, ...])" + assert msg == "assert 10 == 11\n + where 10 = len([0, 1, 2, 3, 4, 5, ...])" def test_custom_reprcompare(self, monkeypatch) -> None: def my_reprcompare1(op, left, right) -> str: @@ -732,10 +705,7 @@ def __repr__(self): msg = getmsg(f) assert msg is not None lines = util._format_lines([msg]) - if request.config.getoption("verbose") > 0: - assert lines == ["assert 0 == 1\n +0\n -1"] - else: - assert lines == ["assert 0 == 1\n + where 1 = \\n{ \\n~ \\n}.a"] + assert lines == ["assert 0 == 1\n + where 1 = \\n{ \\n~ \\n}.a"] def test_custom_repr_non_ascii(self) -> None: def f() -> None: From abfae83130a6905638d41a0fe879d4018dd9c4ab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 20:48:34 +0000 Subject: [PATCH 006/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- extra/setup-py.test/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/setup-py.test/setup.py b/extra/setup-py.test/setup.py index d0560ce1f5f..97883852e2e 100644 --- a/extra/setup-py.test/setup.py +++ b/extra/setup-py.test/setup.py @@ -1,4 +1,5 @@ import sys + from distutils.core import setup if __name__ == "__main__": From d52a6e6074844581f5f89653bd4071fb6ea847d3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:34:40 +0200 Subject: [PATCH 007/255] [pre-commit.ci] pre-commit autoupdate (#9769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/reorder_python_imports: v2.7.1 → v3.0.1](https://github.com/asottile/reorder_python_imports/compare/v2.7.1...v3.0.1) - [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1) - [github.com/pre-commit/mirrors-mypy: v0.931 → v0.940](https://github.com/pre-commit/mirrors-mypy/compare/v0.931...v0.940) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix mypy errors Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira --- .pre-commit-config.yaml | 6 +++--- extra/setup-py.test/setup.py | 1 + src/_pytest/config/__init__.py | 4 +++- src/_pytest/mark/structures.py | 4 ++-- testing/test_assertrewrite.py | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5de99c99aaf..261c525c822 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,12 +37,12 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.7.1 + rev: v3.0.1 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v2.31.1 hooks: - id: pyupgrade args: [--py37-plus] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.931 + rev: v0.940 hooks: - id: mypy files: ^(src/|testing/) diff --git a/extra/setup-py.test/setup.py b/extra/setup-py.test/setup.py index d0560ce1f5f..97883852e2e 100644 --- a/extra/setup-py.test/setup.py +++ b/extra/setup-py.test/setup.py @@ -1,4 +1,5 @@ import sys + from distutils.core import setup if __name__ == "__main__": diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index f4818c861cf..1141897348d 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -309,7 +309,9 @@ def _prepareconfig( elif isinstance(args, os.PathLike): args = [os.fspath(args)] elif not isinstance(args, list): - msg = "`args` parameter expected to be a list of strings, got: {!r} (type: {})" + msg = ( # type:ignore[unreachable] + "`args` parameter expected to be a list of strings, got: {!r} (type: {})" + ) raise TypeError(msg.format(args, type(args))) config = get_config(args, plugins) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index ec41b3f99a6..b8cbf0d1875 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -397,7 +397,7 @@ def store_mark(obj, mark: Mark) -> None: from _pytest.scope import _ScopeName class _SkipMarkDecorator(MarkDecorator): - @overload # type: ignore[override,misc] + @overload # type: ignore[override,misc,no-overload-impl] def __call__(self, arg: Markable) -> Markable: ... @@ -415,7 +415,7 @@ def __call__( # type: ignore[override] ... class _XfailMarkDecorator(MarkDecorator): - @overload # type: ignore[override,misc] + @overload # type: ignore[override,misc,no-overload-impl] def __call__(self, arg: Markable) -> Markable: ... diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 8f18e89c94f..1f89658e18a 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1059,7 +1059,7 @@ def atomic_write_failed(fn, mode="r", overwrite=False): e = OSError() e.errno = 10 raise e - yield + yield # type:ignore[unreachable] monkeypatch.setattr( _pytest.assertion.rewrite, "atomic_write", atomic_write_failed From 1d70b022f07c51ffcde24739807f4d36a6eb621a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 16 Mar 2022 22:27:56 +0200 Subject: [PATCH 008/255] config: restore pre-pytest 7.1.0 confcutdir exclusion behavior The change from `path not in confuctdir.parents` to the `relative_to` check in 0c98f1923101e5905c54ba07650a043fca374f4b broke picking up conftest files when running against an installed package/site-packages. See the issue for more details. Fix #9767. --- changelog/9767.bugfix.rst | 1 + src/_pytest/config/__init__.py | 6 +----- testing/test_conftest.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 changelog/9767.bugfix.rst diff --git a/changelog/9767.bugfix.rst b/changelog/9767.bugfix.rst new file mode 100644 index 00000000000..7de316980b8 --- /dev/null +++ b/changelog/9767.bugfix.rst @@ -0,0 +1 @@ +Fixed a regression in pytest 7.1.0 where some conftest.py files outside of the source tree (e.g. in the `site-packages` directory) were not picked up. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 1141897348d..05abaa8eda6 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -540,11 +540,7 @@ def _is_in_confcutdir(self, path: Path) -> bool: """ if self._confcutdir is None: return True - try: - path.relative_to(self._confcutdir) - except ValueError: - return False - return True + return path not in self._confcutdir.parents def _try_load_conftest( self, anchor: Path, importmode: Union[str, ImportMode], rootpath: Path diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 4cbc2d14c36..68048204581 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -252,6 +252,34 @@ def pytest_addoption(parser): result.stdout.no_fnmatch_line("*warning: could not load initial*") +def test_installed_conftest_is_picked_up(pytester: Pytester, tmp_path: Path) -> None: + """When using `--pyargs` to run tests in an installed packages (located e.g. + in a site-packages in the PYTHONPATH), conftest files in there are picked + up. + + Regression test for #9767. + """ + # pytester dir - the source tree. + # tmp_path - the simulated site-packages dir (not in source tree). + + pytester.syspathinsert(tmp_path) + pytester.makepyprojecttoml("[tool.pytest.ini_options]") + tmp_path.joinpath("foo").mkdir() + tmp_path.joinpath("foo", "__init__.py").touch() + tmp_path.joinpath("foo", "conftest.py").write_text( + textwrap.dedent( + """\ + import pytest + @pytest.fixture + def fix(): return None + """ + ) + ) + tmp_path.joinpath("foo", "test_it.py").write_text("def test_it(fix): pass") + result = pytester.runpytest("--pyargs", "foo") + assert result.ret == 0 + + def test_conftest_symlink(pytester: Pytester) -> None: """`conftest.py` discovery follows normal path resolution and does not resolve symlinks.""" # Structure: From a18655f7292da608ba4358a887b642be117a1176 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 17 Mar 2022 23:17:11 +0200 Subject: [PATCH 009/255] Merge pull request #9785 from pytest-dev/release-7.1.1 Prepare release 7.1.1 (cherry picked from commit b9462ed7d0b665778c908ab311015a49ece4f20e) --- changelog/9767.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.1.1.rst | 18 ++++++++++++++++++ doc/en/changelog.rst | 9 +++++++++ doc/en/getting-started.rst | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) delete mode 100644 changelog/9767.bugfix.rst create mode 100644 doc/en/announce/release-7.1.1.rst diff --git a/changelog/9767.bugfix.rst b/changelog/9767.bugfix.rst deleted file mode 100644 index 7de316980b8..00000000000 --- a/changelog/9767.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a regression in pytest 7.1.0 where some conftest.py files outside of the source tree (e.g. in the `site-packages` directory) were not picked up. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index e55dd33e81e..0da8b4037ed 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.1.1 release-7.1.0 release-7.0.1 release-7.0.0 diff --git a/doc/en/announce/release-7.1.1.rst b/doc/en/announce/release-7.1.1.rst new file mode 100644 index 00000000000..d271c4557a2 --- /dev/null +++ b/doc/en/announce/release-7.1.1.rst @@ -0,0 +1,18 @@ +pytest-7.1.1 +======================================= + +pytest 7.1.1 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Ran Benita + + +Happy testing, +The pytest Development Team diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 64a22cbc7b5..6ff85883e41 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,15 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.1.1 (2022-03-17) +========================= + +Bug Fixes +--------- + +- `#9767 `_: Fixed a regression in pytest 7.1.0 where some conftest.py files outside of the source tree (e.g. in the `site-packages` directory) were not picked up. + + pytest 7.1.0 (2022-03-13) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 73f6fc53b48..b856803f1f1 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 7.1.0 + pytest 7.1.1 .. _`simpletest`: From 8f64a39d0aab74b2de2bacee03f76e4b90555fa5 Mon Sep 17 00:00:00 2001 From: Florian Best Date: Fri, 18 Mar 2022 22:00:14 +0100 Subject: [PATCH 010/255] [style]: fix typo in docstring --- src/_pytest/python_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index ea646811ddf..be15761339e 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -573,7 +573,7 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6}) True - The comparision will be true if both mappings have the same keys and their + The comparison will be true if both mappings have the same keys and their respective values match the expected tolerances. **Tolerances** From b75cbee290ffd5a5e7fb3a247220d812d7f0fe71 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 19 Mar 2022 11:55:39 +0000 Subject: [PATCH 011/255] Remove newlines from left/right operands with '-vv' (#9743) The left/right operands produced when `verbose > 1` should not contain newlines, because they are used to build the `summary` string. The `assertrepr_compare` function returns a list of lines, and the summary is one of those lines and should not contain newlines itself. Fix #9742 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira --- AUTHORS | 1 + changelog/9742.improvement.rst | 1 + src/_pytest/_io/saferepr.py | 17 +++++++++++++++++ src/_pytest/assertion/util.py | 6 +++--- testing/io/test_saferepr.py | 21 +++++++++++++++++++++ testing/test_assertion.py | 15 +++++++++++++++ 6 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 changelog/9742.improvement.rst diff --git a/AUTHORS b/AUTHORS index 2b6ca66de7a..1c82b006de1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -289,6 +289,7 @@ Ruaridh Williamson Russel Winder Ryan Wooden Saiprasad Kale +Samuel Colvin Samuel Dion-Girardeau Samuel Searles-Bryant Samuele Pedroni diff --git a/changelog/9742.improvement.rst b/changelog/9742.improvement.rst new file mode 100644 index 00000000000..a1abfc27469 --- /dev/null +++ b/changelog/9742.improvement.rst @@ -0,0 +1 @@ +Display assertion message without escaped newline characters with ``-vv``. diff --git a/src/_pytest/_io/saferepr.py b/src/_pytest/_io/saferepr.py index e7ff5cab203..a27e8c2a6a5 100644 --- a/src/_pytest/_io/saferepr.py +++ b/src/_pytest/_io/saferepr.py @@ -107,6 +107,23 @@ def saferepr(obj: object, maxsize: Optional[int] = DEFAULT_REPR_MAX_SIZE) -> str return SafeRepr(maxsize).repr(obj) +def saferepr_unlimited(obj: object) -> str: + """Return an unlimited-size safe repr-string for the given object. + + As with saferepr, failing __repr__ functions of user instances + will be represented with a short exception info. + + This function is a wrapper around simple repr. + + Note: a cleaner solution would be to alter ``saferepr``this way + when maxsize=None, but that might affect some other code. + """ + try: + return repr(obj) + except Exception as exc: + return _format_repr_exception(exc, obj) + + class AlwaysDispatchingPrettyPrinter(pprint.PrettyPrinter): """PrettyPrinter that always dispatches (regardless of width).""" diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 03167ddd471..75026730df4 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -14,8 +14,8 @@ import _pytest._code from _pytest import outcomes from _pytest._io.saferepr import _pformat_dispatch -from _pytest._io.saferepr import safeformat from _pytest._io.saferepr import saferepr +from _pytest._io.saferepr import saferepr_unlimited from _pytest.config import Config # The _reprcompare attribute on the util module is used by the new assertion @@ -160,8 +160,8 @@ def assertrepr_compare(config, op: str, left: Any, right: Any) -> Optional[List[ """Return specialised explanations for some operators/operands.""" verbose = config.getoption("verbose") if verbose > 1: - left_repr = safeformat(left) - right_repr = safeformat(right) + left_repr = saferepr_unlimited(left) + right_repr = saferepr_unlimited(right) else: # XXX: "15 chars indentation" is wrong # ("E AssertionError: assert "); should use term width. diff --git a/testing/io/test_saferepr.py b/testing/io/test_saferepr.py index 63d3af822b1..24746bc2235 100644 --- a/testing/io/test_saferepr.py +++ b/testing/io/test_saferepr.py @@ -2,6 +2,7 @@ from _pytest._io.saferepr import _pformat_dispatch from _pytest._io.saferepr import DEFAULT_REPR_MAX_SIZE from _pytest._io.saferepr import saferepr +from _pytest._io.saferepr import saferepr_unlimited def test_simple_repr(): @@ -179,3 +180,23 @@ def __repr__(self): assert saferepr(SomeClass()).startswith( "<[RuntimeError() raised in repr()] SomeClass object at 0x" ) + + +def test_saferepr_unlimited(): + dict5 = {f"v{i}": i for i in range(5)} + assert saferepr_unlimited(dict5) == "{'v0': 0, 'v1': 1, 'v2': 2, 'v3': 3, 'v4': 4}" + + dict_long = {f"v{i}": i for i in range(1_000)} + r = saferepr_unlimited(dict_long) + assert "..." not in r + assert "\n" not in r + + +def test_saferepr_unlimited_exc(): + class A: + def __repr__(self): + raise ValueError(42) + + assert saferepr_unlimited(A()).startswith( + "<[ValueError(42) raised in repr()] A object at 0x" + ) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index d37ee72a2ec..4825ede778b 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1695,3 +1695,18 @@ def test(): "*= 1 failed in*", ] ) + + +def test_reprcompare_verbose_long() -> None: + a = {f"v{i}": i for i in range(11)} + b = a.copy() + b["v2"] += 10 + lines = callop("==", a, b, verbose=2) + assert lines is not None + assert lines[0] == ( + "{'v0': 0, 'v1': 1, 'v2': 2, 'v3': 3, 'v4': 4, 'v5': 5, " + "'v6': 6, 'v7': 7, 'v8': 8, 'v9': 9, 'v10': 10}" + " == " + "{'v0': 0, 'v1': 1, 'v2': 12, 'v3': 3, 'v4': 4, 'v5': 5, " + "'v6': 6, 'v7': 7, 'v8': 8, 'v9': 9, 'v10': 10}" + ) From 4c16b5af0361e222e907aac34a492cdc544fdf93 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 19 Mar 2022 08:56:05 -0300 Subject: [PATCH 012/255] Split test/deploy workflows This will trigger a deploy directly when a tag is pushed, avoiding having to wait for another lenghty build. This is safe since we only push release tags after the release PR has passed all its tests. See comments in #9793. --- .github/workflows/deploy.yml | 56 ++++++++++++++++++++++++ .github/workflows/{main.yml => test.yml} | 45 +------------------ README.rst | 4 +- 3 files changed, 59 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/deploy.yml rename .github/workflows/{main.yml => test.yml} (82%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000000..54c74863f84 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: deploy + +on: + push: + tags: + # These tags are protected, see: + # https://github.com/pytest-dev/pytest/settings/tag_protection + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" + + +# Set permissions at the job level. +permissions: {} + +jobs: + + deploy: + if: github.repository == 'pytest-dev/pytest' + + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: write + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade build tox + + - name: Build package + run: | + python -m build + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_token }} + + - name: Publish GitHub release notes + env: + GH_RELEASE_NOTES_TOKEN: ${{ github.token }} + run: | + sudo apt-get install pandoc + tox -e publish-gh-release-notes diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 82% rename from .github/workflows/main.yml rename to .github/workflows/test.yml index a69b905683b..0c5fda16e4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: main +name: test on: push: @@ -187,46 +187,3 @@ jobs: fail_ci_if_error: true files: ./coverage.xml verbose: true - - deploy: - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest' - - runs-on: ubuntu-latest - timeout-minutes: 30 - permissions: - contents: write - - needs: [build] - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.7" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade build tox - - - name: Build package - run: | - python -m build - - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_token }} - - - name: Publish GitHub release notes - env: - GH_RELEASE_NOTES_TOKEN: ${{ github.token }} - run: | - sudo apt-get install pandoc - tox -e publish-gh-release-notes diff --git a/README.rst b/README.rst index f0fe3563219..034034a40b8 100644 --- a/README.rst +++ b/README.rst @@ -20,8 +20,8 @@ :target: https://codecov.io/gh/pytest-dev/pytest :alt: Code coverage Status -.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg - :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain +.. image:: https://github.com/pytest-dev/pytest/workflows/test/badge.svg + :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest .. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main From e503faeb6ee20a7ed92715ea9f438308aea23da2 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 20 Mar 2022 00:17:32 +0000 Subject: [PATCH 013/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 180 ++++++++++++++++++------------- 1 file changed, 106 insertions(+), 74 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 4dd206c87a1..71e4d234729 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1012 plugins. +This list contains 1016 plugins. .. only:: not latex @@ -29,7 +29,7 @@ This list contains 1012 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Mar 12, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Mar 13, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) @@ -69,7 +69,7 @@ This list contains 1012 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 03, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 25, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 16, 2022 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) @@ -85,7 +85,7 @@ This list contains 1012 plugins. :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) - :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Jul 23, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Jun 19, 2020 5 - Production/Stable pytest (>=2.7.3) :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) @@ -131,7 +131,8 @@ This list contains 1012 plugins. :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-caprng` A plugin that replays pRNG state on failure. May 02, 2018 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-cases` Separate test code from test cases in pytest. Feb 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice Mar 16, 2022 N/A pytest + :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 14, 2022 5 - Production/Stable N/A :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 @@ -167,7 +168,7 @@ This list contains 1012 plugins. :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :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. Nov 06, 2020 N/A N/A - :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Feb 23, 2022 4 - Beta N/A + :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A :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 Feb 01, 2022 3 - Alpha pytest (>=3.10) :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A @@ -180,7 +181,8 @@ This list contains 1012 plugins. :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Dec 06, 2021 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 14, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -269,6 +271,7 @@ This list contains 1012 plugins. :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 15, 2022 3 - Alpha pytest :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) @@ -300,14 +303,14 @@ This list contains 1012 plugins. :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Mar 08, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 08, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 08, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 08, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Mar 18, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 18, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 08, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 18, 2022 N/A N/A :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 Oct 10, 2021 4 - Beta pytest (==6.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -373,7 +376,7 @@ This list contains 1012 plugins. :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 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 Mar 05, 2022 4 - Beta pytest (>=3.5) + :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 18, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 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-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) @@ -395,6 +398,7 @@ This list contains 1012 plugins. :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A + :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Mar 15, 2022 N/A pytest (>=6.0.0,<7.0.0) :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-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest @@ -426,7 +430,7 @@ This list contains 1012 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Mar 12, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 16, 2022 3 - Alpha pytest (==7.0.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-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -440,7 +444,7 @@ This list contains 1012 plugins. :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A :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 Dec 05, 2019 N/A N/A - :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Feb 25, 2022 5 - Production/Stable pytest ; extra == 'test' + :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' :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 Jan 27, 2022 3 - Alpha N/A @@ -454,7 +458,7 @@ This list contains 1012 plugins. :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-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Jan 20, 2022 3 - Alpha pytest + :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A @@ -487,7 +491,7 @@ This list contains 1012 plugins. :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 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 Sep 24, 2021 4 - Beta pytest (>=3.8.0) + :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-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A @@ -596,7 +600,7 @@ This list contains 1012 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 Mar 08, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Mar 15, 2022 N/A pytest (==6.2.5) :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 Jul 07, 2021 N/A N/A @@ -608,7 +612,7 @@ This list contains 1012 plugins. :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :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 Aug 04, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Mar 16, 2022 4 - Beta pytest (>=4.6.0) :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A @@ -618,7 +622,7 @@ This list contains 1012 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Mar 02, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Mar 17, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -633,7 +637,7 @@ This list contains 1012 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-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) :pypi:`pytest-parametrization` Simpler PyTest parametrization Nov 30, 2021 5 - Production/Stable pytest - :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Dec 12, 2020 N/A pytest (>=6.1.2,<7.0.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 plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A @@ -647,7 +651,7 @@ This list contains 1012 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=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-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Mar 14, 2022 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :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. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' @@ -662,7 +666,7 @@ This list contains 1012 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 Feb 10, 2022 N/A pytest + :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Mar 16, 2022 N/A pytest :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-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest @@ -696,9 +700,9 @@ This list contains 1012 plugins. :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha 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 Aug 10, 2020 3 - Alpha N/A + :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Mar 13, 2022 3 - Alpha N/A :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 Aug 10, 2020 3 - Alpha N/A + :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) :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) @@ -712,7 +716,7 @@ This list contains 1012 plugins. :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-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. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jan 18, 2022 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) :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 Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) @@ -800,13 +804,13 @@ This list contains 1012 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 18, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A - :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 18, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -857,12 +861,12 @@ This list contains 1012 plugins. :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) - :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Jan 10, 2022 4 - Beta pytest (>=5,<7) + :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Mar 13, 2022 4 - Beta pytest (>=5,<8) :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 Mar 08, 2022 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 09, 2022 N/A N/A + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 16, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 Mar 13, 2018 3 - Alpha N/A @@ -962,7 +966,7 @@ This list contains 1012 plugins. :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 11, 2022 N/A pytest (>=5.0.0) + :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 13, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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) @@ -1113,7 +1117,7 @@ This list contains 1012 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Mar 12, 2022, + *last release*: Mar 13, 2022, *status*: N/A, *requires*: pytest (>=6.2.5,<7.0.0) @@ -1393,7 +1397,7 @@ This list contains 1012 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Jan 25, 2022, + *last release*: Mar 16, 2022, *status*: N/A, *requires*: N/A @@ -1505,9 +1509,9 @@ This list contains 1012 plugins. pytest plugin for axe-selenium-python :pypi:`pytest-azurepipelines` - *last release*: Jul 23, 2020, + *last release*: Mar 16, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=5.0.0) Formatting PyTest output for Azure Pipelines UI @@ -1826,8 +1830,15 @@ This list contains 1012 plugins. pytest plugin to capture all deprecatedwarnings and put them in one file + :pypi:`pytest-capture-warnings` + *last release*: Mar 16, 2022, + *status*: N/A, + *requires*: pytest + + pytest plugin to capture all warnings and put them in one file of your choice + :pypi:`pytest-cases` - *last release*: Feb 08, 2022, + *last release*: Mar 14, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2079,7 +2090,7 @@ This list contains 1012 plugins. Package stands for pytest plugin to upload results into Confluence page. :pypi:`pytest-console-scripts` - *last release*: Feb 23, 2022, + *last release*: Mar 18, 2022, *status*: 4 - Beta, *requires*: N/A @@ -2170,12 +2181,19 @@ This list contains 1012 plugins. Pytest plugin for excluding tests based on coverage data :pypi:`pytest-cpp` - *last release*: Dec 06, 2021, + *last release*: Mar 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=5.4.0,!=5.4.1) Use pytest's runner to discover and execute C++ tests + :pypi:`pytest-cppython` + *last release*: Mar 14, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin that imports CPPython testing types + :pypi:`pytest-cram` *last release*: Aug 08, 2020, *status*: N/A, @@ -2792,6 +2810,13 @@ This list contains 1012 plugins. Pytest fixtures for testing with docker registries. + :pypi:`pytest-docker-service` + *last release*: Mar 15, 2022, + *status*: 3 - Alpha, + *requires*: pytest + + pytest plugin to start docker container + :pypi:`pytest-docker-squid-fixtures` *last release*: Feb 09, 2022, *status*: 4 - Beta, @@ -3010,35 +3035,35 @@ This list contains 1012 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A @@ -3052,14 +3077,14 @@ This list contains 1012 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A @@ -3521,9 +3546,9 @@ This list contains 1012 plugins. A pytest plugin to assert type annotations at runtime. :pypi:`pytest-flake8` - *last release*: Mar 05, 2022, + *last release*: Mar 18, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5) + *requires*: pytest (>=7.0) pytest plugin to check FLAKE8 requirements @@ -3674,6 +3699,13 @@ This list contains 1012 plugins. + :pypi:`pytest-gather-fixtures` + *last release*: Mar 15, 2022, + *status*: N/A, + *requires*: pytest (>=6.0.0,<7.0.0) + + set up asynchronous pytest fixtures concurrently + :pypi:`pytest-gc` *last release*: Feb 01, 2018, *status*: N/A, @@ -3892,7 +3924,7 @@ This list contains 1012 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 12, 2022, + *last release*: Mar 16, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.0.1) @@ -3990,7 +4022,7 @@ This list contains 1012 plugins. Fixture "http" for http requests :pypi:`pytest-httpbin` - *last release*: Feb 25, 2022, + *last release*: Mar 16, 2022, *status*: 5 - Production/Stable, *requires*: pytest ; extra == 'test' @@ -4088,7 +4120,7 @@ This list contains 1012 plugins. ignore failures from flaky tests (pytest plugin) :pypi:`pytest-image-diff` - *last release*: Jan 20, 2022, + *last release*: Mar 17, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4319,7 +4351,7 @@ This list contains 1012 plugins. UNKNOWN :pypi:`pytest-json-report` - *last release*: Sep 24, 2021, + *last release*: Mar 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.8.0) @@ -5082,7 +5114,7 @@ This list contains 1012 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Mar 08, 2022, + *last release*: Mar 15, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -5166,9 +5198,9 @@ This list contains 1012 plugins. A PyTest Reporter to send test runs to Notion.so :pypi:`pytest-nunit` - *last release*: Aug 04, 2020, + *last release*: Mar 16, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=4.6.0) A pytest plugin for generating NUnit3 test result XML output @@ -5236,7 +5268,7 @@ This list contains 1012 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Mar 02, 2022, + *last release*: Mar 17, 2022, *status*: N/A, *requires*: pytest @@ -5341,9 +5373,9 @@ This list contains 1012 plugins. Simpler PyTest parametrization :pypi:`pytest-parametrize-cases` - *last release*: Dec 12, 2020, + *last release*: Mar 13, 2022, *status*: N/A, - *requires*: pytest (>=6.1.2,<7.0.0) + *requires*: pytest (>=6.1.2) A more user-friendly way to write parametrized tests. @@ -5439,7 +5471,7 @@ This list contains 1012 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Dec 07, 2021, + *last release*: Mar 14, 2022, *status*: N/A, *requires*: N/A @@ -5544,7 +5576,7 @@ This list contains 1012 plugins. Pytest plugin for reading playbooks. :pypi:`pytest-playwright` - *last release*: Feb 10, 2022, + *last release*: Mar 16, 2022, *status*: N/A, *requires*: pytest @@ -5782,7 +5814,7 @@ This list contains 1012 plugins. Plugin for py.test to enter PyCharm debugger on uncaught exceptions :pypi:`pytest-pycodestyle` - *last release*: Aug 10, 2020, + *last release*: Mar 13, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -5796,7 +5828,7 @@ This list contains 1012 plugins. py.test plugin to connect to a remote debug server with PyDev or PyCharm. :pypi:`pytest-pydocstyle` - *last release*: Aug 10, 2020, + *last release*: Mar 13, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -5894,7 +5926,7 @@ This list contains 1012 plugins. Pytest plugin for uploading test results to your QA Touch Testrun. :pypi:`pytest-qgis` - *last release*: Jan 18, 2022, + *last release*: Mar 17, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.3) @@ -6510,7 +6542,7 @@ This list contains 1012 plugins. :pypi:`pytest-sbase` - *last release*: Mar 12, 2022, + *last release*: Mar 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6524,7 +6556,7 @@ This list contains 1012 plugins. pytest plugin for test scenarios :pypi:`pytest-schema` - *last release*: Aug 31, 2020, + *last release*: Mar 14, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.5.0) @@ -6552,7 +6584,7 @@ This list contains 1012 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 12, 2022, + *last release*: Mar 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6909,9 +6941,9 @@ This list contains 1012 plugins. Pytest plugin for the splinter automation library :pypi:`pytest-split` - *last release*: Jan 10, 2022, + *last release*: Mar 13, 2022, *status*: 4 - Beta, - *requires*: pytest (>=5,<7) + *requires*: pytest (>=5,<8) Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. @@ -6937,14 +6969,14 @@ This list contains 1012 plugins. :pypi:`pytest-splunk-addon` - *last release*: Mar 08, 2022, + *last release*: Mar 16, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Mar 09, 2022, + *last release*: Mar 16, 2022, *status*: N/A, *requires*: N/A @@ -7644,7 +7676,7 @@ This list contains 1012 plugins. A simple plugin to use with tspwplib :pypi:`pytest-tst` - *last release*: Mar 11, 2022, + *last release*: Mar 13, 2022, *status*: N/A, *requires*: pytest (>=5.0.0) From 3297bb24a9ad50aa20345ca5b58806ac782a9c36 Mon Sep 17 00:00:00 2001 From: Kian Eliasi Date: Mon, 21 Mar 2022 03:31:59 +0330 Subject: [PATCH 014/255] Remove unnecessary numpy import (#9798) Fix #9726 --- AUTHORS | 1 + changelog/9726.bugfix.rst | 1 + src/_pytest/python_api.py | 3 +-- testing/python/approx.py | 32 +++++++++++++++++--------------- 4 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 changelog/9726.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 1c82b006de1..69e71fa10d4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -185,6 +185,7 @@ Katerina Koukiou Keri Volans Kevin Cox Kevin J. Foley +Kian Eliasi Kian-Meng Ang Kodi B. Arfer Kojo Idrissa diff --git a/changelog/9726.bugfix.rst b/changelog/9726.bugfix.rst new file mode 100644 index 00000000000..66c04c4d90c --- /dev/null +++ b/changelog/9726.bugfix.rst @@ -0,0 +1 @@ +An unnecessary ``numpy`` import inside :func:`pytest.approx` was removed. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index be15761339e..5fa21961924 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -319,7 +319,6 @@ def __repr__(self) -> str: def _repr_compare(self, other_side: Sequence[float]) -> List[str]: import math - import numpy as np if len(self.expected) != len(other_side): return [ @@ -340,7 +339,7 @@ def _repr_compare(self, other_side: Sequence[float]) -> List[str]: abs_diff = abs(approx_value.expected - other_value) max_abs_diff = max(max_abs_diff, abs_diff) if other_value == 0.0: - max_rel_diff = np.inf + max_rel_diff = math.inf else: max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value)) different_ids.append(i) diff --git a/testing/python/approx.py b/testing/python/approx.py index 2eec4e9f7d0..7b4fbad156e 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -92,9 +92,7 @@ def do_assert(lhs, rhs, expected_message, verbosity_level=0): class TestApprox: - def test_error_messages(self, assert_approx_raises_regex): - np = pytest.importorskip("numpy") - + def test_error_messages_native_dtypes(self, assert_approx_raises_regex): assert_approx_raises_regex( 2.0, 1.0, @@ -135,6 +133,22 @@ def test_error_messages(self, assert_approx_raises_regex): ], ) + # Specific test for comparison with 0.0 (relative diff will be 'inf') + assert_approx_raises_regex( + [0.0], + [1.0], + [ + r" comparison failed. Mismatched elements: 1 / 1:", + rf" Max absolute difference: {SOME_FLOAT}", + r" Max relative difference: inf", + r" Index \| Obtained\s+\| Expected ", + rf"\s*0\s*\| {SOME_FLOAT} \| {SOME_FLOAT} ± {SOME_FLOAT}", + ], + ) + + def test_error_messages_numpy_dtypes(self, assert_approx_raises_regex): + np = pytest.importorskip("numpy") + a = np.linspace(0, 100, 20) b = np.linspace(0, 100, 20) a[10] += 0.5 @@ -175,18 +189,6 @@ def test_error_messages(self, assert_approx_raises_regex): ) # Specific test for comparison with 0.0 (relative diff will be 'inf') - assert_approx_raises_regex( - [0.0], - [1.0], - [ - r" comparison failed. Mismatched elements: 1 / 1:", - rf" Max absolute difference: {SOME_FLOAT}", - r" Max relative difference: inf", - r" Index \| Obtained\s+\| Expected ", - rf"\s*0\s*\| {SOME_FLOAT} \| {SOME_FLOAT} ± {SOME_FLOAT}", - ], - ) - assert_approx_raises_regex( np.array([0.0]), np.array([1.0]), From e9dd3dffab6576d61f2b4a10c58722eed1793cbd Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 21 Mar 2022 03:32:39 +0100 Subject: [PATCH 015/255] Enhance errors for exception/warnings matching (#8508) Co-authored-by: Florian Bruhin --- changelog/8508.improvement.rst | 2 ++ src/_pytest/_code/code.py | 9 +++++---- src/_pytest/recwarn.py | 36 +++++++++++++++++----------------- testing/code/test_excinfo.py | 14 +++++++------ testing/python/raises.py | 17 +++++++++------- testing/test_recwarn.py | 25 ++++++++++------------- 6 files changed, 53 insertions(+), 50 deletions(-) create mode 100644 changelog/8508.improvement.rst diff --git a/changelog/8508.improvement.rst b/changelog/8508.improvement.rst new file mode 100644 index 00000000000..36fb945829c --- /dev/null +++ b/changelog/8508.improvement.rst @@ -0,0 +1,2 @@ +Introduce multiline display for warning matching via :py:func:`pytest.warns` and +enhance match comparison for :py:func:`_pytest._code.ExceptionInfo.match` as returned by :py:func:`pytest.raises`. diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 5b758a88480..304a5cbd751 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -672,10 +672,11 @@ def match(self, regexp: Union[str, Pattern[str]]) -> "Literal[True]": If it matches `True` is returned, otherwise an `AssertionError` is raised. """ __tracebackhide__ = True - msg = "Regex pattern {!r} does not match {!r}." - if regexp == str(self.value): - msg += " Did you mean to `re.escape()` the regex?" - assert re.search(regexp, str(self.value)), msg.format(regexp, str(self.value)) + value = str(self.value) + msg = f"Regex pattern did not match.\n Regex: {regexp!r}\n Input: {value!r}" + if regexp == value: + msg += "\n Did you mean to `re.escape()` the regex?" + assert re.search(regexp, value), msg # Return True to allow for "assert excinfo.match()". return True diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index b460668fea0..49e1de2827f 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -1,6 +1,7 @@ """Record warnings during test function execution.""" import re import warnings +from pprint import pformat from types import TracebackType from typing import Any from typing import Callable @@ -142,10 +143,11 @@ def warns( __tracebackhide__ = True if not args: if kwargs: - msg = "Unexpected keyword arguments passed to pytest.warns: " - msg += ", ".join(sorted(kwargs)) - msg += "\nUse context-manager form instead?" - raise TypeError(msg) + argnames = ", ".join(sorted(kwargs)) + raise TypeError( + f"Unexpected keyword arguments passed to pytest.warns: {argnames}" + "\nUse context-manager form instead?" + ) return WarningsChecker(expected_warning, match_expr=match, _ispytest=True) else: func = args[0] @@ -191,7 +193,7 @@ def pop(self, cls: Type[Warning] = Warning) -> "warnings.WarningMessage": if issubclass(w.category, cls): return self._list.pop(i) __tracebackhide__ = True - raise AssertionError("%r not found in warning list" % cls) + raise AssertionError(f"{cls!r} not found in warning list") def clear(self) -> None: """Clear the list of recorded warnings.""" @@ -202,7 +204,7 @@ def clear(self) -> None: def __enter__(self) -> "WarningsRecorder": # type: ignore if self._entered: __tracebackhide__ = True - raise RuntimeError("Cannot enter %r twice" % self) + raise RuntimeError(f"Cannot enter {self!r} twice") _list = super().__enter__() # record=True means it's None. assert _list is not None @@ -218,7 +220,7 @@ def __exit__( ) -> None: if not self._entered: __tracebackhide__ = True - raise RuntimeError("Cannot exit %r without entering first" % self) + raise RuntimeError(f"Cannot exit {self!r} without entering first") super().__exit__(exc_type, exc_val, exc_tb) @@ -268,16 +270,17 @@ def __exit__( __tracebackhide__ = True + def found_str(): + return pformat([record.message for record in self], indent=2) + # only check if we're not currently handling an exception if exc_type is None and exc_val is None and exc_tb is None: if self.expected_warning is not None: if not any(issubclass(r.category, self.expected_warning) for r in self): __tracebackhide__ = True fail( - "DID NOT WARN. No warnings of type {} were emitted. " - "The list of emitted warnings is: {}.".format( - self.expected_warning, [each.message for each in self] - ) + f"DID NOT WARN. No warnings of type {self.expected_warning} were emitted.\n" + f"The list of emitted warnings is: {found_str()}." ) elif self.match_expr is not None: for r in self: @@ -286,11 +289,8 @@ def __exit__( break else: fail( - "DID NOT WARN. No warnings of type {} matching" - " ('{}') were emitted. The list of emitted warnings" - " is: {}.".format( - self.expected_warning, - self.match_expr, - [each.message for each in self], - ) + f"""\ +DID NOT WARN. No warnings of type {self.expected_warning} matching the regex were emitted. + Regex: {self.match_expr} + Emitted warnings: {found_str()}""" ) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 61aa4406ad2..af72857f3e7 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -420,18 +420,20 @@ def test_division_zero(): excinfo.match(r'[123]+') """ ) - result = pytester.runpytest() + result = pytester.runpytest("--tb=short") assert result.ret != 0 - exc_msg = "Regex pattern '[[]123[]]+' does not match 'division by zero'." - result.stdout.fnmatch_lines([f"E * AssertionError: {exc_msg}"]) + match = [ + r"E .* AssertionError: Regex pattern did not match.", + r"E .* Regex: '\[123\]\+'", + r"E .* Input: 'division by zero'", + ] + result.stdout.re_match_lines(match) result.stdout.no_fnmatch_line("*__tracebackhide__ = True*") result = pytester.runpytest("--fulltrace") assert result.ret != 0 - result.stdout.fnmatch_lines( - ["*__tracebackhide__ = True*", f"E * AssertionError: {exc_msg}"] - ) + result.stdout.re_match_lines([r".*__tracebackhide__ = True.*", *match]) class TestFormattedExcinfo: diff --git a/testing/python/raises.py b/testing/python/raises.py index 2d62e91091b..112dec06cdc 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -191,10 +191,12 @@ def test_raises_match(self) -> None: int("asdf") msg = "with base 16" - expr = "Regex pattern {!r} does not match \"invalid literal for int() with base 10: 'asdf'\".".format( - msg + expr = ( + "Regex pattern did not match.\n" + f" Regex: {msg!r}\n" + " Input: \"invalid literal for int() with base 10: 'asdf'\"" ) - with pytest.raises(AssertionError, match=re.escape(expr)): + with pytest.raises(AssertionError, match="(?m)" + re.escape(expr)): with pytest.raises(ValueError, match=msg): int("asdf", base=10) @@ -217,7 +219,7 @@ def test_match_failure_string_quoting(self): with pytest.raises(AssertionError, match="'foo"): raise AssertionError("'bar") (msg,) = excinfo.value.args - assert msg == 'Regex pattern "\'foo" does not match "\'bar".' + assert msg == '''Regex pattern did not match.\n Regex: "'foo"\n Input: "'bar"''' def test_match_failure_exact_string_message(self): message = "Oh here is a message with (42) numbers in parameters" @@ -226,9 +228,10 @@ def test_match_failure_exact_string_message(self): raise AssertionError(message) (msg,) = excinfo.value.args assert msg == ( - "Regex pattern 'Oh here is a message with (42) numbers in " - "parameters' does not match 'Oh here is a message with (42) " - "numbers in parameters'. Did you mean to `re.escape()` the regex?" + "Regex pattern did not match.\n" + " Regex: 'Oh here is a message with (42) numbers in parameters'\n" + " Input: 'Oh here is a message with (42) numbers in parameters'\n" + " Did you mean to `re.escape()` the regex?" ) def test_raises_match_wrong_type(self): diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py index c5a8ae90fc1..7e0f836a634 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -1,4 +1,3 @@ -import re import warnings from typing import Optional @@ -263,7 +262,7 @@ def test_as_contextmanager(self) -> None: with pytest.warns(RuntimeWarning): warnings.warn("user", UserWarning) excinfo.match( - r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) were emitted. " + r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) were emitted.\n" r"The list of emitted warnings is: \[UserWarning\('user',?\)\]." ) @@ -271,15 +270,15 @@ def test_as_contextmanager(self) -> None: with pytest.warns(UserWarning): warnings.warn("runtime", RuntimeWarning) excinfo.match( - r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. " - r"The list of emitted warnings is: \[RuntimeWarning\('runtime',?\)\]." + r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted.\n" + r"The list of emitted warnings is: \[RuntimeWarning\('runtime',?\)]." ) with pytest.raises(pytest.fail.Exception) as excinfo: with pytest.warns(UserWarning): pass excinfo.match( - r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. " + r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted.\n" r"The list of emitted warnings is: \[\]." ) @@ -289,18 +288,14 @@ def test_as_contextmanager(self) -> None: warnings.warn("runtime", RuntimeWarning) warnings.warn("import", ImportWarning) - message_template = ( - "DID NOT WARN. No warnings of type {0} were emitted. " - "The list of emitted warnings is: {1}." - ) - excinfo.match( - re.escape( - message_template.format( - warning_classes, [each.message for each in warninfo] - ) - ) + messages = [each.message for each in warninfo] + expected_str = ( + f"DID NOT WARN. No warnings of type {warning_classes} were emitted.\n" + f"The list of emitted warnings is: {messages}." ) + assert str(excinfo.value) == expected_str + def test_record(self) -> None: with pytest.warns(UserWarning) as record: warnings.warn("user", UserWarning) From 0ebfa1d76dc09e075b854176873127553e6dfa1b Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sun, 20 Mar 2022 21:01:26 -0700 Subject: [PATCH 016/255] Fix CI for Python 3.11 Getting the current working directory has no side-effects, so these context managers were no-ops. Discovered because Path.__enter__ is deprecated in Python 3.11, for removal in 3.13. --- testing/test_collection.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/testing/test_collection.py b/testing/test_collection.py index a943a44d227..aa3bf7ba58e 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -660,8 +660,7 @@ def test_pkgfile(self, pytester: Pytester) -> None: subdir = tmp_path.joinpath("subdir") x = ensure_file(subdir / "x.py") ensure_file(subdir / "__init__.py") - with subdir.cwd(): - config = pytester.parseconfigure(x) + config = pytester.parseconfigure(x) col = pytester.getnode(config, x) assert col is not None assert col.name == "x.py" @@ -1188,8 +1187,7 @@ def test_1(): """ % (str(subdir),) ) - with pytester.path.cwd(): - result = pytester.runpytest() + result = pytester.runpytest() result.stdout.fnmatch_lines(["*1 passed in*"]) assert result.ret == 0 @@ -1200,8 +1198,7 @@ def test_1(): testpaths = . """ ) - with pytester.path.cwd(): - result = pytester.runpytest("--collect-only") + result = pytester.runpytest("--collect-only") result.stdout.fnmatch_lines(["collected 1 item"]) @@ -1224,8 +1221,7 @@ def test_collect_pyargs_with_testpaths( ) ) monkeypatch.setenv("PYTHONPATH", str(pytester.path), prepend=os.pathsep) - with root.cwd(): - result = pytester.runpytest_subprocess() + result = pytester.runpytest_subprocess() result.stdout.fnmatch_lines(["*1 passed in*"]) From 3c359455e23bda499d9bc2dcde1f16f26dcc4684 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 21 Mar 2022 12:38:20 -0300 Subject: [PATCH 017/255] Change directories during some tests in test_collection.py As discussed in https://github.com/pytest-dev/pytest/pull/9800, this uses monkeypatch to change directories for two tests in `test_collection.py`, to preserve their original purpose (even if just removing it doesn't seem to affect the outcome). --- testing/test_collection.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testing/test_collection.py b/testing/test_collection.py index aa3bf7ba58e..9099ec57fca 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -651,7 +651,7 @@ def test_global_file(self, pytester: Pytester) -> None: for parent in col.listchain(): assert parent.config is config - def test_pkgfile(self, pytester: Pytester) -> None: + def test_pkgfile(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> None: """Verify nesting when a module is within a package. The parent chain should match: Module -> Package -> Session. Session's parent should always be None. @@ -660,7 +660,9 @@ def test_pkgfile(self, pytester: Pytester) -> None: subdir = tmp_path.joinpath("subdir") x = ensure_file(subdir / "x.py") ensure_file(subdir / "__init__.py") - config = pytester.parseconfigure(x) + with monkeypatch.context() as mp: + mp.chdir(subdir) + config = pytester.parseconfigure(x) col = pytester.getnode(config, x) assert col is not None assert col.name == "x.py" @@ -1221,7 +1223,9 @@ def test_collect_pyargs_with_testpaths( ) ) monkeypatch.setenv("PYTHONPATH", str(pytester.path), prepend=os.pathsep) - result = pytester.runpytest_subprocess() + with monkeypatch.context() as mp: + mp.chdir(root) + result = pytester.runpytest_subprocess() result.stdout.fnmatch_lines(["*1 passed in*"]) From 67ab7124803a48388b0c78ff310743a80dee8cd2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:41:24 +0000 Subject: [PATCH 018/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.940 → v0.941](https://github.com/pre-commit/mirrors-mypy/compare/v0.940...v0.941) --- .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 261c525c822..045c82bba90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.940 + rev: v0.941 hooks: - id: mypy files: ^(src/|testing/) From cccb9d8530c8e06da7a6d35c24aed02f66dbf8a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 08:00:11 +0000 Subject: [PATCH 019/255] build(deps): Bump twisted in /testing/plugins_integration Bumps [twisted](https://github.com/twisted/twisted) from 22.1.0 to 22.2.0. - [Release notes](https://github.com/twisted/twisted/releases) - [Changelog](https://github.com/twisted/twisted/blob/twisted-22.2.0/NEWS.rst) - [Commits](https://github.com/twisted/twisted/compare/twisted-22.1.0...twisted-22.2.0) --- updated-dependencies: - dependency-name: twisted 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 d7e56e3c5b7..357fa539f32 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -11,5 +11,5 @@ pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 pytest-twisted==1.13.4 -twisted==22.1.0 +twisted==22.2.0 pytest-xvfb==2.0.0 From 592fee22630e2b5606cf2642a3a5a0722715fe3a Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 27 Mar 2022 00:19:03 +0000 Subject: [PATCH 020/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 102 ++++++++++++++++++------------- 1 file changed, 59 insertions(+), 43 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 71e4d234729..dc79e62c806 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1016 plugins. +This list contains 1018 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1016 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Feb 22, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Mar 25, 2022 N/A pytest (>=5.4.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) @@ -61,6 +61,7 @@ This list contains 1016 plugins. :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 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) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A + :pypi:`pytest-assertions` Pytest Assertions Mar 21, 2022 N/A N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Sep 21, 2021 3 - Alpha N/A :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) @@ -68,7 +69,7 @@ This list contains 1016 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Mar 03, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 16, 2022 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) @@ -132,7 +133,7 @@ This list contains 1016 plugins. :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 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-warnings` pytest plugin to capture all warnings and put them in one file of your choice Mar 16, 2022 N/A pytest - :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 21, 2022 5 - Production/Stable N/A :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 @@ -195,7 +196,7 @@ This list contains 1016 plugins. :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A - :pypi:`pytest-cython` A plugin for testing Cython extension modules Jan 26, 2021 4 - Beta pytest (>=2.7.3) + :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A @@ -271,7 +272,7 @@ This list contains 1016 plugins. :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 15, 2022 3 - Alpha pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) @@ -346,7 +347,7 @@ This list contains 1016 plugins. :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. Dec 30, 2020 6 - Mature pytest (>=4.6) :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 Dec 11, 2020 4 - Beta pytest (>=5.0) + :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) :pypi:`pytest-fail-slow` Fail tests that take too long to run Dec 10, 2021 4 - Beta pytest (>=6.0) @@ -405,7 +406,7 @@ This list contains 1016 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. Mar 01, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 25, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -430,7 +431,7 @@ This list contains 1016 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Mar 16, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 24, 2022 3 - Alpha pytest (==7.0.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-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -438,7 +439,7 @@ This list contains 1016 plugins. :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 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 Mar 02, 2022 N/A N/A + :pypi:`pytest-html-merger` Pytest HTML reports merging utility Mar 22, 2022 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 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 @@ -475,7 +476,7 @@ This list contains 1016 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :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-invenio` Pytest fixtures for Invenio. Feb 17, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Mar 23, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -549,7 +550,7 @@ This list contains 1016 plugins. :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Jan 05, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-metadata` pytest plugin for test session metadata Nov 27, 2020 5 - Production/Stable pytest (>=2.9.0) + :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Sep 26, 2020 N/A pytest (>=6.0.1,<7.0.0) @@ -584,6 +585,7 @@ This list contains 1016 plugins. :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 Jun 10, 2021 N/A N/A :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) + :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Mar 22, 2022 N/A N/A :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" @@ -622,14 +624,14 @@ This list contains 1016 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Mar 17, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Mar 25, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :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 Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Jan 31, 2022 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) @@ -727,7 +729,7 @@ This list contains 1016 plugins. :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Feb 25, 2022 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Mar 24, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :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 @@ -798,19 +800,19 @@ This list contains 1016 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A 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 Mar 12, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 22, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 26, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 26, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -865,7 +867,7 @@ This list contains 1016 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 Mar 16, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 23, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -1031,7 +1033,7 @@ This list contains 1016 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :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 - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Mar 10, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Mar 21, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ @@ -1047,7 +1049,7 @@ This list contains 1016 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Feb 22, 2022, + *last release*: Mar 25, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1340,6 +1342,13 @@ This list contains 1016 plugins. test Answer Set Programming programs + :pypi:`pytest-assertions` + *last release*: Mar 21, 2022, + *status*: N/A, + *requires*: N/A + + Pytest Assertions + :pypi:`pytest-assertutil` *last release*: May 10, 2019, *status*: N/A, @@ -1390,7 +1399,7 @@ This list contains 1016 plugins. :pypi:`pytest-asyncio` - *last release*: Mar 03, 2022, + *last release*: Mar 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) @@ -1838,7 +1847,7 @@ This list contains 1016 plugins. pytest plugin to capture all warnings and put them in one file of your choice :pypi:`pytest-cases` - *last release*: Mar 14, 2022, + *last release*: Mar 21, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2279,9 +2288,9 @@ This list contains 1016 plugins. Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report :pypi:`pytest-cython` - *last release*: Jan 26, 2021, - *status*: 4 - Beta, - *requires*: pytest (>=2.7.3) + *last release*: Mar 26, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=4.6.0) A plugin for testing Cython extension modules @@ -2811,7 +2820,7 @@ This list contains 1016 plugins. Pytest fixtures for testing with docker registries. :pypi:`pytest-docker-service` - *last release*: Mar 15, 2022, + *last release*: Mar 21, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -3336,8 +3345,8 @@ This list contains 1016 plugins. Generates pytest fixtures that allow the use of type hinting :pypi:`pytest-factoryboy-state` - *last release*: Dec 11, 2020, - *status*: 4 - Beta, + *last release*: Mar 22, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) Simple factoryboy random state management @@ -3749,7 +3758,7 @@ This list contains 1016 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Mar 01, 2022, + *last release*: Mar 25, 2022, *status*: N/A, *requires*: N/A @@ -3924,7 +3933,7 @@ This list contains 1016 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 16, 2022, + *last release*: Mar 24, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.0.1) @@ -3980,7 +3989,7 @@ This list contains 1016 plugins. optimized pytest plugin for generating HTML reports :pypi:`pytest-html-merger` - *last release*: Mar 02, 2022, + *last release*: Mar 22, 2022, *status*: N/A, *requires*: N/A @@ -4239,7 +4248,7 @@ This list contains 1016 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Feb 17, 2022, + *last release*: Mar 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4757,9 +4766,9 @@ This list contains 1016 plugins. Pytest to Slack reporting plugin :pypi:`pytest-metadata` - *last release*: Nov 27, 2020, + *last release*: Mar 26, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=2.9.0) + *requires*: pytest (>=3.0.0,<8.0.0) pytest plugin for test session metadata @@ -5001,6 +5010,13 @@ This list contains 1016 plugins. a pytest plugin for th and concurrent testing + :pypi:`pytest-multithreading-allure` + *last release*: Mar 22, 2022, + *status*: N/A, + *requires*: N/A + + pytest_multithreading_allure + :pypi:`pytest-mutagen` *last release*: Jul 24, 2020, *status*: N/A, @@ -5268,7 +5284,7 @@ This list contains 1016 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Mar 17, 2022, + *last release*: Mar 25, 2022, *status*: N/A, *requires*: pytest @@ -5317,7 +5333,7 @@ This list contains 1016 plugins. OS X notifications for py.test results. :pypi:`pytest-otel` - *last release*: Jan 31, 2022, + *last release*: Mar 24, 2022, *status*: N/A, *requires*: N/A @@ -6003,7 +6019,7 @@ This list contains 1016 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Feb 25, 2022, + *last release*: Mar 24, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6500,7 +6516,7 @@ This list contains 1016 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Mar 12, 2022, + *last release*: Mar 22, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6542,7 +6558,7 @@ This list contains 1016 plugins. :pypi:`pytest-sbase` - *last release*: Mar 18, 2022, + *last release*: Mar 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6584,7 +6600,7 @@ This list contains 1016 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 18, 2022, + *last release*: Mar 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6969,7 +6985,7 @@ This list contains 1016 plugins. :pypi:`pytest-splunk-addon` - *last release*: Mar 16, 2022, + *last release*: Mar 23, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -8131,7 +8147,7 @@ This list contains 1016 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Mar 10, 2022, + *last release*: Mar 21, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 1f10c59cd3a716bda3c7d4a91cdaa6fb9e910ef8 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 27 Mar 2022 16:30:57 +0200 Subject: [PATCH 021/255] Clarify error message in case no collectors are found for a file --- src/_pytest/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 8f590754ae0..fc42beb5ab4 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -645,9 +645,12 @@ def perform_collect( self.trace.root.indent -= 1 if self._notfound: errors = [] - for arg, cols in self._notfound: - line = f"(no name {arg!r} in any of {cols!r})" - errors.append(f"not found: {arg}\n{line}") + for arg, collectors in self._notfound: + if cols: + errors.append(f"not found: {arg}\n(no name {arg!r} in any of {collectors!r})") + else: + errors.append(f"found no collectors for {arg}") + raise UsageError(*errors) if not genitems: items = rep.result From 0eae340e139058b1337908f6df86aaf71e7213ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 27 Mar 2022 14:41:11 +0000 Subject: [PATCH 022/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index fc42beb5ab4..67bd0489804 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -647,10 +647,12 @@ def perform_collect( errors = [] for arg, collectors in self._notfound: if cols: - errors.append(f"not found: {arg}\n(no name {arg!r} in any of {collectors!r})") + errors.append( + f"not found: {arg}\n(no name {arg!r} in any of {collectors!r})" + ) else: errors.append(f"found no collectors for {arg}") - + raise UsageError(*errors) if not genitems: items = rep.result From 63c73380281e7201dde2be62dad6c6d58841c139 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 27 Mar 2022 16:56:23 +0200 Subject: [PATCH 023/255] Fix rename issue --- src/_pytest/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 67bd0489804..f2f0c667141 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -646,7 +646,7 @@ def perform_collect( if self._notfound: errors = [] for arg, collectors in self._notfound: - if cols: + if collectors: errors.append( f"not found: {arg}\n(no name {arg!r} in any of {collectors!r})" ) From 31595e8733bf28ae41f7a222fbf24596bf361338 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 29 Mar 2022 12:33:13 +0200 Subject: [PATCH 024/255] Fix tests --- testing/acceptance_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 71d3cc23a2e..92661b0f23a 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -186,8 +186,7 @@ def test_not_collectable_arguments(self, pytester: Pytester) -> None: assert result.ret == ExitCode.USAGE_ERROR result.stderr.fnmatch_lines( [ - f"ERROR: not found: {p2}", - f"(no name {str(p2)!r} in any of [[][]])", + f"ERROR: found no collectors for {p2}", "", ] ) From 141b301d3d085b8833827133cbe02f8dd13de36b Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 29 Mar 2022 12:34:15 +0200 Subject: [PATCH 025/255] Fix more tests --- testing/test_config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/test_config.py b/testing/test_config.py index 6784809e097..b2c74085eae 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1855,8 +1855,7 @@ def test_config_blocked_default_plugins(pytester: Pytester, plugin: str) -> None assert result.ret == ExitCode.USAGE_ERROR result.stderr.fnmatch_lines( [ - "ERROR: not found: */test_config_blocked_default_plugins.py", - "(no name '*/test_config_blocked_default_plugins.py' in any of [])", + "ERROR: found no collectors for */test_config_blocked_default_plugins.py", ] ) return From 3fcdbaf0c5ece9a3f193de793c3f1abee6b57358 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 29 Mar 2022 12:37:23 +0200 Subject: [PATCH 026/255] Add changelog --- changelog/9823.improvement.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9823.improvement.rst diff --git a/changelog/9823.improvement.rst b/changelog/9823.improvement.rst new file mode 100644 index 00000000000..0a14cab6743 --- /dev/null +++ b/changelog/9823.improvement.rst @@ -0,0 +1 @@ +Improved error message that is shown when no collector is found for a given file. From 387ec02021e91ae11a89ec5fc578dc5251ea2468 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 29 Mar 2022 12:38:34 +0200 Subject: [PATCH 027/255] Add to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 69e71fa10d4..0dbc728eba1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -325,6 +325,7 @@ Thomas Grainger Thomas Hisch Tim Hoffmann Tim Strazny +Tobias Diez Tom Dalton Tom Viner Tomáš Gavenčiak From 79725c9102f47102f1cf2aa086d935c1e2665089 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 3 Apr 2022 00:17:36 +0000 Subject: [PATCH 028/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 128 +++++++++++++++++++------------ 1 file changed, 80 insertions(+), 48 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index dc79e62c806..cf2b056d63b 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1018 plugins. +This list contains 1022 plugins. .. only:: not latex @@ -70,7 +70,7 @@ This list contains 1018 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 16, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 30, 2022 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) @@ -88,7 +88,7 @@ This list contains 1018 plugins. :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-base-url` pytest plugin for URL based testing Jun 19, 2020 5 - Production/Stable pytest (>=2.7.3) + :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.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) @@ -127,7 +127,7 @@ This list contains 1018 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Mar 08, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 02, 2022 N/A pytest :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-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -160,6 +160,7 @@ This list contains 1018 plugins. :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 Oct 27, 2021 4 - Beta pytest (>=4.6.0) :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-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 @@ -236,7 +237,7 @@ This list contains 1018 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-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. Feb 12, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.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 04, 2021 4 - Beta N/A @@ -259,7 +260,7 @@ This list contains 1018 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 Jun 14, 2021 N/A pytest (<7.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Mar 28, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 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) @@ -406,7 +407,7 @@ This list contains 1018 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. Mar 25, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 01, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -416,6 +417,7 @@ This list contains 1018 plugins. :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest :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 Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest :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-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A @@ -431,10 +433,10 @@ This list contains 1018 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Mar 24, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 02, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) + :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) @@ -466,7 +468,7 @@ This list contains 1018 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :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 Sep 30, 2021 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Jan 26, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Mar 30, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 11, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -476,7 +478,7 @@ This list contains 1018 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :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-invenio` Pytest fixtures for Invenio. Mar 23, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Mar 29, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -531,6 +533,7 @@ This list contains 1018 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-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Feb 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 02, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha 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-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A @@ -563,13 +566,13 @@ This list contains 1018 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. Feb 26, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Mar 30, 2022 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-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-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest - :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Oct 06, 2021 5 - Production/Stable 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-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 5 - Production/Stable pytest @@ -739,7 +742,7 @@ This list contains 1018 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 Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Feb 26, 2022 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Mar 31, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 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-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -800,19 +803,19 @@ This list contains 1018 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A 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 Mar 22, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 28, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 26, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 31, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 26, 2022 5 - Production/Stable N/A + :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 31, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -825,7 +828,7 @@ This list contains 1018 plugins. :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 :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-shell` A pytest plugin to help with testing shell scripts / black box commands Nov 07, 2021 N/A N/A + :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) @@ -859,7 +862,7 @@ This list contains 1018 plugins. :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 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. May 04, 2021 N/A N/A - :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Aug 05, 2020 4 - Beta N/A + :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) @@ -984,7 +987,7 @@ This list contains 1018 plugins. :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest :pypi:`pytest-valgrind` May 19, 2021 N/A N/A - :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Oct 23, 2019 5 - Production/Stable pytest (>=2.4.2) + :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Aug 13, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) @@ -1009,6 +1012,7 @@ This list contains 1018 plugins. :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 :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A + :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Dec 10, 2021 5 - Production/Stable pytest (>=6.2.0) @@ -1406,7 +1410,7 @@ This list contains 1018 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Mar 16, 2022, + *last release*: Mar 30, 2022, *status*: N/A, *requires*: N/A @@ -1532,9 +1536,9 @@ This list contains 1018 plugins. A bandit plugin for pytest :pypi:`pytest-base-url` - *last release*: Jun 19, 2020, + *last release*: Mar 27, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=2.7.3) + *requires*: pytest (>=3.0.0,<8.0.0) pytest plugin for URL based testing @@ -1805,7 +1809,7 @@ This list contains 1018 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Mar 08, 2022, + *last release*: Apr 02, 2022, *status*: N/A, *requires*: pytest @@ -2035,6 +2039,13 @@ This list contains 1018 plugins. Automatically create pytest test signatures + :pypi:`pytest-codeowners` + *last release*: Mar 30, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.0.0) + + Pytest plugin for selecting tests by GitHub CODEOWNERS. + :pypi:`pytest-codestyle` *last release*: Mar 23, 2020, *status*: 3 - Alpha, @@ -2568,7 +2579,7 @@ This list contains 1018 plugins. Disable plugins per test :pypi:`pytest-discord` - *last release*: Feb 12, 2022, + *last release*: Mar 27, 2022, *status*: 4 - Beta, *requires*: pytest (!=6.0.0,<8,>=3.3.2) @@ -2729,9 +2740,9 @@ This list contains 1018 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Jun 14, 2021, + *last release*: Mar 28, 2022, *status*: N/A, - *requires*: pytest (<7.0,>=4.0) + *requires*: pytest (<8.0,>=4.0) Simple pytest fixtures for Docker and docker-compose based tests @@ -3758,7 +3769,7 @@ This list contains 1018 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Mar 25, 2022, + *last release*: Apr 01, 2022, *status*: N/A, *requires*: N/A @@ -3827,6 +3838,13 @@ This list contains 1018 plugins. Plugin for pytest that offloads expected outputs to data files + :pypi:`pytest-google-chat` + *last release*: Mar 27, 2022, + *status*: 4 - Beta, + *requires*: pytest + + Notify google chat channel for test results + :pypi:`pytest-graphql-schema` *last release*: Oct 18, 2019, *status*: N/A, @@ -3933,9 +3951,9 @@ This list contains 1018 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 24, 2022, + *last release*: Apr 02, 2022, *status*: 3 - Alpha, - *requires*: pytest (==7.0.1) + *requires*: pytest (==7.1.1) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -3954,7 +3972,7 @@ This list contains 1018 plugins. Report on tests that honor constraints, and guard against regressions :pypi:`pytest-hoverfly` - *last release*: Jan 20, 2022, + *last release*: Mar 28, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -4178,7 +4196,7 @@ This list contains 1018 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: Jan 26, 2022, + *last release*: Mar 30, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4248,7 +4266,7 @@ This list contains 1018 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Mar 23, 2022, + *last release*: Mar 29, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4632,6 +4650,13 @@ This list contains 1018 plugins. Pytest Loguru + :pypi:`pytest-lsp` + *last release*: Apr 02, 2022, + *status*: 3 - Alpha, + *requires*: pytest + + Pytest plugin for end-to-end testing of language servers + :pypi:`pytest-manual-marker` *last release*: Oct 11, 2021, *status*: 3 - Alpha, @@ -4857,7 +4882,7 @@ This list contains 1018 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*: Feb 26, 2022, + *last release*: Mar 30, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -4899,9 +4924,9 @@ This list contains 1018 plugins. pytest plugin to modify fixture scope :pypi:`pytest-molecule` - *last release*: Oct 06, 2021, + *last release*: Mar 29, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest (>=7.0.0) PyTest Molecule Plugin :: discover and run molecule tests @@ -6089,7 +6114,7 @@ This list contains 1018 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Feb 26, 2022, + *last release*: Mar 31, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -6516,7 +6541,7 @@ This list contains 1018 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Mar 22, 2022, + *last release*: Mar 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6558,7 +6583,7 @@ This list contains 1018 plugins. :pypi:`pytest-sbase` - *last release*: Mar 26, 2022, + *last release*: Mar 31, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6593,14 +6618,14 @@ This list contains 1018 plugins. A pytest plugin which allows to (de-)select tests from a file. :pypi:`pytest-selenium` - *last release*: Sep 19, 2020, + *last release*: Mar 28, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=5.0.0) + *requires*: pytest (>=6.0.0,<7.0.0) pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 26, 2022, + *last release*: Mar 31, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6691,7 +6716,7 @@ This list contains 1018 plugins. :pypi:`pytest-shell` - *last release*: Nov 07, 2021, + *last release*: Mar 27, 2022, *status*: N/A, *requires*: N/A @@ -6929,9 +6954,9 @@ This list contains 1018 plugins. Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. :pypi:`pytest-sphinx` - *last release*: Aug 05, 2020, + *last release*: Mar 30, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (>=7.0.0) Doctest plugin for pytest with support for Sphinx-specific doctest-directives @@ -7804,9 +7829,9 @@ This list contains 1018 plugins. :pypi:`pytest-variables` - *last release*: Oct 23, 2019, + *last release*: Mar 27, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=2.4.2) + *requires*: pytest (>=3.0.0,<8.0.0) pytest plugin for providing variables to tests/fixtures @@ -7978,6 +8003,13 @@ This list contains 1018 plugins. Windows tray notifications for py.test results. + :pypi:`pytest-wiremock` + *last release*: Mar 27, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.1,<8.0.0) + + A pytest plugin for programmatically using wiremock in integration tests + :pypi:`pytest-with-docker` *last release*: Nov 09, 2021, *status*: N/A, From e2269f8a5c0a0f078ddb11c496ce1fdbe832c76f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 20:26:44 +0000 Subject: [PATCH 029/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.1.0 → 22.3.0](https://github.com/psf/black/compare/22.1.0...22.3.0) - [github.com/asottile/setup-cfg-fmt: v1.20.0 → v1.20.1](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.0...v1.20.1) - [github.com/pre-commit/mirrors-mypy: v0.941 → v0.942](https://github.com/pre-commit/mirrors-mypy/compare/v0.941...v0.942) --- .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 045c82bba90..f4eae861ff5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 22.3.0 hooks: - id: black args: [--safe, --quiet] @@ -47,7 +47,7 @@ repos: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.0 + rev: v1.20.1 hooks: - id: setup-cfg-fmt args: [--max-py-version=3.10] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.941 + rev: v0.942 hooks: - id: mypy files: ^(src/|testing/) From 1527130476fcb0d7f3fda5c40daae5dde28825c2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 8 Apr 2022 17:08:30 -0400 Subject: [PATCH 030/255] temporarily pin jinja2 version for docs build --- doc/en/requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index 5b49cb7fccc..89446634e03 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -5,3 +5,6 @@ sphinx-removed-in>=0.2.0 sphinx>=3.1,<4 sphinxcontrib-trio sphinxcontrib-svg2pdfconverter + +# XXX: sphinx<4 is broken with latest jinja2 +jinja2<3.1 From 8fa775bcee5753d30abb69d266cc36c5524ece2f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 8 Apr 2022 17:00:31 -0400 Subject: [PATCH 031/255] fix comparison of dataclasses with `InitVar` --- changelog/9820.bugfix.rst | 1 + src/_pytest/assertion/util.py | 6 ++++-- .../dataclasses/test_compare_initvar.py | 12 ++++++++++++ testing/test_assertion.py | 7 +++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 changelog/9820.bugfix.rst create mode 100644 testing/example_scripts/dataclasses/test_compare_initvar.py diff --git a/changelog/9820.bugfix.rst b/changelog/9820.bugfix.rst new file mode 100644 index 00000000000..03af940f2c4 --- /dev/null +++ b/changelog/9820.bugfix.rst @@ -0,0 +1 @@ +Fix comparison of ``dataclasses`` with ``InitVar``. diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 75026730df4..0c34b83ea01 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -437,8 +437,10 @@ def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]: if not has_default_eq(left): return [] if isdatacls(left): - all_fields = left.__dataclass_fields__ - fields_to_check = [field for field, info in all_fields.items() if info.compare] + import dataclasses + + all_fields = dataclasses.fields(left) + fields_to_check = [info.name for info in all_fields if info.compare] elif isattrs(left): all_fields = left.__attrs_attrs__ fields_to_check = [field.name for field in all_fields if getattr(field, "eq")] diff --git a/testing/example_scripts/dataclasses/test_compare_initvar.py b/testing/example_scripts/dataclasses/test_compare_initvar.py new file mode 100644 index 00000000000..d859634ddd5 --- /dev/null +++ b/testing/example_scripts/dataclasses/test_compare_initvar.py @@ -0,0 +1,12 @@ +from dataclasses import dataclass +from dataclasses import InitVar + + +@dataclass +class Foo: + init_only: InitVar[int] + real_attr: int + + +def test_demonstrate(): + assert Foo(1, 2) == Foo(1, 3) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 4825ede778b..2bc06d65a2b 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -882,6 +882,13 @@ def test_data_classes_with_custom_eq(self, pytester: Pytester) -> None: result.assert_outcomes(failed=1, passed=0) result.stdout.no_re_match_line(".*Differing attributes.*") + def test_data_classes_with_initvar(self, pytester: Pytester) -> None: + p = pytester.copy_example("dataclasses/test_compare_initvar.py") + # issue 9820 + result = pytester.runpytest(p, "-vv") + result.assert_outcomes(failed=1, passed=0) + result.stdout.no_re_match_line(".*AttributeError.*") + class TestAssert_reprcompare_attrsclass: def test_attrs(self) -> None: From 765583dc347da832e8070b6f49a2e8523a233204 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 10 Apr 2022 00:17:14 +0000 Subject: [PATCH 032/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 124 ++++++++++++++++++------------- 1 file changed, 74 insertions(+), 50 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index cf2b056d63b..e8d116cb869 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1022 plugins. +This list contains 1025 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1022 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Mar 25, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 04, 2022 N/A pytest (>=5.4.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 1022 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 30, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 07, 2022 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) @@ -127,7 +127,7 @@ This list contains 1022 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 02, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 08, 2022 N/A pytest :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-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -145,7 +145,7 @@ This list contains 1022 plugins. :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-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) - :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=4.6) + :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A @@ -260,7 +260,7 @@ This list contains 1022 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 Mar 28, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Apr 09, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 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) @@ -272,7 +272,7 @@ This list contains 1022 plugins. :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) - :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) @@ -303,6 +303,7 @@ This list contains 1022 plugins. :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) :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. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest :pypi:`pytest-embedded` pytest embedded plugin Mar 18, 2022 N/A pytest (>=7.0) @@ -367,7 +368,7 @@ This list contains 1022 plugins. :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 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 Jan 09, 2020 3 - Alpha pytest (>=3.0) - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Jan 16, 2022 4 - Beta pytest (>=4.3.0) + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 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` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest @@ -389,7 +390,6 @@ This list contains 1022 plugins. :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :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-fold` Fold console output and drop user into interactive text user interface Feb 20, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A @@ -407,7 +407,7 @@ This list contains 1022 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. Apr 01, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 06, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -433,7 +433,7 @@ This list contains 1022 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Apr 02, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 09, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -441,7 +441,7 @@ This list contains 1022 plugins. :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 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 Mar 22, 2022 N/A N/A + :pypi:`pytest-html-merger` Pytest HTML reports merging utility Apr 03, 2022 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 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 @@ -478,7 +478,7 @@ This list contains 1022 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :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-invenio` Pytest fixtures for Invenio. Mar 29, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Apr 04, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -488,7 +488,7 @@ This list contains 1022 plugins. :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) - :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Dec 02, 2021 3 - Alpha N/A + :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Mar 09, 2022 3 - Alpha pytest :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) @@ -536,6 +536,7 @@ This list contains 1022 plugins. :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 02, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha 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-docs` Run markdown code fences through pytest Apr 07, 2022 N/A N/A :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A @@ -556,7 +557,7 @@ This list contains 1022 plugins. :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) - :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Sep 26, 2020 N/A pytest (>=6.0.1,<7.0.0) + :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.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) @@ -627,7 +628,7 @@ This list contains 1022 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Mar 25, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Apr 06, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -656,7 +657,7 @@ This list contains 1022 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=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-persistence` Pytest tool for persistent objects Mar 14, 2022 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 04, 2022 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :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. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' @@ -746,7 +747,7 @@ This list contains 1022 plugins. :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 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-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Sep 19, 2021 4 - Beta pytest + :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A @@ -803,19 +804,19 @@ This list contains 1022 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A 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 Mar 28, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Apr 06, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 05, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 05, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -870,7 +871,7 @@ This list contains 1022 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 Mar 23, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 05, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -953,6 +954,7 @@ This list contains 1022 plugins. :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A + :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A 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 @@ -975,6 +977,7 @@ This list contains 1022 plugins. :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A @@ -1053,7 +1056,7 @@ This list contains 1022 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Mar 25, 2022, + *last release*: Apr 04, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1410,7 +1413,7 @@ This list contains 1022 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Mar 30, 2022, + *last release*: Apr 07, 2022, *status*: N/A, *requires*: N/A @@ -1809,7 +1812,7 @@ This list contains 1022 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Apr 02, 2022, + *last release*: Apr 08, 2022, *status*: N/A, *requires*: pytest @@ -1937,7 +1940,7 @@ This list contains 1022 plugins. :pypi:`pytest-check-links` *last release*: Jul 29, 2020, *status*: N/A, - *requires*: pytest (>=4.6) + *requires*: pytest (>=7.0) Check links in files @@ -2740,7 +2743,7 @@ This list contains 1022 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Mar 28, 2022, + *last release*: Apr 09, 2022, *status*: N/A, *requires*: pytest (<8.0,>=4.0) @@ -2824,7 +2827,7 @@ This list contains 1022 plugins. Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. :pypi:`pytest-docker-registry-fixtures` - *last release*: Feb 09, 2022, + *last release*: Apr 08, 2022, *status*: 4 - Beta, *requires*: pytest @@ -3040,6 +3043,13 @@ This list contains 1022 plugins. Tool to help automate user interfaces + :pypi:`pytest-eliot` + *last release*: Apr 05, 2022, + *status*: 1 - Planning, + *requires*: pytest (>=5.4.0) + + An eliot plugin for pytest. + :pypi:`pytest-elk-reporter` *last release*: Jan 24, 2021, *status*: 4 - Beta, @@ -3489,7 +3499,7 @@ This list contains 1022 plugins. Pytest plugin for filtering based on sub-packages :pypi:`pytest-find-dependencies` - *last release*: Jan 16, 2022, + *last release*: Apr 09, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.3.0) @@ -3642,13 +3652,6 @@ This list contains 1022 plugins. A pytest plugin that alerts user of failed test cases with screen notifications - :pypi:`pytest-fold` - *last release*: Feb 20, 2022, - *status*: 4 - Beta, - *requires*: pytest (>=6.2.5) - - Fold console output and drop user into interactive text user interface - :pypi:`pytest-forcefail` *last release*: May 15, 2018, *status*: 4 - Beta, @@ -3769,7 +3772,7 @@ This list contains 1022 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Apr 01, 2022, + *last release*: Apr 06, 2022, *status*: N/A, *requires*: N/A @@ -3951,7 +3954,7 @@ This list contains 1022 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 02, 2022, + *last release*: Apr 09, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4007,7 +4010,7 @@ This list contains 1022 plugins. optimized pytest plugin for generating HTML reports :pypi:`pytest-html-merger` - *last release*: Mar 22, 2022, + *last release*: Apr 03, 2022, *status*: N/A, *requires*: N/A @@ -4266,7 +4269,7 @@ This list contains 1022 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Mar 29, 2022, + *last release*: Apr 04, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4336,7 +4339,7 @@ This list contains 1022 plugins. A custom jest-pytest oriented Pytest reporter :pypi:`pytest-jira` - *last release*: Dec 02, 2021, + *last release*: Apr 07, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -4671,6 +4674,13 @@ This list contains 1022 plugins. Test your markdown docs with pytest + :pypi:`pytest-markdown-docs` + *last release*: Apr 07, 2022, + *status*: N/A, + *requires*: N/A + + Run markdown code fences through pytest + :pypi:`pytest-marker-bugzilla` *last release*: Jan 09, 2020, *status*: N/A, @@ -4812,9 +4822,9 @@ This list contains 1022 plugins. Mimesis integration with the pytest test runner :pypi:`pytest-minecraft` - *last release*: Sep 26, 2020, + *last release*: Apr 06, 2022, *status*: N/A, - *requires*: pytest (>=6.0.1,<7.0.0) + *requires*: pytest (>=6.0.1) A pytest plugin for running tests against Minecraft releases @@ -5309,7 +5319,7 @@ This list contains 1022 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Mar 25, 2022, + *last release*: Apr 06, 2022, *status*: N/A, *requires*: pytest @@ -5512,7 +5522,7 @@ This list contains 1022 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Mar 14, 2022, + *last release*: Apr 04, 2022, *status*: N/A, *requires*: N/A @@ -6142,7 +6152,7 @@ This list contains 1022 plugins. Redis fixtures and fixture factories for Pytest. :pypi:`pytest-redislite` - *last release*: Sep 19, 2021, + *last release*: Apr 05, 2022, *status*: 4 - Beta, *requires*: pytest @@ -6541,7 +6551,7 @@ This list contains 1022 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Mar 28, 2022, + *last release*: Apr 06, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6583,7 +6593,7 @@ This list contains 1022 plugins. :pypi:`pytest-sbase` - *last release*: Mar 31, 2022, + *last release*: Apr 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6625,7 +6635,7 @@ This list contains 1022 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 31, 2022, + *last release*: Apr 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7010,7 +7020,7 @@ This list contains 1022 plugins. :pypi:`pytest-splunk-addon` - *last release*: Mar 23, 2022, + *last release*: Apr 05, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7590,6 +7600,13 @@ This list contains 1022 plugins. A small example package + :pypi:`pytest-tmp-files` + *last release*: Apr 03, 2022, + *status*: N/A, + *requires*: pytest + + Utilities to create temporary file hierarchies in pytest. + :pypi:`pytest-tmreport` *last release*: Nov 17, 2021, *status*: N/A, @@ -7744,6 +7761,13 @@ This list contains 1022 plugins. Run type checkers on specified test files + :pypi:`pytest-typhoon-config` + *last release*: Apr 07, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + A Typhoon HIL plugin that facilitates test parameter configuration at runtime + :pypi:`pytest-typhoon-xray` *last release*: Mar 07, 2022, *status*: 4 - Beta, From 61dfdfcc3f2ca0f02a789c242dc168868e711dd3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 21:28:05 +0000 Subject: [PATCH 033/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0) - [github.com/asottile/pyupgrade: v2.31.1 → v2.32.0](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.32.0) --- .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 f4eae861ff5..c0fd36df3fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: blacken-docs additional_dependencies: [black==20.8b1] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -42,7 +42,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.31.1 + rev: v2.32.0 hooks: - id: pyupgrade args: [--py37-plus] From 99e20713fdfd44450a7bbaf3f1b9f916fb309ea1 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 12 Apr 2022 17:26:30 +0300 Subject: [PATCH 034/255] Docs: link to easy issues in contributing guide --- CONTRIBUTING.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e72cbfe2401..262396728b8 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,6 +50,8 @@ Fix bugs -------- Look through the `GitHub issues for bugs `_. +See also the `"status: easy" issues `_ +that are friendly to new contributors. :ref:`Talk ` to developers to find out how you can fix specific bugs. To indicate that you are going to work on a particular issue, add a comment to that effect on the specific issue. From 61095e4ba6e3429cd910bf548f646af38bf18ebc Mon Sep 17 00:00:00 2001 From: gresm <78505251+gresm@users.noreply.github.com> Date: Sat, 16 Apr 2022 15:51:21 +0200 Subject: [PATCH 035/255] Update goodpractices.rst Fix example package tree. --- doc/en/explanation/goodpractices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 32a14991ae2..92110f4f901 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -196,7 +196,7 @@ want to distribute them along with your application: __init__.py app.py view.py - test/ + tests/ __init__.py test_app.py test_view.py From 2e8a3198289e56d4055aac2f8ef7af1e42b71545 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 17 Apr 2022 11:11:17 -0700 Subject: [PATCH 036/255] Use tomllib on Python 3.11 (#9741) --- changelog/9741.improvement.rst | 3 +++ setup.cfg | 2 +- src/_pytest/config/findpaths.py | 10 +++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 changelog/9741.improvement.rst diff --git a/changelog/9741.improvement.rst b/changelog/9741.improvement.rst new file mode 100644 index 00000000000..1f9ab3eadf2 --- /dev/null +++ b/changelog/9741.improvement.rst @@ -0,0 +1,3 @@ +On Python 3.11, use the standard library's :mod:`tomllib` to parse TOML. + +:mod:`tomli`` is no longer a dependency on Python 3.11. diff --git a/setup.cfg b/setup.cfg index fe6ea4095bc..c4f5bd9d29f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,10 +46,10 @@ install_requires = packaging pluggy>=0.12,<2.0 py>=1.8.2 - tomli>=1.0.0 atomicwrites>=1.0;sys_platform=="win32" colorama;sys_platform=="win32" importlib-metadata>=0.12;python_version<"3.8" + tomli>=1.0.0;python_version<"3.11" python_requires = >=3.7 package_dir = =src diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index c082e652d92..ead344baac5 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -1,4 +1,5 @@ import os +import sys from pathlib import Path from typing import Dict from typing import Iterable @@ -64,12 +65,15 @@ def load_config_dict_from_file( # '.toml' files are considered if they contain a [tool.pytest.ini_options] table. elif filepath.suffix == ".toml": - import tomli + if sys.version_info >= (3, 11): + import tomllib + else: + import tomli as tomllib toml_text = filepath.read_text(encoding="utf-8") try: - config = tomli.loads(toml_text) - except tomli.TOMLDecodeError as exc: + config = tomllib.loads(toml_text) + except tomllib.TOMLDecodeError as exc: raise UsageError(f"{filepath}: {exc}") from exc result = config.get("tool", {}).get("pytest", {}).get("ini_options", None) From ace71037ab03a39e0aae074b24e7f2c1c86d5e7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 03:01:56 +0000 Subject: [PATCH 037/255] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.0.3 to 4.0.4. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.3...4.0.4) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... 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 357fa539f32..6ccc16c4253 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.5.0 -django==4.0.3 +django==4.0.4 pytest-asyncio==0.18.2 pytest-bdd==5.0.0 pytest-cov==3.0.0 From 86b62067b770b0ddf242312da63f7a3722239d70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 03:01:59 +0000 Subject: [PATCH 038/255] build(deps): Bump twisted in /testing/plugins_integration Bumps [twisted](https://github.com/twisted/twisted) from 22.2.0 to 22.4.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-22.2.0...twisted-22.4.0) --- updated-dependencies: - dependency-name: twisted 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 357fa539f32..e37d9242fdf 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -11,5 +11,5 @@ pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 pytest-twisted==1.13.4 -twisted==22.2.0 +twisted==22.4.0 pytest-xvfb==2.0.0 From 5800d39053af398eebcefdb668e767acb7944f01 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 20 Apr 2022 19:07:10 +0300 Subject: [PATCH 039/255] Increase stacklevel to point at user's code (#9869) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- changelog/9869.bugfix.rst | 2 ++ src/_pytest/nodes.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/9869.bugfix.rst diff --git a/changelog/9869.bugfix.rst b/changelog/9869.bugfix.rst new file mode 100644 index 00000000000..9761d7f161b --- /dev/null +++ b/changelog/9869.bugfix.rst @@ -0,0 +1,2 @@ +Increase ``stacklevel`` for the ``NODE_CTOR_FSPATH_ARG`` deprecation to point to the +user's code, not pytest. diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index e49c1b003e0..1a168043a4f 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -111,7 +111,7 @@ def _imply_path( NODE_CTOR_FSPATH_ARG.format( node_type_name=node_type.__name__, ), - stacklevel=3, + stacklevel=6, ) if path is not None: if fspath is not None: From 6a3168e770287cc3bb53090d3dc3feb78d78563a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 13:08:36 -0300 Subject: [PATCH 040/255] [automated] Update plugin list (#9864) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 186 +++++++++++++++++++------------ 1 file changed, 113 insertions(+), 73 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index e8d116cb869..5f3bcf78f0a 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1025 plugins. +This list contains 1030 plugins. .. only:: not latex @@ -34,7 +34,7 @@ This list contains 1025 plugins. :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Mar 12, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Apr 10, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -48,6 +48,7 @@ This list contains 1025 plugins. :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :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 :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A @@ -63,14 +64,14 @@ This list contains 1025 plugins. :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A :pypi:`pytest-assertions` Pytest Assertions Mar 21, 2022 N/A N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A - :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Sep 21, 2021 3 - Alpha N/A + :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A - :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 07, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 14, 2022 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) @@ -117,7 +118,7 @@ This list contains 1025 plugins. :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 :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A - :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jun 02, 2020 5 - Production/Stable pytest (>=3.6.0) + :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Apr 13, 2022 5 - Production/Stable pytest (>=6.2.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) @@ -142,6 +143,7 @@ This list contains 1025 plugins. :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest :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-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) @@ -158,7 +160,7 @@ This list contains 1025 plugins. :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) :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 Oct 27, 2021 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Apr 12, 2022 4 - Beta pytest (>=4.6.0) :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 @@ -169,7 +171,7 @@ This list contains 1025 plugins. :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Nov 12, 2020 N/A pytest (>=3.6,<7) :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :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. Nov 06, 2020 N/A N/A + :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 14, 2022 N/A N/A :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A :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 Feb 01, 2022 3 - Alpha pytest (>=3.10) @@ -184,7 +186,7 @@ This list contains 1025 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 14, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Apr 16, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -306,16 +308,16 @@ This list contains 1025 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Mar 18, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 18, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 18, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 18, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Apr 15, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Apr 15, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 18, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Apr 15, 2022 N/A N/A :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 Oct 10, 2021 4 - Beta pytest (==6.0.1) + :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest @@ -400,14 +402,14 @@ This list contains 1025 plugins. :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A - :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Mar 15, 2022 N/A pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) :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-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. Apr 06, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 13, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -433,7 +435,7 @@ This list contains 1025 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Apr 09, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 15, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -469,7 +471,7 @@ This list contains 1025 plugins. :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 Sep 30, 2021 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Mar 30, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 11, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) @@ -511,7 +513,7 @@ This list contains 1025 plugins. :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Feb 23, 2022 4 - Beta N/A + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Apr 14, 2022 4 - Beta N/A :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 @@ -532,7 +534,7 @@ This list contains 1025 plugins. :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :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-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A - :pypi:`pytest-loguru` Pytest Loguru Feb 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 02, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) @@ -567,7 +569,7 @@ This list contains 1025 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 30, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Apr 11, 2022 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-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -628,7 +630,7 @@ This list contains 1025 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Apr 06, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Apr 12, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -660,7 +662,7 @@ This list contains 1025 plugins. :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 04, 2022 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :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. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' + :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest @@ -691,6 +693,7 @@ This list contains 1025 plugins. :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) + :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 16, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) :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) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -733,7 +736,7 @@ This list contains 1025 plugins. :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Mar 24, 2022 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :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 @@ -771,7 +774,7 @@ This list contains 1025 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :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 22, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Apr 12, 2022 N/A pytest (>=3.8.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-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) @@ -779,7 +782,7 @@ This list contains 1025 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :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-resilient-circuits` Resilient Circuits fixtures for PyTest. Mar 07, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Apr 13, 2022 N/A N/A :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 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A @@ -810,13 +813,13 @@ This list contains 1025 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 13, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 13, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -858,7 +861,7 @@ This list contains 1025 plugins. :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Feb 21, 2022 2 - Pre-Alpha pytest + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Apr 11, 2022 2 - Pre-Alpha pytest :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. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A @@ -871,7 +874,7 @@ This list contains 1025 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 Apr 05, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 13, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -919,7 +922,7 @@ This list contains 1025 plugins. :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest :pypi:`pytest-testdox` A testdox format reporter for pytest Dec 05, 2021 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Feb 10, 2022 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -975,6 +978,7 @@ This list contains 1025 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 13, 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) for Pytest, automatically launched after your test run is finished Apr 14, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -986,6 +990,7 @@ This list contains 1025 plugins. :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :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 Mar 28, 2021 4 - Beta N/A + :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Apr 12, 2022 4 - Beta pytest (>=3.5.0) :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. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest @@ -1040,7 +1045,7 @@ This list contains 1025 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :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 - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Mar 21, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ @@ -1161,7 +1166,7 @@ This list contains 1025 plugins. :pypi:`pytest-alembic` - *last release*: Mar 12, 2022, + *last release*: Apr 10, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1258,6 +1263,13 @@ This list contains 1025 plugins. Pytest fixture which runs given ansible playbook file. + :pypi:`pytest-ansible-units` + *last release*: Apr 14, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin for running unit tests within an ansible collection + :pypi:`pytest-antilru` *last release*: Jan 29, 2022, *status*: 5 - Production/Stable, @@ -1364,7 +1376,7 @@ This list contains 1025 plugins. pytest-assertutil :pypi:`pytest-assert-utils` - *last release*: Sep 21, 2021, + *last release*: Apr 14, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -1385,7 +1397,7 @@ This list contains 1025 plugins. A plugin for pytest devs to view how assertion rewriting recodes the AST :pypi:`pytest-astropy` - *last release*: Sep 21, 2021, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6) @@ -1413,7 +1425,7 @@ This list contains 1025 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Apr 07, 2022, + *last release*: Apr 14, 2022, *status*: N/A, *requires*: N/A @@ -1742,9 +1754,9 @@ This list contains 1025 plugins. \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. :pypi:`pytest-bug` - *last release*: Jun 02, 2020, + *last release*: Apr 13, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.6.0) + *requires*: pytest (>=6.2.0) Pytest plugin for marking tests as a bug @@ -1916,6 +1928,13 @@ This list contains 1025 plugins. turn . into √,turn F into x + :pypi:`pytest-change-xds` + *last release*: Apr 16, 2022, + *status*: N/A, + *requires*: pytest + + turn . into √,turn F into x + :pypi:`pytest-chdir` *last release*: Jan 28, 2020, *status*: N/A, @@ -2029,7 +2048,7 @@ This list contains 1025 plugins. pytest plugin to add source code sanity checks (pep8 and friends) :pypi:`pytest-codecov` - *last release*: Oct 27, 2021, + *last release*: Apr 12, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.6.0) @@ -2106,7 +2125,7 @@ This list contains 1025 plugins. Base configurations and utilities for developing your Python project test suite with pytest. :pypi:`pytest-confluence-report` - *last release*: Nov 06, 2020, + *last release*: Apr 14, 2022, *status*: N/A, *requires*: N/A @@ -2211,7 +2230,7 @@ This list contains 1025 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Mar 14, 2022, + *last release*: Apr 16, 2022, *status*: N/A, *requires*: N/A @@ -3065,35 +3084,35 @@ This list contains 1025 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A @@ -3107,14 +3126,14 @@ This list contains 1025 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A @@ -3128,9 +3147,9 @@ This list contains 1025 plugins. A pytest plugin that adds emojis to your test result report :pypi:`pytest-emoji-output` - *last release*: Oct 10, 2021, + *last release*: Apr 12, 2022, *status*: 4 - Beta, - *requires*: pytest (==6.0.1) + *requires*: pytest (==7.0.1) Pytest plugin to represent test output with emoji support @@ -3723,9 +3742,9 @@ This list contains 1025 plugins. :pypi:`pytest-gather-fixtures` - *last release*: Mar 15, 2022, + *last release*: Apr 12, 2022, *status*: N/A, - *requires*: pytest (>=6.0.0,<7.0.0) + *requires*: pytest (>=6.0.0) set up asynchronous pytest fixtures concurrently @@ -3772,7 +3791,7 @@ This list contains 1025 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Apr 06, 2022, + *last release*: Apr 13, 2022, *status*: N/A, *requires*: N/A @@ -3954,7 +3973,7 @@ This list contains 1025 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 09, 2022, + *last release*: Apr 15, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4206,7 +4225,7 @@ This list contains 1025 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: Feb 11, 2022, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4500,7 +4519,7 @@ This list contains 1025 plugins. A python-libfaketime plugin for pytest. :pypi:`pytest-libiio` - *last release*: Feb 23, 2022, + *last release*: Apr 14, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4647,7 +4666,7 @@ This list contains 1025 plugins. Package for creating a pytest test run reprot :pypi:`pytest-loguru` - *last release*: Feb 27, 2022, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4892,7 +4911,7 @@ This list contains 1025 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 30, 2022, + *last release*: Apr 11, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5319,7 +5338,7 @@ This list contains 1025 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Apr 06, 2022, + *last release*: Apr 12, 2022, *status*: N/A, *requires*: pytest @@ -5543,9 +5562,9 @@ This list contains 1025 plugins. Pytest plugins and helpers for tests using a Postgres database. :pypi:`pytest-phmdoctest` - *last release*: Nov 10, 2021, + *last release*: Apr 15, 2022, *status*: 4 - Beta, - *requires*: pytest (>=6.2) ; extra == 'test' + *requires*: pytest (>=5.4.3) pytest plugin to test Python examples in Markdown using phmdoctest. @@ -5759,6 +5778,13 @@ This list contains 1025 plugins. pytest plugin with powerful fixtures + :pypi:`pytest-prefer-nested-dup-tests` + *last release*: Apr 16, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.1,<8.0.0) + + A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. + :pypi:`pytest-pretty-terminal` *last release*: Jan 31, 2022, *status*: N/A, @@ -6054,7 +6080,7 @@ This list contains 1025 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Mar 24, 2022, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6320,7 +6346,7 @@ This list contains 1025 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Feb 22, 2022, + *last release*: Apr 12, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -6376,7 +6402,7 @@ This list contains 1025 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: Mar 07, 2022, + *last release*: Apr 13, 2022, *status*: N/A, *requires*: N/A @@ -6593,7 +6619,7 @@ This list contains 1025 plugins. :pypi:`pytest-sbase` - *last release*: Apr 05, 2022, + *last release*: Apr 13, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6635,7 +6661,7 @@ This list contains 1025 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Apr 05, 2022, + *last release*: Apr 13, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6929,7 +6955,7 @@ This list contains 1025 plugins. A simple plugin to first execute tests that historically failed more :pypi:`pytest-sosu` - *last release*: Feb 21, 2022, + *last release*: Apr 11, 2022, *status*: 2 - Pre-Alpha, *requires*: pytest @@ -7020,7 +7046,7 @@ This list contains 1025 plugins. :pypi:`pytest-splunk-addon` - *last release*: Apr 05, 2022, + *last release*: Apr 13, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7356,7 +7382,7 @@ This list contains 1025 plugins. A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. :pypi:`pytest-testinfra` - *last release*: Feb 10, 2022, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=3.0.2) @@ -7747,6 +7773,13 @@ This list contains 1025 plugins. Test Class Base + :pypi:`pytest-tui` + *last release*: Apr 14, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.2.5) + + Text User Interface (TUI) for Pytest, automatically launched after your test run is finished + :pypi:`pytest-twisted` *last release*: Aug 30, 2021, *status*: 5 - Production/Stable, @@ -7824,6 +7857,13 @@ This list contains 1025 plugins. Test equality of unordered collections in pytest + :pypi:`pytest-unstable` + *last release*: Apr 12, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + Set a test as unstable to return 0 even if it failed + :pypi:`pytest-upload-report` *last release*: Jun 18, 2021, *status*: 5 - Production/Stable, @@ -8203,7 +8243,7 @@ This list contains 1025 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Mar 21, 2022, + *last release*: Apr 15, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 1ea70817526e1ddf599623cb272d87ba88b0e241 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 13:08:56 -0300 Subject: [PATCH 041/255] build(deps): Bump pytest-asyncio in /testing/plugins_integration (#9824) Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.18.2 to 0.18.3. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Changelog](https://github.com/pytest-dev/pytest-asyncio/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.18.2...v0.18.3) --- updated-dependencies: - dependency-name: pytest-asyncio 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 d1f446ca563..6d1b02920a0 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.5.0 django==4.0.4 -pytest-asyncio==0.18.2 +pytest-asyncio==0.18.3 pytest-bdd==5.0.0 pytest-cov==3.0.0 pytest-django==4.5.2 From 988197c7954d6e4123c1650cab090ba8f529d6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Wed, 20 Apr 2022 20:09:37 +0200 Subject: [PATCH 042/255] fix: move 'import getpass' statement to try-clause --- src/_pytest/tmpdir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index f901fd5727c..4cf3714bcd1 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -158,9 +158,9 @@ def getbasetemp(self) -> Path: def get_user() -> Optional[str]: """Return the current user name, or None if getuser() does not work in the current environment (see #1010).""" - import getpass - try: + # In some exotic environments, getpass may not be importable. + import getpass return getpass.getuser() except (ImportError, KeyError): return None From 8514fab409fbcf43ec9e8cd7a39a27635a4b6e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Wed, 20 Apr 2022 20:15:29 +0200 Subject: [PATCH 043/255] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 69e71fa10d4..5ab1c2f7a03 100644 --- a/AUTHORS +++ b/AUTHORS @@ -256,6 +256,7 @@ Ondřej Súkup Oscar Benjamin Parth Patel Patrick Hayes +Paul Müller Pauli Virtanen Pavel Karateev Paweł Adamczak From ac9b65d890044656a592c41391c0734f4e67f9df Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:15:48 +0000 Subject: [PATCH 044/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/tmpdir.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 4cf3714bcd1..12dc463a2a2 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -161,6 +161,7 @@ def get_user() -> Optional[str]: try: # In some exotic environments, getpass may not be importable. import getpass + return getpass.getuser() except (ImportError, KeyError): return None From 2b9f8f2f9b98b492f438ec5d4b0284706aae8498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Wed, 20 Apr 2022 20:20:53 +0200 Subject: [PATCH 045/255] Create 9871.bugfix.rst --- changelog/9871.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9871.bugfix.rst diff --git a/changelog/9871.bugfix.rst b/changelog/9871.bugfix.rst new file mode 100644 index 00000000000..0986414f2bf --- /dev/null +++ b/changelog/9871.bugfix.rst @@ -0,0 +1 @@ +Handle ``ImportError`` for ``getpass`` import in ``_pytest.tempdir.get_user`` From 715d0ca9d0aa6a6136487336193c98e2604a0353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Wed, 20 Apr 2022 20:21:44 +0200 Subject: [PATCH 046/255] cleanup --- src/_pytest/tmpdir.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 12dc463a2a2..4cf3714bcd1 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -161,7 +161,6 @@ def get_user() -> Optional[str]: try: # In some exotic environments, getpass may not be importable. import getpass - return getpass.getuser() except (ImportError, KeyError): return None From 12971a37e121c5761bbecab32dbca24231a59065 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:23:03 +0000 Subject: [PATCH 047/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/tmpdir.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 4cf3714bcd1..12dc463a2a2 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -161,6 +161,7 @@ def get_user() -> Optional[str]: try: # In some exotic environments, getpass may not be importable. import getpass + return getpass.getuser() except (ImportError, KeyError): return None From 1285caadf29ab7801ff24ace711de7b66fc20a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Thu, 21 Apr 2022 00:18:47 +0200 Subject: [PATCH 048/255] Update 9871.bugfix.rst --- changelog/9871.bugfix.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog/9871.bugfix.rst b/changelog/9871.bugfix.rst index 0986414f2bf..ed787b3da34 100644 --- a/changelog/9871.bugfix.rst +++ b/changelog/9871.bugfix.rst @@ -1 +1,2 @@ -Handle ``ImportError`` for ``getpass`` import in ``_pytest.tempdir.get_user`` +Fix a bizarre (and fortunately rare) bug where the `temp_path` fixture could raise +an internal error while attempting to get the current user's username. From 0347957aa7fe18a7417f16176933c636889baa52 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Fri, 22 Apr 2022 11:15:27 -0700 Subject: [PATCH 049/255] Fix wrong `log_file` docs (#9878) Co-authored-by: Bruno Oliveira --- doc/en/how-to/logging.rst | 2 ++ doc/en/reference/reference.rst | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index 2e8734fa6a3..5a089c2fba0 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -198,6 +198,8 @@ option names are: 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 which means that it will be overwritten at each run tests session. +Note that relative paths for the log-file location, whether passed on the CLI or declared in a +config file, are always resolved relative to the current working directory. You can also specify the logging level for the log file by passing ``--log-file-level``. This setting accepts the logging level names as seen in diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index aec384d6d33..167c8fed9a3 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1514,7 +1514,7 @@ passed multiple times. The expected format is ``name=value``. For example:: - Sets a file name relative to the ``pytest.ini`` file where log messages should be written to, in addition + 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 From e598429c7305b5fe70165c999489e04d558b0969 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Fri, 22 Apr 2022 14:38:36 -0700 Subject: [PATCH 050/255] Use safe_getattr() in getfixturemarker() --- src/_pytest/fixtures.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index ee3e93f1908..022dbc15f27 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -223,15 +223,10 @@ def add_funcarg_pseudo_fixture_def( def getfixturemarker(obj: object) -> Optional["FixtureFunctionMarker"]: """Return fixturemarker or None if it doesn't exist or raised exceptions.""" - try: - fixturemarker: Optional[FixtureFunctionMarker] = getattr( - obj, "_pytestfixturefunction", None - ) - except TEST_OUTCOME: - # some objects raise errors like request (from flask import request) - # we don't expect them to be fixture functions - return None - return fixturemarker + return cast( + Optional[FixtureFunctionMarker], + safe_getattr(obj, "_pytestfixturefunction", None), + ) # Parametrized fixture key, helper alias for code below. From 246815de13791f5ea299963ee304ed35e5c28ae3 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 23 Apr 2022 11:37:08 -0300 Subject: [PATCH 051/255] Prepare release version 7.1.2 (#9881) Co-authored-by: pytest bot (cherry picked from commit df9df5574913b2e7753b8cf6ebbf06ed9fbde10d) --- changelog/9726.bugfix.rst | 1 - changelog/9820.bugfix.rst | 1 - changelog/9869.bugfix.rst | 2 -- changelog/9871.bugfix.rst | 2 -- doc/en/announce/index.rst | 1 + doc/en/announce/release-7.1.2.rst | 23 +++++++++++++++++++++++ doc/en/builtin.rst | 4 ++-- doc/en/changelog.rst | 20 ++++++++++++++++++++ doc/en/getting-started.rst | 2 +- 9 files changed, 47 insertions(+), 9 deletions(-) delete mode 100644 changelog/9726.bugfix.rst delete mode 100644 changelog/9820.bugfix.rst delete mode 100644 changelog/9869.bugfix.rst delete mode 100644 changelog/9871.bugfix.rst create mode 100644 doc/en/announce/release-7.1.2.rst diff --git a/changelog/9726.bugfix.rst b/changelog/9726.bugfix.rst deleted file mode 100644 index 66c04c4d90c..00000000000 --- a/changelog/9726.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -An unnecessary ``numpy`` import inside :func:`pytest.approx` was removed. diff --git a/changelog/9820.bugfix.rst b/changelog/9820.bugfix.rst deleted file mode 100644 index 03af940f2c4..00000000000 --- a/changelog/9820.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix comparison of ``dataclasses`` with ``InitVar``. diff --git a/changelog/9869.bugfix.rst b/changelog/9869.bugfix.rst deleted file mode 100644 index 9761d7f161b..00000000000 --- a/changelog/9869.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Increase ``stacklevel`` for the ``NODE_CTOR_FSPATH_ARG`` deprecation to point to the -user's code, not pytest. diff --git a/changelog/9871.bugfix.rst b/changelog/9871.bugfix.rst deleted file mode 100644 index ed787b3da34..00000000000 --- a/changelog/9871.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a bizarre (and fortunately rare) bug where the `temp_path` fixture could raise -an internal error while attempting to get the current user's username. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 0da8b4037ed..bcc0b45664b 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.1.2 release-7.1.1 release-7.1.0 release-7.0.1 diff --git a/doc/en/announce/release-7.1.2.rst b/doc/en/announce/release-7.1.2.rst new file mode 100644 index 00000000000..ba33cdc694b --- /dev/null +++ b/doc/en/announce/release-7.1.2.rst @@ -0,0 +1,23 @@ +pytest-7.1.2 +======================================= + +pytest 7.1.2 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Anthony Sottile +* Bruno Oliveira +* Hugo van Kemenade +* Kian Eliasi +* Ran Benita +* Zac Hatfield-Dodds + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 455ae88121f..77ae5a13028 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -170,10 +170,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a See https://docs.python.org/library/how-to/capture-warnings.html for information on warning categories. - tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:183 + tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:184 Return a :class:`pytest.TempPathFactory` instance for the test session. - tmp_path -- .../_pytest/tmpdir.py:198 + tmp_path -- .../_pytest/tmpdir.py:199 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 6ff85883e41..46e18d32255 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,26 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.1.2 (2022-04-23) +========================= + +Bug Fixes +--------- + +- `#9726 `_: An unnecessary ``numpy`` import inside :func:`pytest.approx` was removed. + + +- `#9820 `_: Fix comparison of ``dataclasses`` with ``InitVar``. + + +- `#9869 `_: Increase ``stacklevel`` for the ``NODE_CTOR_FSPATH_ARG`` deprecation to point to the + user's code, not pytest. + + +- `#9871 `_: Fix a bizarre (and fortunately rare) bug where the `temp_path` fixture could raise + an internal error while attempting to get the current user's username. + + pytest 7.1.1 (2022-03-17) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index b856803f1f1..f7e03cc8b67 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 7.1.1 + pytest 7.1.2 .. _`simpletest`: From 21091a45d014d369be422050309ccbf3f8572c57 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 24 Apr 2022 00:19:03 +0000 Subject: [PATCH 052/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 114 +++++++++++++++++++------------ 1 file changed, 69 insertions(+), 45 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 5f3bcf78f0a..bbddba7db58 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1030 plugins. +This list contains 1033 plugins. .. only:: not latex @@ -62,7 +62,7 @@ This list contains 1030 plugins. :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 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) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A - :pypi:`pytest-assertions` Pytest Assertions Mar 21, 2022 N/A N/A + :pypi:`pytest-assertions` Pytest Assertions Apr 22, 2022 N/A N/A :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-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) @@ -128,7 +128,7 @@ This list contains 1030 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 08, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest :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-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -171,7 +171,7 @@ This list contains 1030 plugins. :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Nov 12, 2020 N/A pytest (>=3.6,<7) :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :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 14, 2022 N/A 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 Mar 18, 2022 4 - Beta N/A :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 Feb 01, 2022 3 - Alpha pytest (>=3.10) @@ -186,7 +186,7 @@ This list contains 1030 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Apr 16, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Apr 17, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -293,7 +293,7 @@ This list contains 1030 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` Jun 25, 2021 N/A N/A - :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Mar 07, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) :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 Jun 03, 2021 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 @@ -397,7 +397,7 @@ This list contains 1030 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-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A - :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Feb 14, 2022 N/A pytest (>=3.0) + :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A @@ -435,7 +435,7 @@ This list contains 1030 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Apr 15, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 21, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -461,6 +461,7 @@ This list contains 1030 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :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 Apr 20, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest @@ -480,7 +481,7 @@ This list contains 1030 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :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-invenio` Pytest fixtures for Invenio. Apr 04, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Apr 22, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -510,6 +511,7 @@ This list contains 1030 plugins. :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-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest + :pypi:`pytest-leak-finder` Find the previous test that makes another to fail Apr 18, 2022 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-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) @@ -535,7 +537,7 @@ This list contains 1030 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-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 02, 2022 3 - Alpha pytest + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 18, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha 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-docs` Run markdown code fences through pytest Apr 07, 2022 N/A N/A @@ -552,6 +554,7 @@ This list contains 1030 plugins. :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 make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :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 Apr 19, 2022 N/A N/A :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-message` Pytest plugin for sending report message of marked tests execution Jan 05, 2022 N/A pytest (>=6.2.5) @@ -585,7 +588,7 @@ This list contains 1030 plugins. :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A @@ -630,7 +633,7 @@ This list contains 1030 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Apr 12, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Apr 22, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -659,7 +662,7 @@ This list contains 1030 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=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-persistence` Pytest tool for persistent objects Apr 04, 2022 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :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) @@ -688,12 +691,12 @@ This list contains 1030 plugins. :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 - :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 19, 2021 5 - Production/Stable pytest + :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Apr 20, 2022 5 - Production/Stable pytest :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 16, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 17, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) :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) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -813,13 +816,13 @@ This list contains 1030 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 13, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 22, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 13, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 22, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -853,7 +856,7 @@ This list contains 1030 plugins. :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A - :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Feb 11, 2022 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) @@ -870,11 +873,11 @@ This list contains 1030 plugins. :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) - :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Mar 13, 2022 4 - Beta pytest (>=5,<8) + :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) :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 Apr 13, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 19, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -920,7 +923,7 @@ This list contains 1030 plugins. :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-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest - :pypi:`pytest-testdox` A testdox format reporter for pytest Dec 05, 2021 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) @@ -998,10 +1001,10 @@ This list contains 1030 plugins. :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Aug 13, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Apr 21, 2022 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Aug 30, 2021 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :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 May 28, 2019 5 - Production/Stable pytest @@ -1362,7 +1365,7 @@ This list contains 1030 plugins. test Answer Set Programming programs :pypi:`pytest-assertions` - *last release*: Mar 21, 2022, + *last release*: Apr 22, 2022, *status*: N/A, *requires*: N/A @@ -1824,7 +1827,7 @@ This list contains 1030 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Apr 08, 2022, + *last release*: Apr 17, 2022, *status*: N/A, *requires*: pytest @@ -2125,7 +2128,7 @@ This list contains 1030 plugins. Base configurations and utilities for developing your Python project test suite with pytest. :pypi:`pytest-confluence-report` - *last release*: Apr 14, 2022, + *last release*: Apr 17, 2022, *status*: N/A, *requires*: N/A @@ -2230,7 +2233,7 @@ This list contains 1030 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Apr 16, 2022, + *last release*: Apr 17, 2022, *status*: N/A, *requires*: N/A @@ -2979,7 +2982,7 @@ This list contains 1030 plugins. :pypi:`pytest-durations` - *last release*: Mar 07, 2022, + *last release*: Apr 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6) @@ -3707,7 +3710,7 @@ This list contains 1030 plugins. Check if requirement files are frozen :pypi:`pytest-frozen-uuids` - *last release*: Feb 14, 2022, + *last release*: Apr 17, 2022, *status*: N/A, *requires*: pytest (>=3.0) @@ -3973,7 +3976,7 @@ This list contains 1030 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 15, 2022, + *last release*: Apr 21, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4154,6 +4157,13 @@ This list contains 1030 plugins. 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 + :pypi:`pytest-idem` + *last release*: Apr 20, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + A pytest plugin to help with testing idem projects + :pypi:`pytest-idempotent` *last release*: Jan 30, 2022, *status*: N/A, @@ -4288,7 +4298,7 @@ This list contains 1030 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Apr 04, 2022, + *last release*: Apr 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4497,6 +4507,13 @@ This list contains 1030 plugins. python-ldap fixtures for pytest + :pypi:`pytest-leak-finder` + *last release*: Apr 18, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + Find the previous test that makes another to fail + :pypi:`pytest-leaks` *last release*: Nov 27, 2019, *status*: 1 - Planning, @@ -4673,7 +4690,7 @@ This list contains 1030 plugins. Pytest Loguru :pypi:`pytest-lsp` - *last release*: Apr 02, 2022, + *last release*: Apr 18, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4791,6 +4808,13 @@ This list contains 1030 plugins. Estimates memory consumption of test functions + :pypi:`pytest-memray` + *last release*: Apr 19, 2022, + *status*: N/A, + *requires*: N/A + + A simple plugin to use with pytest + :pypi:`pytest-menu` *last release*: Oct 04, 2017, *status*: 3 - Alpha, @@ -5023,7 +5047,7 @@ This list contains 1030 plugins. pytest plugin to collect information from tests :pypi:`pytest-mpl` - *last release*: Feb 09, 2022, + *last release*: Apr 22, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5338,7 +5362,7 @@ This list contains 1030 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Apr 12, 2022, + *last release*: Apr 22, 2022, *status*: N/A, *requires*: pytest @@ -5541,7 +5565,7 @@ This list contains 1030 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Apr 04, 2022, + *last release*: Apr 22, 2022, *status*: N/A, *requires*: N/A @@ -5744,7 +5768,7 @@ This list contains 1030 plugins. Visualize your failed tests with poo :pypi:`pytest-pop` - *last release*: Aug 19, 2021, + *last release*: Apr 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -5779,7 +5803,7 @@ This list contains 1030 plugins. pytest plugin with powerful fixtures :pypi:`pytest-prefer-nested-dup-tests` - *last release*: Apr 16, 2022, + *last release*: Apr 17, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.1,<8.0.0) @@ -6619,7 +6643,7 @@ This list contains 1030 plugins. :pypi:`pytest-sbase` - *last release*: Apr 13, 2022, + *last release*: Apr 22, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6661,7 +6685,7 @@ This list contains 1030 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Apr 13, 2022, + *last release*: Apr 22, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6899,7 +6923,7 @@ This list contains 1030 plugins. py.test plugin for Snap-CI :pypi:`pytest-snapshot` - *last release*: Feb 11, 2022, + *last release*: Apr 23, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.0.0) @@ -7018,7 +7042,7 @@ This list contains 1030 plugins. Pytest plugin for the splinter automation library :pypi:`pytest-split` - *last release*: Mar 13, 2022, + *last release*: Apr 22, 2022, *status*: 4 - Beta, *requires*: pytest (>=5,<8) @@ -7046,7 +7070,7 @@ This list contains 1030 plugins. :pypi:`pytest-splunk-addon` - *last release*: Apr 13, 2022, + *last release*: Apr 19, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7368,7 +7392,7 @@ This list contains 1030 plugins. A py.test plugin providing temporary directories in unit tests. :pypi:`pytest-testdox` - *last release*: Dec 05, 2021, + *last release*: Apr 19, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6.0) @@ -7914,7 +7938,7 @@ This list contains 1030 plugins. Plugin for managing VCR.py cassettes :pypi:`pytest-vcr-delete-on-fail` - *last release*: Aug 13, 2021, + *last release*: Apr 21, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.2,<7.0.0) @@ -7935,7 +7959,7 @@ This list contains 1030 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Aug 30, 2021, + *last release*: Apr 17, 2022, *status*: 2 - Pre-Alpha, *requires*: N/A From f6db7ae74900e0dbf39553ebd531b23c31d07db0 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Mon, 25 Apr 2022 17:18:33 -0700 Subject: [PATCH 053/255] Let mkdir() and mkpydir() receive PathLike names These pytester utility methods were annotated to only receive `str` names, but they naturally support os.PathLike values, as well. This makes writing some pytester calls a little nicer, such as when creating a directory based on a `.joinpath()` call. We previously needed to cast that intermediate value to a `str`. --- src/_pytest/pytester.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 359e2aebd38..4493bdb80dc 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -904,13 +904,13 @@ def syspathinsert( self._monkeypatch.syspath_prepend(str(path)) - def mkdir(self, name: str) -> Path: + def mkdir(self, name: Union[str, "os.PathLike[str]"]) -> Path: """Create a new (sub)directory.""" p = self.path / name p.mkdir() return p - def mkpydir(self, name: str) -> Path: + def mkpydir(self, name: Union[str, "os.PathLike[str]"]) -> Path: """Create a new python package. This creates a (sub)directory with an empty ``__init__.py`` file so it From e580534df00884857798e857beae1130abc74256 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 28 Apr 2022 16:30:16 +0200 Subject: [PATCH 054/255] doc: Reformat/Modernize some code (#9900) Found because I was curious what https://pypi.org/project/shed/ does with pytest. --- doc/en/example/attic.rst | 2 +- doc/en/example/markers.rst | 7 +++--- doc/en/example/parametrize.rst | 1 + doc/en/example/simple.rst | 12 ++++++---- doc/en/how-to/assert.rst | 2 +- doc/en/how-to/cache.rst | 1 - doc/en/how-to/capture-warnings.rst | 1 + doc/en/how-to/doctest.rst | 1 - doc/en/how-to/fixtures.rst | 28 ++++++++++++++---------- doc/en/how-to/logging.rst | 6 +---- doc/en/how-to/skipping.rst | 2 ++ doc/en/how-to/unittest.rst | 5 +++-- doc/en/how-to/usage.rst | 3 ++- doc/en/how-to/writing_hook_functions.rst | 6 ++--- doc/en/how-to/writing_plugins.rst | 2 +- doc/en/how-to/xunit_setup.rst | 2 +- 16 files changed, 45 insertions(+), 36 deletions(-) diff --git a/doc/en/example/attic.rst b/doc/en/example/attic.rst index 2ea87006204..2b1f2766dce 100644 --- a/doc/en/example/attic.rst +++ b/doc/en/example/attic.rst @@ -25,7 +25,7 @@ example: specifying and selecting acceptance tests self.tmpdir = request.config.mktemp(request.function.__name__, numbered=True) def run(self, *cmd): - """ called by test code to execute an acceptance test. """ + """called by test code to execute an acceptance test.""" self.tmpdir.chdir() return subprocess.check_output(cmd).decode() diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 3226c0871e0..2260dbf423b 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -375,7 +375,7 @@ specifies via named environments: envnames = [mark.args[0] for mark in item.iter_markers(name="env")] if envnames: if item.config.getoption("-E") not in envnames: - pytest.skip("test requires env in {!r}".format(envnames)) + pytest.skip(f"test requires env in {envnames!r}") A test file using this local plugin: @@ -528,7 +528,7 @@ test function. From a conftest file we can read it like this: def pytest_runtest_setup(item): for mark in item.iter_markers(name="glob"): - print("glob args={} kwargs={}".format(mark.args, mark.kwargs)) + print(f"glob args={mark.args} kwargs={mark.kwargs}") sys.stdout.flush() Let's run this without capturing output and see what we get: @@ -558,6 +558,7 @@ for your particular platform, you could use the following plugin: # content of conftest.py # import sys + import pytest ALL = set("darwin linux win32".split()) @@ -567,7 +568,7 @@ for your particular platform, you could use the following plugin: supported_platforms = ALL.intersection(mark.name for mark in item.iter_markers()) plat = sys.platform if supported_platforms and plat not in supported_platforms: - pytest.skip("cannot run on platform {}".format(plat)) + pytest.skip(f"cannot run on platform {plat}") then tests will be skipped if they were specified for a different platform. Let's do a little test file to show how this looks like: diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 66d72f3cc0d..24dd5ecaa38 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -663,6 +663,7 @@ as a complement to ``raises``. For example: .. code-block:: python from contextlib import contextmanager + import pytest diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index a70f3404992..ba1acdfd164 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -342,7 +342,7 @@ Example: def checkconfig(x): __tracebackhide__ = True if not hasattr(x, "config"): - pytest.fail("not configured: {}".format(x)) + pytest.fail(f"not configured: {x}") def test_something(): @@ -376,6 +376,7 @@ this to make sure unexpected exception types aren't hidden: .. code-block:: python import operator + import pytest @@ -386,7 +387,7 @@ this to make sure unexpected exception types aren't hidden: def checkconfig(x): __tracebackhide__ = operator.methodcaller("errisinstance", ConfigException) if not hasattr(x, "config"): - raise ConfigException("not configured: {}".format(x)) + raise ConfigException(f"not configured: {x}") def test_something(): @@ -565,6 +566,7 @@ an ``incremental`` marker which is to be used on classes: # content of conftest.py from typing import Dict, Tuple + import pytest # store history of failures per test class name and per index in parametrize (if parametrize used) @@ -608,7 +610,7 @@ an ``incremental`` marker which is to be used on classes: test_name = _test_failed_incremental[cls_name].get(parametrize_index, None) # if name found, test has failed for the combination of class name & test name if test_name is not None: - pytest.xfail("previous test failed ({})".format(test_name)) + pytest.xfail(f"previous test failed ({test_name})") These two hook implementations work together to abort incremental-marked @@ -802,9 +804,10 @@ case we just write some information out to a ``failures`` file: # content of conftest.py - import pytest import os.path + import pytest + @pytest.hookimpl(tryfirst=True, hookwrapper=True) def pytest_runtest_makereport(item, call): @@ -1066,6 +1069,7 @@ like ``pytest-timeout`` they must be imported explicitly and passed on to pytest # contents of app_main.py import sys + import pytest_timeout # Third party plugin if len(sys.argv) > 1 and sys.argv[1] == "--pytest": diff --git a/doc/en/how-to/assert.rst b/doc/en/how-to/assert.rst index 65f16129142..1b10c131389 100644 --- a/doc/en/how-to/assert.rst +++ b/doc/en/how-to/assert.rst @@ -238,7 +238,7 @@ file which provides an alternative explanation for ``Foo`` objects: if isinstance(left, Foo) and isinstance(right, Foo) and op == "==": return [ "Comparing Foo instances:", - " vals: {} != {}".format(left.val, right.val), + f" vals: {left.val} != {right.val}", ] now, given this test module: diff --git a/doc/en/how-to/cache.rst b/doc/en/how-to/cache.rst index e7994645dd3..529d97d53fb 100644 --- a/doc/en/how-to/cache.rst +++ b/doc/en/how-to/cache.rst @@ -199,7 +199,6 @@ across pytest invocations: # content of test_caching.py import pytest - import time def expensive_computation(): diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 4a27767e528..ad5c1f3c3df 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -253,6 +253,7 @@ which works in a similar manner to :ref:`raises `: .. code-block:: python import warnings + import pytest diff --git a/doc/en/how-to/doctest.rst b/doc/en/how-to/doctest.rst index ce0b5a5f649..112c9305e27 100644 --- a/doc/en/how-to/doctest.rst +++ b/doc/en/how-to/doctest.rst @@ -239,7 +239,6 @@ which can then be used in your doctests directly: >>> len(a) 10 """ - pass Note that like the normal ``conftest.py``, the fixtures are discovered in the directory tree conftest is in. Meaning that if you put your doctest with your source code, the relevant conftest.py needs to be in the same directory tree. diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 08013877455..14bf12cf982 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -398,9 +398,10 @@ access the fixture function: .. code-block:: python # content of conftest.py - import pytest import smtplib + import pytest + @pytest.fixture(scope="module") def smtp_connection(): @@ -609,10 +610,10 @@ Here's what that might look like: .. code-block:: python # content of test_emaillib.py - import pytest - from emaillib import Email, MailAdminClient + import pytest + @pytest.fixture def mail_admin(): @@ -683,10 +684,10 @@ Here's how the previous example would look using the ``addfinalizer`` method: .. code-block:: python # content of test_emaillib.py - import pytest - from emaillib import Email, MailAdminClient + import pytest + @pytest.fixture def mail_admin(): @@ -752,10 +753,10 @@ above): .. code-block:: python # content of test_emaillib.py - import pytest - from emaillib import Email, MailAdminClient + import pytest + @pytest.fixture def setup(): @@ -1030,16 +1031,17 @@ read an optional server URL from the test module which uses our fixture: .. code-block:: python # content of conftest.py - import pytest import smtplib + import pytest + @pytest.fixture(scope="module") def smtp_connection(request): server = getattr(request.module, "smtpserver", "smtp.gmail.com") smtp_connection = smtplib.SMTP(server, 587, timeout=5) yield smtp_connection - print("finalizing {} ({})".format(smtp_connection, server)) + print(f"finalizing {smtp_connection} ({server})") smtp_connection.close() We use the ``request.module`` attribute to optionally obtain an @@ -1193,15 +1195,16 @@ through the special :py:class:`request ` object: .. code-block:: python # content of conftest.py - import pytest import smtplib + import pytest + @pytest.fixture(scope="module", params=["smtp.gmail.com", "mail.python.org"]) def smtp_connection(request): smtp_connection = smtplib.SMTP(request.param, 587, timeout=5) yield smtp_connection - print("finalizing {}".format(smtp_connection)) + print(f"finalizing {smtp_connection}") smtp_connection.close() The main change is the declaration of ``params`` with @@ -1503,7 +1506,7 @@ to show the setup/teardown flow: def test_2(otherarg, modarg): - print(" RUN test2 with otherarg {} and modarg {}".format(otherarg, modarg)) + print(f" RUN test2 with otherarg {otherarg} and modarg {modarg}") Let's run the tests in verbose mode and with looking at the print-output: @@ -1604,6 +1607,7 @@ and declare its use in a test module via a ``usefixtures`` marker: # content of test_setenv.py import os + import pytest diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index 5a089c2fba0..87cebb8f20e 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -73,7 +73,6 @@ messages. This is supported by the ``caplog`` fixture: def test_foo(caplog): caplog.set_level(logging.INFO) - pass By default the level is set on the root logger, however as a convenience it is also possible to set the log level of any @@ -83,7 +82,6 @@ logger: def test_foo(caplog): caplog.set_level(logging.CRITICAL, logger="root.baz") - pass The log levels set are restored automatically at the end of the test. @@ -161,9 +159,7 @@ the records for the ``setup`` and ``call`` stages during teardown like so: x.message for x in caplog.get_records(when) if x.levelno == logging.WARNING ] if messages: - pytest.fail( - "warning messages encountered during testing: {}".format(messages) - ) + pytest.fail(f"warning messages encountered during testing: {messages}") diff --git a/doc/en/how-to/skipping.rst b/doc/en/how-to/skipping.rst index b1274dd4cb5..1fc6f5e0889 100644 --- a/doc/en/how-to/skipping.rst +++ b/doc/en/how-to/skipping.rst @@ -69,6 +69,7 @@ It is also possible to skip the whole module using .. code-block:: python import sys + import pytest if not sys.platform.startswith("win"): @@ -409,6 +410,7 @@ test instances when using parametrize: .. code-block:: python import sys + import pytest diff --git a/doc/en/how-to/unittest.rst b/doc/en/how-to/unittest.rst index bff75110778..b6393707160 100644 --- a/doc/en/how-to/unittest.rst +++ b/doc/en/how-to/unittest.rst @@ -115,6 +115,7 @@ fixture definition: # content of test_unittest_db.py import unittest + import pytest @@ -194,10 +195,10 @@ creation of a per-test temporary directory: .. code-block:: python # content of test_unittest_cleandir.py - import os - import pytest import unittest + import pytest + class MyTest(unittest.TestCase): @pytest.fixture(autouse=True) diff --git a/doc/en/how-to/usage.rst b/doc/en/how-to/usage.rst index 3522b258dce..c56bef4a6f5 100644 --- a/doc/en/how-to/usage.rst +++ b/doc/en/how-to/usage.rst @@ -183,9 +183,10 @@ You can specify additional plugins to ``pytest.main``: .. code-block:: python # content of myinvoke.py - import pytest import sys + import pytest + class MyPlugin: def pytest_sessionfinish(self): diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index f615fced861..da2961c9708 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -194,7 +194,7 @@ class or module can then be passed to the ``pluginmanager`` using the ``pytest_a .. code-block:: python def pytest_addhooks(pluginmanager): - """ This example assumes the hooks are grouped in the 'sample_hook' module. """ + """This example assumes the hooks are grouped in the 'sample_hook' module.""" from my_app.tests import sample_hook pluginmanager.add_hookspecs(sample_hook) @@ -253,14 +253,14 @@ and use pytest_addoption as follows: # default value @hookspec(firstresult=True) def pytest_config_file_default_value(): - """ Return the default value for the config file command line option. """ + """Return the default value for the config file command line option.""" # contents of myplugin.py def pytest_addhooks(pluginmanager): - """ This example assumes the hooks are grouped in the 'hooks' module. """ + """This example assumes the hooks are grouped in the 'hooks' module.""" from . import hooks pluginmanager.add_hookspecs(hooks) diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index b2d2b6563d6..3e43d3252b7 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -367,7 +367,7 @@ string value of ``Hello World!`` if we do not supply a value or ``Hello def _hello(name=None): if not name: name = request.config.getoption("name") - return "Hello {name}!".format(name=name) + return f"Hello {name}!" return _hello diff --git a/doc/en/how-to/xunit_setup.rst b/doc/en/how-to/xunit_setup.rst index 5a97b2c85f1..eb432a4053d 100644 --- a/doc/en/how-to/xunit_setup.rst +++ b/doc/en/how-to/xunit_setup.rst @@ -32,7 +32,7 @@ which will usually be called once for all the functions: .. code-block:: python def setup_module(module): - """ setup any state specific to the execution of the given module.""" + """setup any state specific to the execution of the given module.""" def teardown_module(module): From 97383d2d5d666e4d84dea3dbc0dff4a53fe071a2 Mon Sep 17 00:00:00 2001 From: johnkangw <72617548+johnkangw@users.noreply.github.com> Date: Sat, 30 Apr 2022 17:20:31 -0600 Subject: [PATCH 055/255] Mention use of re_assert for strings in approx docs --- src/_pytest/python_api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 5fa21961924..622e5cefdd0 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -666,6 +666,11 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: specialised test helpers in :std:doc:`numpy:reference/routines.testing` if you need support for comparisons, NaNs, or ULP-based tolerances. + To match strings using regex, you can use + `Matches `_ + from the + `re_assert package `_. + .. warning:: .. versionchanged:: 3.2 From 3444d35c540c635401f92db724d004e2a7d20920 Mon Sep 17 00:00:00 2001 From: Babak Keyvani Date: Sat, 30 Apr 2022 17:56:36 -0600 Subject: [PATCH 056/255] improve `pytest.raises` --- AUTHORS | 1 + changelog/8646.improvments.rst | 2 ++ src/_pytest/python_api.py | 7 +++++++ testing/python/raises.py | 4 ++++ 4 files changed, 14 insertions(+) create mode 100644 changelog/8646.improvments.rst diff --git a/AUTHORS b/AUTHORS index 1a8c5306f75..86a814a137b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -44,6 +44,7 @@ Aron Coyle Aron Curzon Aviral Verma Aviv Palivoda +Babak Keyvani Barney Gale Ben Gartner Ben Webb diff --git a/changelog/8646.improvments.rst b/changelog/8646.improvments.rst new file mode 100644 index 00000000000..9691c143429 --- /dev/null +++ b/changelog/8646.improvments.rst @@ -0,0 +1,2 @@ +Improve :py:func:`pytest.raises`. Previously passing an empty tuple would give a confusing +error. We now raise immediately with a more helpful message. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 5fa21961924..410877c88eb 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -899,6 +899,13 @@ def raises( """ __tracebackhide__ = True + if expected_exception == (): + raise ValueError( + "Passing expected_exception=() is an error, because it's impossible to " + "raise an exception which is not an instance of any type. Raising exceptions " + "is already understood as failing the test, so you don't need any special " + "code to say 'this should never raise an exception'." + ) if isinstance(expected_exception, type): excepted_exceptions: Tuple[Type[E], ...] = (expected_exception,) else: diff --git a/testing/python/raises.py b/testing/python/raises.py index 112dec06cdc..e1680623aee 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -19,6 +19,10 @@ def test_raises_function(self): excinfo = pytest.raises(ValueError, int, "hello") assert "invalid literal" in str(excinfo.value) + def test_raises_does_not_allow_empty_tuple(self): + with pytest.raises(ValueError): + pytest.raises(expected_exception=()) + def test_raises_callable_no_exception(self) -> None: class A: def __call__(self): From 306b33e7550ce8db4e260d35f57b38387ebb0c37 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 1 May 2022 00:24:20 +0000 Subject: [PATCH 057/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 154 ++++++++++++++++++++----------- 1 file changed, 101 insertions(+), 53 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index bbddba7db58..e78bf13b0e3 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1033 plugins. +This list contains 1039 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1033 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 04, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 26, 2022 N/A pytest (>=5.4.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) @@ -53,7 +53,7 @@ This list contains 1033 plugins. :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' - :pypi:`pytest-api` PyTest-API Python Web Framework built for testing purposes. May 04, 2021 N/A N/A + :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions Apr 28, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :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 @@ -62,7 +62,7 @@ This list contains 1033 plugins. :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 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) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A - :pypi:`pytest-assertions` Pytest Assertions Apr 22, 2022 N/A N/A + :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A :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-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) @@ -308,14 +308,14 @@ This list contains 1033 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Apr 15, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Apr 15, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Apr 15, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Apr 15, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Apr 25, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Apr 25, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Apr 15, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Apr 25, 2022 N/A N/A :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 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -354,7 +354,7 @@ This list contains 1033 plugins. :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) - :pypi:`pytest-fail-slow` Fail tests that take too long to run Dec 10, 2021 4 - Beta pytest (>=6.0) + :pypi:`pytest-fail-slow` Fail tests that take too long to run Apr 25, 2022 4 - Beta pytest (>=6.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-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A @@ -388,7 +388,7 @@ This list contains 1033 plugins. :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :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. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 04, 2019 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :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 @@ -409,7 +409,7 @@ This list contains 1033 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. Apr 13, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 27, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -435,7 +435,7 @@ This list contains 1033 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Apr 21, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 25, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -470,9 +470,10 @@ This list contains 1033 plugins. :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :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 Sep 30, 2021 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Mar 30, 2022 5 - Production/Stable N/A + :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Apr 26, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) @@ -500,6 +501,7 @@ This list contains 1033 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-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest + :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A @@ -632,6 +634,7 @@ This list contains 1033 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Apr 28, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators Apr 22, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A @@ -641,6 +644,7 @@ This list contains 1033 plugins. :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A + :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) @@ -680,6 +684,7 @@ This list contains 1033 plugins. :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Mar 16, 2022 N/A pytest :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-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 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 Mar 19, 2020 5 - Production/Stable pytest (>=3.50) @@ -696,7 +701,7 @@ This list contains 1033 plugins. :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 17, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) + :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-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) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -718,7 +723,7 @@ This list contains 1033 plugins. :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) :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 Jan 27, 2022 N/A pytest (>=6.2.5,<7.0.0) + :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 15, 2021 5 - Production/Stable pytest :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -777,7 +782,7 @@ This list contains 1033 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :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 Apr 12, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Apr 26, 2022 N/A pytest (>=3.8.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-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) @@ -816,14 +821,14 @@ This list contains 1033 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 22, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 25, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 22, 2022 5 - Production/Stable N/A - :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 25, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest @@ -848,7 +853,7 @@ This list contains 1033 plugins. :pypi:`pytest-skip-markers` Pytest Salt Plugin Feb 22, 2022 5 - Production/Stable pytest (>=6.0.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) - :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A + :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A N/A :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) @@ -937,6 +942,7 @@ This list contains 1033 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Apr 29, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -979,9 +985,9 @@ This list contains 1033 plugins. :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 13, 2022 N/A pytest (>=5.0.0) + :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) for Pytest, automatically launched after your test run is finished Apr 14, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Apr 29, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1064,7 +1070,7 @@ This list contains 1033 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Apr 04, 2022, + *last release*: Apr 26, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1302,11 +1308,11 @@ This list contains 1033 plugins. Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures :pypi:`pytest-api` - *last release*: May 04, 2021, + *last release*: Apr 28, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest (>=7.1.1,<8.0.0) - PyTest-API Python Web Framework built for testing purposes. + An ASGI middleware to populate OpenAPI Specification examples from pytest functions :pypi:`pytest-apistellar` *last release*: Jun 18, 2019, @@ -1365,7 +1371,7 @@ This list contains 1033 plugins. test Answer Set Programming programs :pypi:`pytest-assertions` - *last release*: Apr 22, 2022, + *last release*: Apr 27, 2022, *status*: N/A, *requires*: N/A @@ -3087,35 +3093,35 @@ This list contains 1033 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A @@ -3129,14 +3135,14 @@ This list contains 1033 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A @@ -3409,7 +3415,7 @@ This list contains 1033 plugins. A pytest plugin that helps better distinguishing real test failures from setup flakiness. :pypi:`pytest-fail-slow` - *last release*: Dec 10, 2021, + *last release*: Apr 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0) @@ -3647,7 +3653,7 @@ This list contains 1033 plugins. A set of py.test fixtures to test Flask applications. :pypi:`pytest-flask-sqlalchemy` - *last release*: Apr 04, 2019, + *last release*: Apr 30, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.2.1) @@ -3794,7 +3800,7 @@ This list contains 1033 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Apr 13, 2022, + *last release*: Apr 27, 2022, *status*: N/A, *requires*: N/A @@ -3976,7 +3982,7 @@ This list contains 1033 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 21, 2022, + *last release*: Apr 25, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4221,14 +4227,14 @@ This list contains 1033 plugins. pytest stack validation prior to testing executing :pypi:`pytest-ini` - *last release*: Sep 30, 2021, + *last release*: Apr 26, 2022, *status*: N/A, *requires*: N/A Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: Mar 30, 2022, + *last release*: Apr 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4241,6 +4247,13 @@ This list contains 1033 plugins. Inmanta tests package + :pypi:`pytest-inmanta-lsm` + *last release*: Apr 29, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + Common fixtures for inmanta LSM related modules + :pypi:`pytest-Inomaly` *last release*: Feb 13, 2018, *status*: 4 - Beta, @@ -4430,6 +4443,13 @@ This list contains 1033 plugins. A plugin to send pytest events to Kafka + :pypi:`pytest-kexi` + *last release*: Apr 29, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + + :pypi:`pytest-kind` *last release*: Jan 24, 2021, *status*: 5 - Production/Stable, @@ -5354,6 +5374,13 @@ This list contains 1033 plugins. Pytest plugin for detecting inadvertent open file handles + :pypi:`pytest-opentelemetry` + *last release*: Apr 28, 2022, + *status*: N/A, + *requires*: pytest + + A pytest plugin for instrumenting test runs via OpenTelemetry + :pypi:`pytest-opentmi` *last release*: Feb 28, 2022, *status*: 5 - Production/Stable, @@ -5417,6 +5444,13 @@ This list contains 1033 plugins. pytest-otel report OpenTelemetry traces about test executed + :pypi:`pytest-owner` + *last release*: Apr 25, 2022, + *status*: N/A, + *requires*: N/A + + Add owner mark for tests + :pypi:`pytest-pact` *last release*: Jan 07, 2019, *status*: 4 - Beta, @@ -5690,6 +5724,13 @@ This list contains 1033 plugins. A pytest wrapper for snapshot testing with playwright + :pypi:`pytest-playwright-visual` + *last release*: Apr 28, 2022, + *status*: N/A, + *requires*: N/A + + A pytest fixture for visual testing with Playwright + :pypi:`pytest-plt` *last release*: Aug 17, 2020, *status*: 5 - Production/Stable, @@ -5803,7 +5844,7 @@ This list contains 1033 plugins. pytest plugin with powerful fixtures :pypi:`pytest-prefer-nested-dup-tests` - *last release*: Apr 17, 2022, + *last release*: Apr 27, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.1,<8.0.0) @@ -5957,7 +5998,7 @@ This list contains 1033 plugins. Core engine for cookiecutter-qa and pytest-play packages :pypi:`pytest-pyppeteer` - *last release*: Jan 27, 2022, + *last release*: Apr 28, 2022, *status*: N/A, *requires*: pytest (>=6.2.5,<7.0.0) @@ -6370,7 +6411,7 @@ This list contains 1033 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Apr 12, 2022, + *last release*: Apr 26, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -6643,7 +6684,7 @@ This list contains 1033 plugins. :pypi:`pytest-sbase` - *last release*: Apr 22, 2022, + *last release*: Apr 25, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6685,14 +6726,14 @@ This list contains 1033 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Apr 22, 2022, + *last release*: Apr 25, 2022, *status*: 5 - Production/Stable, *requires*: N/A A complete web automation framework for end-to-end testing. :pypi:`pytest-selenium-enhancer` - *last release*: Dec 16, 2021, + *last release*: Apr 29, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6867,7 +6908,7 @@ This list contains 1033 plugins. Automatically skip tests that don't need to run! :pypi:`pytest-skip-slow` - *last release*: Sep 28, 2021, + *last release*: Apr 26, 2022, *status*: N/A, *requires*: N/A @@ -7489,6 +7530,13 @@ This list contains 1033 plugins. pytest plugin for creating TestRail runs and adding results + :pypi:`pytest-testrail-integrator` + *last release*: Apr 29, 2022, + *status*: N/A, + *requires*: pytest (>=6.2.5) + + Pytest plugin for sending report to testrail system. + :pypi:`pytest-testrail-ns` *last release*: Oct 08, 2021, *status*: N/A, @@ -7784,7 +7832,7 @@ This list contains 1033 plugins. A simple plugin to use with tspwplib :pypi:`pytest-tst` - *last release*: Mar 13, 2022, + *last release*: Apr 27, 2022, *status*: N/A, *requires*: pytest (>=5.0.0) @@ -7798,7 +7846,7 @@ This list contains 1033 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Apr 14, 2022, + *last release*: Apr 29, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) From 2ba8fd5bc50f293fea11a863c2b8c4dc3488762b Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 1 May 2022 01:05:41 -0600 Subject: [PATCH 058/255] Re-export importlib.metadata from _pytest.compat (#9906) I'm fixing a bug in mypy's --no-implicit-reexport logic in https://github.com/python/mypy/pull/12704 and mypy-primer flagged this --- changelog/9906.trivial.rst | 1 + src/_pytest/compat.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog/9906.trivial.rst diff --git a/changelog/9906.trivial.rst b/changelog/9906.trivial.rst new file mode 100644 index 00000000000..8911b7190f6 --- /dev/null +++ b/changelog/9906.trivial.rst @@ -0,0 +1 @@ +Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers. diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index e4c2a5fdac1..8b77de28f10 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -50,9 +50,11 @@ class NotSetType(enum.Enum): # fmt: on if sys.version_info >= (3, 8): - from importlib import metadata as importlib_metadata + import importlib.metadata + + importlib_metadata = importlib.metadata else: - import importlib_metadata # noqa: F401 + import importlib_metadata as importlib_metadata # noqa: F401 def _format_args(func: Callable[..., Any]) -> str: From f25b9f619b7e7198a67e5bcc996fccf37377930c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 20:47:02 +0000 Subject: [PATCH 059/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.0.1 → v3.1.0](https://github.com/asottile/reorder_python_imports/compare/v3.0.1...v3.1.0) - [github.com/pre-commit/mirrors-mypy: v0.942 → v0.950](https://github.com/pre-commit/mirrors-mypy/compare/v0.942...v0.950) --- .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 c0fd36df3fd..30fa24ae03b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.0.1 + rev: v3.1.0 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.942 + rev: v0.950 hooks: - id: mypy files: ^(src/|testing/) From 2f62e6ec9625b86c7bc79047f92ad43a1ef8f401 Mon Sep 17 00:00:00 2001 From: Peyman Salehi Date: Tue, 3 May 2022 20:56:46 +0430 Subject: [PATCH 060/255] Fix default encoding in cacheprovider --- changelog/9910.trivial.rst | 1 + src/_pytest/cacheprovider.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog/9910.trivial.rst diff --git a/changelog/9910.trivial.rst b/changelog/9910.trivial.rst new file mode 100644 index 00000000000..4b1a4683c1e --- /dev/null +++ b/changelog/9910.trivial.rst @@ -0,0 +1 @@ +Fix default encoding warning (``EncodingWarning``) in ``cacheprovider`` diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index 681d02b4093..4dad599d0e3 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -157,7 +157,7 @@ def get(self, key: str, default): """ path = self._getvaluepath(key) try: - with path.open("r") as f: + with path.open("r", encoding="UTF-8") as f: return json.load(f) except (ValueError, OSError): return default @@ -184,9 +184,9 @@ def set(self, key: str, value: object) -> None: return if not cache_dir_exists_already: self._ensure_supporting_files() - data = json.dumps(value, indent=2) + data = json.dumps(value, ensure_ascii=False, indent=2) try: - f = path.open("w") + f = path.open("w", encoding="UTF-8") except OSError: self.warn("cache could not write path {path}", path=path, _ispytest=True) else: @@ -196,7 +196,7 @@ def set(self, key: str, value: object) -> None: def _ensure_supporting_files(self) -> None: """Create supporting files in the cache dir that are not really part of the cache.""" readme_path = self._cachedir / "README.md" - readme_path.write_text(README_CONTENT) + readme_path.write_text(README_CONTENT, encoding="UTF-8") gitignore_path = self._cachedir.joinpath(".gitignore") msg = "# Created by pytest automatically.\n*\n" From 5f9d68c8d93b792116fc474cb4ec3072b7baa6f1 Mon Sep 17 00:00:00 2001 From: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> Date: Fri, 6 May 2022 19:25:44 -0400 Subject: [PATCH 061/255] Clarify precision when using NUMBER option in --doctest-modules (#9914) Fix #9892 --- doc/en/how-to/doctest.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/en/how-to/doctest.rst b/doc/en/how-to/doctest.rst index 112c9305e27..021ba274fbc 100644 --- a/doc/en/how-to/doctest.rst +++ b/doc/en/how-to/doctest.rst @@ -126,14 +126,17 @@ pytest also introduces new options: in expected doctest output. * ``NUMBER``: when enabled, floating-point numbers only need to match as far as - the precision you have written in the expected doctest output. For example, - the following output would only need to match to 2 decimal places:: + the precision you have written in the expected doctest output. The numbers are + compared using :func:`pytest.approx` with relative tolerance equal to the + precision. For example, the following output would only need to match to 2 + decimal places when comparing ``3.14`` to + ``pytest.approx(math.pi, rel=10**-2)``:: >>> math.pi 3.14 - If you wrote ``3.1416`` then the actual output would need to match to 4 - decimal places; and so on. + If you wrote ``3.1416`` then the actual output would need to match to + approximately 4 decimal places; and so on. This avoids false positives caused by limited floating-point precision, like this:: From 23c8f3d2346a70b3f1946949e0979c49e20a06df Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 8 May 2022 00:18:36 +0000 Subject: [PATCH 062/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 160 ++++++++++++++++++------------- 1 file changed, 96 insertions(+), 64 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index e78bf13b0e3..2bdd41d975a 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1039 plugins. +This list contains 1043 plugins. .. only:: not latex @@ -53,7 +53,7 @@ This list contains 1039 plugins. :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' - :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions Apr 28, 2022 N/A pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 07, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :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 @@ -71,7 +71,7 @@ This list contains 1039 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 14, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. May 02, 2022 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) @@ -126,14 +126,14 @@ This list contains 1039 plugins. :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data May 02, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest :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-caprng` A plugin that replays pRNG state on failure. May 02, 2018 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-warnings` pytest plugin to capture all warnings and put them in one file of your choice Mar 16, 2022 N/A pytest + :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-cases` Separate test code from test cases in pytest. Mar 21, 2022 5 - Production/Stable N/A :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) @@ -186,7 +186,7 @@ This list contains 1039 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Apr 17, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types May 06, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -200,6 +200,7 @@ This list contains 1039 plugins. :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-cython-collect` May 04, 2022 N/A pytest :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A @@ -209,7 +210,7 @@ This list contains 1039 plugins. :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-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A - :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. Oct 07, 2018 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 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-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A @@ -247,6 +248,7 @@ This list contains 1039 plugins. :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-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A + :pypi:`pytest-django-filefield` Replaces FileField.storage with something you can patch globally. May 06, 2022 5 - Production/Stable pytest >= 5.2 :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A @@ -308,14 +310,14 @@ This list contains 1039 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Apr 25, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Apr 25, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Apr 25, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Apr 25, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin May 07, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 07, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 07, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 07, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 07, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Apr 25, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 07, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 07, 2022 N/A N/A :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 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -349,7 +351,7 @@ This list contains 1039 plugins. :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-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. Dec 30, 2020 6 - Mature pytest (>=4.6) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 02, 2022 6 - Mature pytest (>=5.0.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-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A @@ -409,7 +411,7 @@ This list contains 1039 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. Apr 27, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 04, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -435,7 +437,7 @@ This list contains 1039 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 Apr 25, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 07, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -461,7 +463,7 @@ This list contains 1039 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :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 Apr 20, 2022 5 - Production/Stable N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects May 04, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest @@ -482,7 +484,7 @@ This list contains 1039 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :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-invenio` Pytest fixtures for Invenio. Apr 22, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. May 05, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -527,7 +529,7 @@ This list contains 1039 plugins. :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest - :pypi:`pytest-localserver` py.test plugin to test server connections locally. Dec 13, 2021 4 - Beta N/A + :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 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 Oct 29, 2021 N/A pytest (>=5.4) @@ -559,7 +561,7 @@ This list contains 1039 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Apr 19, 2022 N/A N/A :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-message` Pytest plugin for sending report message of marked tests execution Jan 05, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest @@ -634,9 +636,9 @@ This list contains 1039 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Apr 28, 2022 N/A pytest + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Apr 22, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators May 04, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -709,7 +711,7 @@ This list contains 1039 plugins. :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A :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 Feb 23, 2022 5 - Production/Stable pytest + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip May 05, 2022 5 - Production/Stable pytest :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) @@ -743,7 +745,7 @@ This list contains 1039 plugins. :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A - :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) + :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A @@ -807,7 +809,7 @@ This list contains 1039 plugins. :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) :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest - :pypi:`pytest-rt` pytest data collector plugin for Testgr Dec 22, 2021 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-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 @@ -821,13 +823,13 @@ This list contains 1039 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 25, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 02, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 25, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 02, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -858,6 +860,7 @@ This list contains 1039 plugins. :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :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-smell` Automated bad smell detection tool for Pytest May 02, 2022 N/A N/A :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A @@ -942,11 +945,12 @@ This list contains 1039 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Apr 29, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 05, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) @@ -987,7 +991,7 @@ This list contains 1039 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :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) for Pytest, automatically launched after your test run is finished Apr 29, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished May 02, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1043,7 +1047,7 @@ This list contains 1039 plugins. :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jul 28, 2021 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) - :pypi:`pytest-xray-server` Oct 27, 2021 3 - Alpha pytest (>=5.3.1) + :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) :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-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) @@ -1056,7 +1060,7 @@ This list contains 1039 plugins. :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest + :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ .. only:: latex @@ -1308,7 +1312,7 @@ This list contains 1039 plugins. Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures :pypi:`pytest-api` - *last release*: Apr 28, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: pytest (>=7.1.1,<8.0.0) @@ -1434,7 +1438,7 @@ This list contains 1039 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Apr 14, 2022, + *last release*: May 02, 2022, *status*: N/A, *requires*: N/A @@ -1819,7 +1823,7 @@ This list contains 1039 plugins. pytest plugin with mechanisms for caching across test runs :pypi:`pytest-cache-assert` - *last release*: Mar 03, 2022, + *last release*: May 02, 2022, *status*: 4 - Beta, *requires*: pytest (>=5.0.0) @@ -1868,7 +1872,7 @@ This list contains 1039 plugins. pytest plugin to capture all deprecatedwarnings and put them in one file :pypi:`pytest-capture-warnings` - *last release*: Mar 16, 2022, + *last release*: May 03, 2022, *status*: N/A, *requires*: pytest @@ -2239,7 +2243,7 @@ This list contains 1039 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Apr 17, 2022, + *last release*: May 06, 2022, *status*: N/A, *requires*: N/A @@ -2336,6 +2340,13 @@ This list contains 1039 plugins. A plugin for testing Cython extension modules + :pypi:`pytest-cython-collect` + *last release*: May 04, 2022, + *status*: N/A, + *requires*: pytest + + + :pypi:`pytest-darker` *last release*: Aug 16, 2020, *status*: N/A, @@ -2400,7 +2411,7 @@ This list contains 1039 plugins. Fixture "data" and "case_data" for test from yaml file :pypi:`pytest-datafiles` - *last release*: Oct 07, 2018, + *last release*: May 01, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.6) @@ -2665,6 +2676,13 @@ This list contains 1039 plugins. Factories for your Django models that can be used as Pytest fixtures. + :pypi:`pytest-django-filefield` + *last release*: May 06, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest >= 5.2 + + Replaces FileField.storage with something you can patch globally. + :pypi:`pytest-django-gcir` *last release*: Mar 06, 2018, *status*: 5 - Production/Stable, @@ -3093,35 +3111,35 @@ This list contains 1039 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A @@ -3135,14 +3153,14 @@ This list contains 1039 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A @@ -3380,9 +3398,9 @@ This list contains 1039 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: Dec 30, 2020, + *last release*: May 02, 2022, *status*: 6 - Mature, - *requires*: pytest (>=4.6) + *requires*: pytest (>=5.0.0) Factory Boy support for pytest. @@ -3800,7 +3818,7 @@ This list contains 1039 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Apr 27, 2022, + *last release*: May 04, 2022, *status*: N/A, *requires*: N/A @@ -3982,7 +4000,7 @@ This list contains 1039 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4164,7 +4182,7 @@ This list contains 1039 plugins. 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 :pypi:`pytest-idem` - *last release*: Apr 20, 2022, + *last release*: May 04, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4311,7 +4329,7 @@ This list contains 1039 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Apr 22, 2022, + *last release*: May 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4626,7 +4644,7 @@ This list contains 1039 plugins. A PyTest plugin which provides an FTP fixture for your tests :pypi:`pytest-localserver` - *last release*: Dec 13, 2021, + *last release*: May 05, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4850,7 +4868,7 @@ This list contains 1039 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-message` - *last release*: Jan 05, 2022, + *last release*: May 03, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -5375,7 +5393,7 @@ This list contains 1039 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentelemetry` - *last release*: Apr 28, 2022, + *last release*: May 03, 2022, *status*: N/A, *requires*: pytest @@ -5389,7 +5407,7 @@ This list contains 1039 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Apr 22, 2022, + *last release*: May 04, 2022, *status*: N/A, *requires*: pytest @@ -5900,7 +5918,7 @@ This list contains 1039 plugins. Report test pass / failures to a Prometheus PushGateway :pypi:`pytest-prometheus-pushgateway` - *last release*: Feb 23, 2022, + *last release*: May 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6138,7 +6156,7 @@ This list contains 1039 plugins. pytest plugin to implement PEP712 :pypi:`pytest-rail` - *last release*: Feb 04, 2022, + *last release*: May 02, 2022, *status*: N/A, *requires*: pytest (>=3.6) @@ -6586,7 +6604,7 @@ This list contains 1039 plugins. Test code from RST documents with pytest :pypi:`pytest-rt` - *last release*: Dec 22, 2021, + *last release*: May 05, 2022, *status*: N/A, *requires*: N/A @@ -6684,7 +6702,7 @@ This list contains 1039 plugins. :pypi:`pytest-sbase` - *last release*: Apr 25, 2022, + *last release*: May 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6726,7 +6744,7 @@ This list contains 1039 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Apr 25, 2022, + *last release*: May 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6942,6 +6960,13 @@ This list contains 1039 plugins. Smart coverage plugin for pytest. + :pypi:`pytest-smell` + *last release*: May 02, 2022, + *status*: N/A, + *requires*: N/A + + Automated bad smell detection tool for Pytest + :pypi:`pytest-smtp` *last release*: Feb 20, 2021, *status*: N/A, @@ -7531,7 +7556,7 @@ This list contains 1039 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: Apr 29, 2022, + *last release*: May 05, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -7565,6 +7590,13 @@ This list contains 1039 plugins. + :pypi:`pytest-testreport-new` + *last release*: May 05, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + + :pypi:`pytest-testslide` *last release*: Jan 07, 2021, *status*: 5 - Production/Stable, @@ -7846,7 +7878,7 @@ This list contains 1039 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Apr 29, 2022, + *last release*: May 02, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) @@ -8238,7 +8270,7 @@ This list contains 1039 plugins. :pypi:`pytest-xray-server` - *last release*: Oct 27, 2021, + *last release*: May 03, 2022, *status*: 3 - Alpha, *requires*: pytest (>=5.3.1) @@ -8329,7 +8361,7 @@ This list contains 1039 plugins. Extend py.test for RPC OpenStack testing. :pypi:`pytest-zulip` - *last release*: Mar 04, 2022, + *last release*: May 07, 2022, *status*: 5 - Production/Stable, *requires*: pytest From 644a81af37af40539aab436814ba6604b5bd5047 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 9 May 2022 12:52:57 +0300 Subject: [PATCH 063/255] testing: fix Path.rglob("") failures in Python 3.11b1 Fix #9930. --- testing/test_conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 68048204581..d2bf860c6fe 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -553,7 +553,7 @@ def test_no_conftest(fxtr): ) ) print("created directory structure:") - for x in pytester.path.rglob(""): + for x in pytester.path.glob("**/"): print(" " + str(x.relative_to(pytester.path))) return {"runner": runner, "package": package, "swc": swc, "snc": snc} From 31a9c5c66709609f8adfa81a9e3e4bf1147e0369 Mon Sep 17 00:00:00 2001 From: Babak Keyvani Date: Mon, 9 May 2022 21:15:02 -0400 Subject: [PATCH 064/255] improve `pytest.raises` - cont'd a few more iterations on error message and related tests. --- src/_pytest/python_api.py | 9 ++++----- testing/python/raises.py | 6 +++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 410877c88eb..bef9ec47bac 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -899,12 +899,11 @@ def raises( """ __tracebackhide__ = True - if expected_exception == (): + if not expected_exception: raise ValueError( - "Passing expected_exception=() is an error, because it's impossible to " - "raise an exception which is not an instance of any type. Raising exceptions " - "is already understood as failing the test, so you don't need any special " - "code to say 'this should never raise an exception'." + f"Expected an exception type or a tuple of exception types, but got `{expected_exception!r}`. " + f"Raising exceptions is already understood as failing the test, so you don't need " + f"any special code to say 'this should never raise an exception'." ) if isinstance(expected_exception, type): excepted_exceptions: Tuple[Type[E], ...] = (expected_exception,) diff --git a/testing/python/raises.py b/testing/python/raises.py index e1680623aee..b3fa0fc0e99 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -19,8 +19,12 @@ def test_raises_function(self): excinfo = pytest.raises(ValueError, int, "hello") assert "invalid literal" in str(excinfo.value) + def test_raises_does_not_allow_none(self): + with pytest.raises(ValueError, match="Expected an exception type or"): + pytest.raises(expected_exception=None) + def test_raises_does_not_allow_empty_tuple(self): - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Expected an exception type or"): pytest.raises(expected_exception=()) def test_raises_callable_no_exception(self) -> None: From a4a8763ebf882a8cf16433fcacbf58c9c88c4aa8 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 10 May 2022 16:27:21 +0200 Subject: [PATCH 065/255] Consistently add **Tutorial**: in front of how-to links in reference Up to now, some had the prefix, some didn't. I think it's good to have this prefix to give more context, otherwise the links sometimes blend into the description. In one case, the link goes to an example, so I used `**Example**:` there. --- doc/en/reference/reference.rst | 54 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 167c8fed9a3..38ee93e044f 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -92,7 +92,7 @@ pytest.param pytest.raises ~~~~~~~~~~~~~ -**Tutorial**: :ref:`assertraises`. +**Tutorial**: :ref:`assertraises` .. autofunction:: pytest.raises(expected_exception: Exception [, *, match]) :with: excinfo @@ -100,7 +100,7 @@ pytest.raises pytest.deprecated_call ~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`ensuring_function_triggers`. +**Tutorial**: :ref:`ensuring_function_triggers` .. autofunction:: pytest.deprecated_call() :with: @@ -108,7 +108,7 @@ pytest.deprecated_call pytest.register_assert_rewrite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`assertion-rewriting`. +**Tutorial**: :ref:`assertion-rewriting` .. autofunction:: pytest.register_assert_rewrite @@ -123,7 +123,7 @@ pytest.warns pytest.freeze_includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`freezing-pytest`. +**Tutorial**: :ref:`freezing-pytest` .. autofunction:: pytest.freeze_includes @@ -143,7 +143,7 @@ fixtures or plugins. pytest.mark.filterwarnings ~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`filterwarnings`. +**Tutorial**: :ref:`filterwarnings` Add warning filters to marked test items. @@ -169,7 +169,7 @@ Add warning filters to marked test items. pytest.mark.parametrize ~~~~~~~~~~~~~~~~~~~~~~~ -:ref:`parametrize`. +**Tutorial**: :ref:`parametrize` This mark has the same signature as :py:meth:`pytest.Metafunc.parametrize`; see there. @@ -179,7 +179,7 @@ This mark has the same signature as :py:meth:`pytest.Metafunc.parametrize`; see pytest.mark.skip ~~~~~~~~~~~~~~~~ -:ref:`skip`. +**Tutorial**: :ref:`skip` Unconditionally skip a test function. @@ -193,7 +193,7 @@ Unconditionally skip a test function. pytest.mark.skipif ~~~~~~~~~~~~~~~~~~ -:ref:`skipif`. +**Tutorial**: :ref:`skipif` Skip a test function if a condition is ``True``. @@ -209,7 +209,7 @@ Skip a test function if a condition is ``True``. pytest.mark.usefixtures ~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`usefixtures`. +**Tutorial**: :ref:`usefixtures` Mark a test function as using the given fixture names. @@ -231,7 +231,7 @@ Mark a test function as using the given fixture names. pytest.mark.xfail ~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`xfail`. +**Tutorial**: :ref:`xfail` Marks a test function as *expected to fail*. @@ -297,7 +297,7 @@ When :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers>` or :meth:`Node. Fixtures -------- -**Tutorial**: :ref:`fixture`. +**Tutorial**: :ref:`fixture` Fixtures are requested by test functions or other fixtures by declaring them as argument names. @@ -338,7 +338,7 @@ For more details, consult the full :ref:`fixtures docs `. config.cache ~~~~~~~~~~~~ -**Tutorial**: :ref:`cache`. +**Tutorial**: :ref:`cache` The ``config.cache`` object allows other plugins and fixtures to store and retrieve values across test runs. To access it from fixtures @@ -358,7 +358,7 @@ Under the hood, the cache plugin uses the simple capsys ~~~~~~ -:ref:`captures`. +**Tutorial**: :ref:`captures` .. autofunction:: _pytest.capture.capsys() :no-auto-options: @@ -383,7 +383,7 @@ capsys capsysbinary ~~~~~~~~~~~~ -:ref:`captures`. +**Tutorial**: :ref:`captures` .. autofunction:: _pytest.capture.capsysbinary() :no-auto-options: @@ -405,7 +405,7 @@ capsysbinary capfd ~~~~~~ -:ref:`captures`. +**Tutorial**: :ref:`captures` .. autofunction:: _pytest.capture.capfd() :no-auto-options: @@ -427,7 +427,7 @@ capfd capfdbinary ~~~~~~~~~~~~ -:ref:`captures`. +**Tutorial**: :ref:`captures` .. autofunction:: _pytest.capture.capfdbinary() :no-auto-options: @@ -449,7 +449,7 @@ capfdbinary doctest_namespace ~~~~~~~~~~~~~~~~~ -:ref:`doctest`. +**Tutorial**: :ref:`doctest` .. autofunction:: _pytest.doctest.doctest_namespace() @@ -469,7 +469,7 @@ doctest_namespace request ~~~~~~~ -:ref:`request example`. +**Example**: :ref:`request example` The ``request`` fixture is a special fixture providing information of the requesting test function. @@ -490,7 +490,7 @@ pytestconfig record_property ~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`record_property example`. +**Tutorial**: :ref:`record_property example` .. autofunction:: _pytest.junitxml.record_property() @@ -500,7 +500,7 @@ record_property record_testsuite_property ~~~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`record_testsuite_property example`. +**Tutorial**: :ref:`record_testsuite_property example` .. autofunction:: _pytest.junitxml.record_testsuite_property() @@ -510,7 +510,7 @@ record_testsuite_property caplog ~~~~~~ -:ref:`logging`. +**Tutorial**: :ref:`logging` .. autofunction:: _pytest.logging.caplog() :no-auto-options: @@ -526,7 +526,7 @@ caplog monkeypatch ~~~~~~~~~~~ -:ref:`monkeypatching`. +**Tutorial**: :ref:`monkeypatching` .. autofunction:: _pytest.monkeypatch.monkeypatch() :no-auto-options: @@ -612,7 +612,7 @@ Each recorded warning is an instance of :class:`warnings.WarningMessage`. tmp_path ~~~~~~~~ -:ref:`tmp_path` +**Tutorial**: :ref:`tmp_path` .. autofunction:: _pytest.tmpdir.tmp_path() :no-auto-options: @@ -623,7 +623,7 @@ tmp_path tmp_path_factory ~~~~~~~~~~~~~~~~ -:ref:`tmp_path_factory example` +**Tutorial**: :ref:`tmp_path_factory example` .. _`tmp_path_factory factory api`: @@ -638,7 +638,7 @@ tmp_path_factory tmpdir ~~~~~~ -:ref:`tmpdir and tmpdir_factory` +**Tutorial**: :ref:`tmpdir and tmpdir_factory` .. autofunction:: _pytest.legacypath.LegacyTmpdirPlugin.tmpdir() :no-auto-options: @@ -649,7 +649,7 @@ tmpdir tmpdir_factory ~~~~~~~~~~~~~~ -:ref:`tmpdir and tmpdir_factory` +**Tutorial**: :ref:`tmpdir and tmpdir_factory` ``tmpdir_factory`` is an instance of :class:`~pytest.TempdirFactory`: @@ -662,7 +662,7 @@ tmpdir_factory Hooks ----- -:ref:`writing-plugins`. +**Tutorial**: :ref:`writing-plugins` .. currentmodule:: _pytest.hookspec From 231e2206352233028fc38a01ab47c42e231b1449 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 10 May 2022 17:46:25 +0200 Subject: [PATCH 066/255] Move documentation contents from reference.rst to docstrings It's better to have the documentation in one place, instead of having some in the docstring and some additional information added to the reference documentation in `reference.rst`. --- doc/en/reference/reference.rst | 62 ---------------------------------- src/_pytest/capture.py | 53 ++++++++++++++++++++++++++--- src/_pytest/doctest.py | 13 ++++++- src/_pytest/recwarn.py | 7 ++++ 4 files changed, 68 insertions(+), 67 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 38ee93e044f..d082697258c 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -363,17 +363,6 @@ capsys .. autofunction:: _pytest.capture.capsys() :no-auto-options: - 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" - .. autoclass:: pytest.CaptureFixture() :members: @@ -388,18 +377,6 @@ capsysbinary .. autofunction:: _pytest.capture.capsysbinary() :no-auto-options: - Returns an instance of :class:`CaptureFixture[bytes] `. - - Example: - - .. code-block:: python - - def test_output(capsysbinary): - print("hello") - captured = capsysbinary.readouterr() - assert captured.out == b"hello\n" - - .. fixture:: capfd capfd @@ -410,18 +387,6 @@ capfd .. autofunction:: _pytest.capture.capfd() :no-auto-options: - Returns an instance of :class:`CaptureFixture[str] `. - - Example: - - .. code-block:: python - - def test_system_echo(capfd): - os.system('echo "hello"') - captured = capfd.readouterr() - assert captured.out == "hello\n" - - .. fixture:: capfdbinary capfdbinary @@ -432,17 +397,6 @@ capfdbinary .. autofunction:: _pytest.capture.capfdbinary() :no-auto-options: - Returns an instance of :class:`CaptureFixture[bytes] `. - - Example: - - .. code-block:: python - - def test_system_echo(capfdbinary): - os.system('echo "hello"') - captured = capfdbinary.readouterr() - assert captured.out == b"hello\n" - .. fixture:: doctest_namespace @@ -453,16 +407,6 @@ doctest_namespace .. autofunction:: _pytest.doctest.doctest_namespace() - Usually this fixture is used in conjunction with another ``autouse`` fixture: - - .. code-block:: python - - @pytest.fixture(autouse=True) - def add_np(doctest_namespace): - doctest_namespace["np"] = numpy - - For more details: :ref:`doctest_namespace`. - .. fixture:: request @@ -600,12 +544,6 @@ recwarn .. autoclass:: pytest.WarningsRecorder() :members: -Each recorded warning is an instance of :class:`warnings.WarningMessage`. - -.. note:: - ``DeprecationWarning`` and ``PendingDeprecationWarning`` are treated - differently; see :ref:`ensuring_function_triggers`. - .. fixture:: tmp_path diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index ee9de373325..2a3c4143be4 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -876,11 +876,22 @@ def disabled(self) -> Generator[None, None, None]: @fixture def capsys(request: SubRequest) -> Generator[CaptureFixture[str], None, None]: - """Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. + r"""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" """ capman = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[str](SysCapture, request, _ispytest=True) @@ -893,11 +904,22 @@ def capsys(request: SubRequest) -> Generator[CaptureFixture[str], None, None]: @fixture def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, None]: - """Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. + r"""Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``bytes`` objects. + + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_output(capsysbinary): + print("hello") + captured = capsysbinary.readouterr() + assert captured.out == b"hello\n" """ capman = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[bytes](SysCaptureBinary, request, _ispytest=True) @@ -910,11 +932,22 @@ def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, @fixture def capfd(request: SubRequest) -> Generator[CaptureFixture[str], None, None]: - """Enable text capturing of writes to file descriptors ``1`` and ``2``. + r"""Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.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_system_echo(capfd): + os.system('echo "hello"') + captured = capfd.readouterr() + assert captured.out == "hello\n" """ capman = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[str](FDCapture, request, _ispytest=True) @@ -927,11 +960,23 @@ def capfd(request: SubRequest) -> Generator[CaptureFixture[str], None, None]: @fixture def capfdbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, None]: - """Enable bytes capturing of writes to file descriptors ``1`` and ``2``. + r"""Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``byte`` objects. + + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfdbinary): + os.system('echo "hello"') + captured = capfdbinary.readouterr() + assert captured.out == b"hello\n" + """ capman = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[bytes](FDCaptureBinary, request, _ispytest=True) diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 7d37be2acc0..aa071cde883 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -730,5 +730,16 @@ def _get_report_choice(key: str) -> int: @pytest.fixture(scope="session") def doctest_namespace() -> Dict[str, Any]: """Fixture that returns a :py:class:`dict` that will be injected into the - namespace of doctests.""" + namespace of doctests. + + Usually this fixture is used in conjunction with another ``autouse`` fixture: + + .. code-block:: python + + @pytest.fixture(autouse=True) + def add_np(doctest_namespace): + doctest_namespace["np"] = numpy + + For more details: :ref:`doctest_namespace`. + """ return dict() diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 49e1de2827f..9c6e7e91daf 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -160,7 +160,14 @@ def warns( class WarningsRecorder(warnings.catch_warnings): """A context manager to record raised warnings. + Each recorded warning is an instance of :class:`warnings.WarningMessage`. + Adapted from `warnings.catch_warnings`. + + .. note:: + ``DeprecationWarning`` and ``PendingDeprecationWarning`` are treated + differently; see :ref:`ensuring_function_triggers`. + """ def __init__(self, *, _ispytest: bool = False) -> None: From 29462b1277fdae847b0527cf8e05a40c69810d39 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 10 May 2022 23:24:13 -0700 Subject: [PATCH 067/255] type-ignore in error-message test --- testing/python/raises.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/python/raises.py b/testing/python/raises.py index b3fa0fc0e99..f1f6ece4ee0 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -21,7 +21,9 @@ def test_raises_function(self): def test_raises_does_not_allow_none(self): with pytest.raises(ValueError, match="Expected an exception type or"): - pytest.raises(expected_exception=None) + # We're testing that this invalid usage gives a helpful error, + # so we can ignore Mypy telling us that None is invalid. + pytest.raises(expected_exception=None) # type: ignore def test_raises_does_not_allow_empty_tuple(self): with pytest.raises(ValueError, match="Expected an exception type or"): From 58af76122fe26a02f7cc3dd8178615b2c575e15c Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 10 May 2022 23:27:06 -0700 Subject: [PATCH 068/255] Move changelog file --- changelog/{8646.improvments.rst => 8646.improvment.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{8646.improvments.rst => 8646.improvment.rst} (100%) diff --git a/changelog/8646.improvments.rst b/changelog/8646.improvment.rst similarity index 100% rename from changelog/8646.improvments.rst rename to changelog/8646.improvment.rst From a29f4aff98ad019182d34965aa51ebfda11fb9ce Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 10 May 2022 23:27:33 -0700 Subject: [PATCH 069/255] Update 8646.improvement.rst --- changelog/{8646.improvment.rst => 8646.improvement.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{8646.improvment.rst => 8646.improvement.rst} (100%) diff --git a/changelog/8646.improvment.rst b/changelog/8646.improvement.rst similarity index 100% rename from changelog/8646.improvment.rst rename to changelog/8646.improvement.rst From a88c0f3bb056cb987eb217e934b6b9db481d8783 Mon Sep 17 00:00:00 2001 From: Pax <13646646+paxcodes@users.noreply.github.com> Date: Wed, 11 May 2022 01:02:36 -0700 Subject: [PATCH 070/255] Add link to python docs on logging levels (#9925) --- doc/en/how-to/logging.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index 87cebb8f20e..c99835a2baf 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -176,8 +176,8 @@ logging records as they are emitted directly into the console. You can specify the logging level for which log records with equal or higher level are printed to the console by passing ``--log-cli-level``. This setting -accepts the logging level names as seen in python's documentation or an integer -as the logging level num. +accepts the logging level names or numeric values as seen in +:ref:`logging's documentation `. Additionally, you can also specify ``--log-cli-format`` and ``--log-cli-date-format`` which mirror and default to ``--log-format`` and @@ -198,9 +198,8 @@ Note that relative paths for the log-file location, whether passed on the CLI or config file, are always resolved relative to the current working directory. You can also specify the logging level for the log file by passing -``--log-file-level``. This setting accepts the logging level names as seen in -python's documentation(ie, uppercased level names) or an integer as the logging -level num. +``--log-file-level``. This setting accepts the logging level names or numeric +values as seen in :ref:`logging's documentation `. Additionally, you can also specify ``--log-file-format`` and ``--log-file-date-format`` which are equal to ``--log-format`` and From 16781f9b8c001786d3e3fac9b89821118dc68f94 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 May 2022 10:52:41 -0300 Subject: [PATCH 071/255] [pre-commit.ci] pre-commit autoupdate (#9936) [pre-commit.ci] pre-commit autoupdate --- .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 30fa24ae03b..c5856cdd8c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v2.32.1 hooks: - id: pyupgrade args: [--py37-plus] From c5432a18e7871be19330cdf65912c9063ee486bd Mon Sep 17 00:00:00 2001 From: Ruth Comer Date: Thu, 12 May 2022 12:16:25 +0100 Subject: [PATCH 072/255] doc: link to pytest-subtests --- doc/en/how-to/unittest.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/unittest.rst b/doc/en/how-to/unittest.rst index b6393707160..658c69a14fd 100644 --- a/doc/en/how-to/unittest.rst +++ b/doc/en/how-to/unittest.rst @@ -27,12 +27,15 @@ Almost all ``unittest`` features are supported: * ``setUpClass/tearDownClass``; * ``setUpModule/tearDownModule``; +.. _`pytest-subtests`: https://github.com/pytest-dev/pytest-subtests .. _`load_tests protocol`: https://docs.python.org/3/library/unittest.html#load-tests-protocol +Additionally, :ref:`subtests ` are supported by the +`pytest-subtests`_ plugin. + Up to this point pytest does not have support for the following features: * `load_tests protocol`_; -* :ref:`subtests `; Benefits out of the box ----------------------- From 69fb79e741f00714d3ac14ee853c5506f154e94f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 12 May 2022 09:55:40 -0300 Subject: [PATCH 073/255] Add colors to summary (#9875) Fix #9873 --- src/_pytest/terminal.py | 66 ++++++++++++++++++++++++++-------------- testing/test_skipping.py | 23 ++++++-------- testing/test_terminal.py | 10 ++++-- 3 files changed, 60 insertions(+), 39 deletions(-) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index b4848c48aba..41a9861a3ce 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -35,6 +35,7 @@ from _pytest import timing from _pytest._code import ExceptionInfo from _pytest._code.code import ExceptionRepr +from _pytest._io import TerminalWriter from _pytest._io.wcwidth import wcswidth from _pytest.compat import final from _pytest.config import _PluggyPlugin @@ -1074,33 +1075,43 @@ def short_test_summary(self) -> None: if not self.reportchars: return - def show_simple(stat, lines: List[str]) -> None: + def show_simple(lines: List[str], *, stat: str) -> None: failed = self.stats.get(stat, []) if not failed: return - termwidth = self._tw.fullwidth config = self.config for rep in failed: - line = _get_line_with_reprcrash_message(config, rep, termwidth) + color = _color_for_type.get(stat, _color_for_type_default) + line = _get_line_with_reprcrash_message( + config, rep, self._tw, {color: True} + ) lines.append(line) def show_xfailed(lines: List[str]) -> None: xfailed = self.stats.get("xfailed", []) for rep in xfailed: verbose_word = rep._get_verbose_word(self.config) - pos = _get_pos(self.config, rep) - lines.append(f"{verbose_word} {pos}") + markup_word = self._tw.markup( + verbose_word, **{_color_for_type["warnings"]: True} + ) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) + line = f"{markup_word} {nodeid}" reason = rep.wasxfail if reason: - lines.append(" " + str(reason)) + line += " - " + str(reason) + + lines.append(line) def show_xpassed(lines: List[str]) -> None: xpassed = self.stats.get("xpassed", []) for rep in xpassed: verbose_word = rep._get_verbose_word(self.config) - pos = _get_pos(self.config, rep) + markup_word = self._tw.markup( + verbose_word, **{_color_for_type["warnings"]: True} + ) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) reason = rep.wasxfail - lines.append(f"{verbose_word} {pos} {reason}") + lines.append(f"{markup_word} {nodeid} {reason}") def show_skipped(lines: List[str]) -> None: skipped: List[CollectReport] = self.stats.get("skipped", []) @@ -1108,24 +1119,27 @@ def show_skipped(lines: List[str]) -> None: if not fskips: return verbose_word = skipped[0]._get_verbose_word(self.config) + markup_word = self._tw.markup( + verbose_word, **{_color_for_type["warnings"]: True} + ) + prefix = "Skipped: " for num, fspath, lineno, reason in fskips: - if reason.startswith("Skipped: "): - reason = reason[9:] + if reason.startswith(prefix): + reason = reason[len(prefix) :] if lineno is not None: lines.append( - "%s [%d] %s:%d: %s" - % (verbose_word, num, fspath, lineno, reason) + "%s [%d] %s:%d: %s" % (markup_word, num, fspath, lineno, reason) ) else: - lines.append("%s [%d] %s: %s" % (verbose_word, num, fspath, reason)) + lines.append("%s [%d] %s: %s" % (markup_word, num, fspath, reason)) REPORTCHAR_ACTIONS: Mapping[str, Callable[[List[str]], None]] = { "x": show_xfailed, "X": show_xpassed, - "f": partial(show_simple, "failed"), + "f": partial(show_simple, stat="failed"), "s": show_skipped, - "p": partial(show_simple, "passed"), - "E": partial(show_simple, "error"), + "p": partial(show_simple, stat="passed"), + "E": partial(show_simple, stat="error"), } lines: List[str] = [] @@ -1135,7 +1149,7 @@ def show_skipped(lines: List[str]) -> None: action(lines) if lines: - self.write_sep("=", "short test summary info") + self.write_sep("=", "short test summary info", cyan=True, bold=True) for line in lines: self.write_line(line) @@ -1249,9 +1263,14 @@ def _build_collect_only_summary_stats_line( return parts, main_color -def _get_pos(config: Config, rep: BaseReport): +def _get_node_id_with_markup(tw: TerminalWriter, config: Config, rep: BaseReport): nodeid = config.cwd_relative_nodeid(rep.nodeid) - return nodeid + path, *parts = nodeid.split("::") + if parts: + parts_markup = tw.markup("::".join(parts), bold=True) + return path + "::" + parts_markup + else: + return path def _format_trimmed(format: str, msg: str, available_width: int) -> Optional[str]: @@ -1280,13 +1299,14 @@ def _format_trimmed(format: str, msg: str, available_width: int) -> Optional[str def _get_line_with_reprcrash_message( - config: Config, rep: BaseReport, termwidth: int + config: Config, rep: BaseReport, tw: TerminalWriter, word_markup: Dict[str, bool] ) -> str: """Get summary line for a report, trying to add reprcrash message.""" verbose_word = rep._get_verbose_word(config) - pos = _get_pos(config, rep) + word = tw.markup(verbose_word, **word_markup) + node = _get_node_id_with_markup(tw, config, rep) - line = f"{verbose_word} {pos}" + line = f"{word} {node}" line_width = wcswidth(line) try: @@ -1295,7 +1315,7 @@ def _get_line_with_reprcrash_message( except AttributeError: pass else: - available_width = termwidth - line_width + available_width = tw.fullwidth - line_width msg = _format_trimmed(" - {}", msg, available_width) if msg is not None: line += msg diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 3010943607c..6415480ef4f 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -441,10 +441,8 @@ def test_this_false(): result = pytester.runpytest(p, "-rx") result.stdout.fnmatch_lines( [ - "*test_one*test_this*", - "*NOTRUN*noway", - "*test_one*test_this_true*", - "*NOTRUN*condition:*True*", + "*test_one*test_this - reason: *NOTRUN* noway", + "*test_one*test_this_true - reason: *NOTRUN* condition: True", "*1 passed*", ] ) @@ -461,9 +459,7 @@ def setup_module(mod): """ ) result = pytester.runpytest(p, "-rx") - result.stdout.fnmatch_lines( - ["*test_one*test_this*", "*NOTRUN*hello", "*1 xfailed*"] - ) + result.stdout.fnmatch_lines(["*test_one*test_this*NOTRUN*hello", "*1 xfailed*"]) def test_xfail_xpass(self, pytester: Pytester) -> None: p = pytester.makepyfile( @@ -489,7 +485,7 @@ def test_this(): result = pytester.runpytest(p) result.stdout.fnmatch_lines(["*1 xfailed*"]) result = pytester.runpytest(p, "-rx") - result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*reason:*hello*"]) + result.stdout.fnmatch_lines(["*XFAIL*test_this*reason:*hello*"]) result = pytester.runpytest(p, "--runxfail") result.stdout.fnmatch_lines(["*1 pass*"]) @@ -507,7 +503,7 @@ def test_this(): result = pytester.runpytest(p) result.stdout.fnmatch_lines(["*1 xfailed*"]) result = pytester.runpytest(p, "-rx") - result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*reason:*hello*"]) + result.stdout.fnmatch_lines(["*XFAIL*test_this*reason:*hello*"]) result = pytester.runpytest(p, "--runxfail") result.stdout.fnmatch_lines( """ @@ -543,7 +539,7 @@ def test_this(arg): """ ) result = pytester.runpytest(p, "-rxX") - result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*NOTRUN*"]) + result.stdout.fnmatch_lines(["*XFAIL*test_this*NOTRUN*"]) def test_dynamic_xfail_set_during_funcarg_setup(self, pytester: Pytester) -> None: p = pytester.makepyfile( @@ -622,7 +618,7 @@ def test_foo(): """ ) result = pytester.runpytest(p, "-rxX") - result.stdout.fnmatch_lines(["*XFAIL*", "*unsupported feature*"]) + result.stdout.fnmatch_lines(["*XFAIL*unsupported feature*"]) assert result.ret == 0 @pytest.mark.parametrize("strict", [True, False]) @@ -1185,7 +1181,7 @@ def test_boolean(): """ ) result = pytester.runpytest("-rsx") - result.stdout.fnmatch_lines(["*SKIP*x == 3*", "*XFAIL*test_boolean*", "*x == 3*"]) + result.stdout.fnmatch_lines(["*SKIP*x == 3*", "*XFAIL*test_boolean*x == 3*"]) def test_default_markers(pytester: Pytester) -> None: @@ -1297,8 +1293,7 @@ def test_func(): result = pytester.runpytest("-rxs") result.stdout.fnmatch_lines( """ - *XFAIL* - *True123* + *XFAIL*True123* *1 xfail* """ ) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index f0e58e5b4c4..5b464d68bfb 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -2319,7 +2319,7 @@ def test_line_with_reprcrash(monkeypatch: MonkeyPatch) -> None: def mock_get_pos(*args): return mocked_pos - monkeypatch.setattr(_pytest.terminal, "_get_pos", mock_get_pos) + monkeypatch.setattr(_pytest.terminal, "_get_node_id_with_markup", mock_get_pos) class config: pass @@ -2333,10 +2333,16 @@ class reprcrash: pass def check(msg, width, expected): + class DummyTerminalWriter: + fullwidth = width + + def markup(self, word: str, **markup: str): + return word + __tracebackhide__ = True if msg: rep.longrepr.reprcrash.message = msg # type: ignore - actual = _get_line_with_reprcrash_message(config, rep(), width) # type: ignore + actual = _get_line_with_reprcrash_message(config, rep(), DummyTerminalWriter(), {}) # type: ignore assert actual == expected if actual != f"{mocked_verbose_word} {mocked_pos}": From 56c266640ef4ee60659f81af36bc95f6e6ca9cfa Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 13 May 2022 06:15:52 -0500 Subject: [PATCH 074/255] Do not truncate crash messages in short test summary on CI (#9933) Closes #9920 --- changelog/9920.improvement.rst | 1 + src/_pytest/terminal.py | 8 ++++++-- testing/test_terminal.py | 18 ++++++++++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 changelog/9920.improvement.rst diff --git a/changelog/9920.improvement.rst b/changelog/9920.improvement.rst new file mode 100644 index 00000000000..ed47e872cac --- /dev/null +++ b/changelog/9920.improvement.rst @@ -0,0 +1 @@ +Display full crash messages in ``short test summary info``, when runng in a CI environment. diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 41a9861a3ce..bb07b3ce7c6 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -37,6 +37,7 @@ from _pytest._code.code import ExceptionRepr from _pytest._io import TerminalWriter from _pytest._io.wcwidth import wcswidth +from _pytest.assertion.util import running_on_ci from _pytest.compat import final from _pytest.config import _PluggyPlugin from _pytest.config import Config @@ -1315,8 +1316,11 @@ def _get_line_with_reprcrash_message( except AttributeError: pass else: - available_width = tw.fullwidth - line_width - msg = _format_trimmed(" - {}", msg, available_width) + if not running_on_ci(): + available_width = tw.fullwidth - line_width + msg = _format_trimmed(" - {}", msg, available_width) + else: + msg = f" - {msg}" if msg is not None: line += msg diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 5b464d68bfb..9a8dd4d9ac9 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1139,7 +1139,21 @@ def test(): assert result.stdout.lines.count(expected) == 1 -def test_fail_extra_reporting(pytester: Pytester, monkeypatch) -> None: +@pytest.mark.parametrize( + ("use_ci", "expected_message"), + ( + (True, f"- AssertionError: {'this_failed'*100}"), + (False, "- AssertionError: this_failedt..."), + ), + ids=("on CI", "not on CI"), +) +def test_fail_extra_reporting( + pytester: Pytester, monkeypatch, use_ci: bool, expected_message: str +) -> None: + if use_ci: + monkeypatch.setenv("CI", "true") + else: + monkeypatch.delenv("CI", raising=False) monkeypatch.setenv("COLUMNS", "80") pytester.makepyfile("def test_this(): assert 0, 'this_failed' * 100") result = pytester.runpytest("-rN") @@ -1148,7 +1162,7 @@ def test_fail_extra_reporting(pytester: Pytester, monkeypatch) -> None: result.stdout.fnmatch_lines( [ "*test summary*", - "FAILED test_fail_extra_reporting.py::test_this - AssertionError: this_failedt...", + f"FAILED test_fail_extra_reporting.py::test_this {expected_message}", ] ) From cc0fbbefa0f8a6b390e89ef0d4d64dd78783a5c1 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 14 May 2022 07:50:40 -0300 Subject: [PATCH 075/255] Add CHANGELOG for #9873 (#9953) --- changelog/9873.improvement.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9873.improvement.rst diff --git a/changelog/9873.improvement.rst b/changelog/9873.improvement.rst new file mode 100644 index 00000000000..431f9861b62 --- /dev/null +++ b/changelog/9873.improvement.rst @@ -0,0 +1 @@ +Some coloring has been added to the short test summary. From 5d20e285387d1256c253333bee74eba775eee3b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 03:02:09 +0000 Subject: [PATCH 076/255] build(deps): Bump anyio[curio,trio] in /testing/plugins_integration Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 3.5.0 to 3.6.1. - [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/3.5.0...3.6.1) --- updated-dependencies: - dependency-name: anyio[curio,trio] 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 6d1b02920a0..0386a613a93 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,4 +1,4 @@ -anyio[curio,trio]==3.5.0 +anyio[curio,trio]==3.6.1 django==4.0.4 pytest-asyncio==0.18.3 pytest-bdd==5.0.0 From 5d28a5864001fd6405202217c246f8da925835e5 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 16 May 2022 10:17:18 +0200 Subject: [PATCH 077/255] Remove docs on Python 2.7 and 3.4 Support (#9957) This extensive explanation is not need anymore because they are now unsupported for a long time. Instead add as short section on Python version compatibility in the backward compatibility docs. --- doc/en/backwards-compatibility.rst | 15 +++++ doc/en/changelog.rst | 12 +++- doc/en/contents.rst | 1 - doc/en/py27-py34-deprecation.rst | 99 ------------------------------ 4 files changed, 24 insertions(+), 103 deletions(-) delete mode 100644 doc/en/py27-py34-deprecation.rst diff --git a/doc/en/backwards-compatibility.rst b/doc/en/backwards-compatibility.rst index 3a0ff126164..64bcbf5bd49 100644 --- a/doc/en/backwards-compatibility.rst +++ b/doc/en/backwards-compatibility.rst @@ -77,3 +77,18 @@ Deprecation Roadmap Features currently deprecated and removed in previous releases can be found in :ref:`deprecations`. We track future deprecation and removal of features using milestones and the `deprecation `_ and `removal `_ labels on GitHub. + + +Python version support +====================== + +Released pytest versions support all Python versions that are actively maintained at the time of the release: + +============== =================== +pytest version min. Python version +============== =================== +7.1+ 3.7+ +6.2 - 7.0 3.6+ +5.0 - 6.1 3.5+ +3.3 - 4.6 2.7, 3.4+ +============== =================== diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 46e18d32255..01c6d6983a2 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -2618,7 +2618,8 @@ Important This release is a Python3.5+ only release. -For more details, see our :std:doc:`Python 2.7 and 3.4 support plan `. +For more details, see our `Python 2.7 and 3.4 support plan +`_. Removals -------- @@ -2842,7 +2843,11 @@ Features - :issue:`6870`: New ``Config.invocation_args`` attribute containing the unchanged arguments passed to ``pytest.main()``. - Remark: while this is technically a new feature and according to our :ref:`policy ` it should not have been backported, we have opened an exception in this particular case because it fixes a serious interaction with ``pytest-xdist``, so it can also be considered a bugfix. + Remark: while this is technically a new feature and according to our + `policy `_ + it should not have been backported, we have opened an exception in this + particular case because it fixes a serious interaction with ``pytest-xdist``, + so it can also be considered a bugfix. Trivial/Internal Changes ------------------------ @@ -3014,7 +3019,8 @@ Important The ``4.6.X`` series will be the last series to support **Python 2 and Python 3.4**. -For more details, see our :std:doc:`Python 2.7 and 3.4 support plan `. +For more details, see our `Python 2.7 and 3.4 support plan +`_. Features diff --git a/doc/en/contents.rst b/doc/en/contents.rst index 049d44ba9d8..ae42884f658 100644 --- a/doc/en/contents.rst +++ b/doc/en/contents.rst @@ -85,7 +85,6 @@ Further topics backwards-compatibility deprecations - py27-py34-deprecation contributing development_guide diff --git a/doc/en/py27-py34-deprecation.rst b/doc/en/py27-py34-deprecation.rst deleted file mode 100644 index 660b078e30e..00000000000 --- a/doc/en/py27-py34-deprecation.rst +++ /dev/null @@ -1,99 +0,0 @@ -Python 2.7 and 3.4 support -========================== - -It is demanding on the maintainers of an open source project to support many Python versions, as -there's extra cost of keeping code compatible between all versions, while holding back on -features only made possible on newer Python versions. - -In case of Python 2 and 3, the difference between the languages makes it even more prominent, -because many new Python 3 features cannot be used in a Python 2/3 compatible code base. - -Python 2.7 EOL has been reached :pep:`in 2020 <0373#maintenance-releases>`, with -the last release made in April, 2020. - -Python 3.4 EOL has been reached :pep:`in 2019 <0429#release-schedule>`, with the last release made in March, 2019. - -For those reasons, in Jun 2019 it was decided that **pytest 4.6** series will be the last to support Python 2.7 and 3.4. - -What this means for general users ---------------------------------- - -Thanks to the `python_requires`_ setuptools option, -Python 2.7 and Python 3.4 users using a modern pip version -will install the last pytest 4.6.X version automatically even if 5.0 or later versions -are available on PyPI. - -Users should ensure they are using the latest pip and setuptools versions for this to work. - -Maintenance of 4.6.X versions ------------------------------ - -Until January 2020, the pytest core team ported many bug-fixes from the main release into the -``4.6.x`` branch, with several 4.6.X releases being made along the year. - -From now on, the core team will **no longer actively backport patches**, but the ``4.6.x`` -branch will continue to exist so the community itself can contribute patches. - -The core team will be happy to accept those patches, and make new 4.6.X releases **until mid-2020** -(but consider that date as a ballpark, after that date the team might still decide to make new releases -for critical bugs). - -.. _`python_requires`: https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - -Technical aspects -~~~~~~~~~~~~~~~~~ - -(This section is a transcript from :issue:`5275`). - -In this section we describe the technical aspects of the Python 2.7 and 3.4 support plan. - -.. _what goes into 4.6.x releases: - -What goes into 4.6.X releases -+++++++++++++++++++++++++++++ - -New 4.6.X releases will contain bug fixes only. - -When will 4.6.X releases happen -+++++++++++++++++++++++++++++++ - -New 4.6.X releases will happen after we have a few bugs in place to release, or if a few weeks have -passed (say a single bug has been fixed a month after the latest 4.6.X release). - -No hard rules here, just ballpark. - -Who will handle applying bug fixes -++++++++++++++++++++++++++++++++++ - -We core maintainers expect that people still using Python 2.7/3.4 and being affected by -bugs to step up and provide patches and/or port bug fixes from the active branches. - -We will be happy to guide users interested in doing so, so please don't hesitate to ask. - -**Backporting changes into 4.6** - -Please follow these instructions: - -#. ``git fetch --all --prune`` - -#. ``git checkout origin/4.6.x -b backport-XXXX`` # use the PR number here - -#. Locate the merge commit on the PR, in the *merged* message, for example: - - nicoddemus merged commit 0f8b462 into pytest-dev:features - -#. ``git cherry-pick -m1 REVISION`` # use the revision you found above (``0f8b462``). - -#. Open a PR targeting ``4.6.x``: - - * Prefix the message with ``[4.6]`` so it is an obvious backport - * Delete the PR body, it usually contains a duplicate commit message. - -**Providing new PRs to 4.6** - -Fresh pull requests to ``4.6.x`` will be accepted provided that -the equivalent code in the active branches does not contain that bug (for example, a bug is specific -to Python 2 only). - -Bug fixes that also happen in the mainstream version should be first fixed -there, and then backported as per instructions above. From 7b977f4beb014240770691f6cbb9fd3d83c16b88 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 08:46:51 -0300 Subject: [PATCH 078/255] [automated] Update plugin list (#9959) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 2198 +++++++++++++++--------------- 1 file changed, 1115 insertions(+), 1083 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 2bdd41d975a..6def59d1b14 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,1057 +11,1061 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1043 plugins. +This list contains 1047 plugins. .. only:: not latex - =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ - name summary last release status requires - =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ - :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 26, 2022 N/A pytest (>=5.4.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) - :pypi:`pytest-agent` Service that exposes a REST API that can be used to interract remotely with Pytest. It is shipped with a dashboard that enables running tests in a more convenient way. Nov 25, 2021 N/A N/A - :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) - :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest - :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A - :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Mar 13, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) - :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Apr 10, 2022 N/A pytest (>=1.0) - :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest - :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Feb 21, 2022 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-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest - :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) - :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 Oct 14, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Nov 29, 2021 3 - Alpha pytest (<7.0.0,>=3.2.0) - :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A - :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 - :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest - :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest - :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A - :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' - :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 07, 2022 N/A pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A - :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 Feb 07, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) - :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 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) - :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A - :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A - :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-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) - :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A - :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) - :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. May 02, 2022 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) - :pypi:`pytest-atomic` Skip rest of tests if previous test failed. Nov 24, 2018 4 - Beta N/A - :pypi:`pytest-attrib` pytest plugin to select tests based on attributes similar to the nose-attrib plugin May 24, 2016 4 - Beta N/A - :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A - :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A - :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. Oct 01, 2021 N/A pytest - :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 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-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest - :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A - :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A - :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) - :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) - :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.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-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 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. Apr 17, 2021 5 - Production/Stable pytest (>=3.8) - :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A - :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Aug 05, 2021 N/A pytest (>=5.0) - :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A - :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-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. Mar 11, 2022 N/A pytest ; extra == 'dev' - :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-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A - :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A - :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A - :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A - :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-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 - :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A - :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Apr 13, 2022 5 - Production/Stable pytest (>=6.2.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) - :pypi:`pytest-buildkite` Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite. Jul 13, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest - :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A - :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data May 02, 2022 4 - Beta pytest (>=5.0.0) - :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest - :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-caprng` A plugin that replays pRNG state on failure. May 02, 2018 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-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest - :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 21, 2022 5 - Production/Stable N/A - :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 - :pypi:`pytest-celery` pytest-celery a shim pytest plugin to enable celery.contrib.pytest May 06, 2021 N/A N/A - :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A - :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A - :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest - :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-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' - :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) - :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) - :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest - :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A - :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A - :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest - :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A - :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A - :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-clld` Nov 29, 2021 N/A pytest (>=3.6) - :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-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) - :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 Apr 12, 2022 4 - Beta pytest (>=4.6.0) - :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-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 - :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 Nov 12, 2020 N/A pytest (>=3.6,<7) - :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) - :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 Mar 18, 2022 4 - Beta N/A - :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 Feb 01, 2022 3 - Alpha 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-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) - :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. Oct 04, 2021 5 - Production/Stable pytest (>=4.6) - :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 Jan 04, 2021 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types May 06, 2022 N/A N/A - :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A - :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) - :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 - :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) - :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A - :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A - :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A - :pypi:`pytest-custom-exit-code` Exit pytest test session with custom exit code in different scenarios Aug 07, 2019 4 - Beta pytest (>=4.0.2) - :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A - :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest - :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A - :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-cython-collect` May 04, 2022 N/A pytest - :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' - :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A - :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A - :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 Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) - :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest - :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-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) - :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A - :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 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-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. Apr 20, 2020 5 - Production/Stable pytest - :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) - :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A - :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A - :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) - :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) - :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' - :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A - :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A - :pypi:`pytest-defer` Aug 24, 2021 N/A N/A - :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A - :pypi:`pytest-dependency` Manage dependencies of tests Feb 14, 2020 4 - Beta N/A - :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) - :pypi:`pytest-deprecate` Mark tests as testing a deprecated feature with a warning note. Jul 01, 2019 N/A N/A - :pypi:`pytest-describe` Describe-style plugin for pytest Nov 13, 2021 4 - Beta pytest (>=4.0.0) - :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest - :pypi:`pytest-devpi-server` DevPI server fixture for py.test May 28, 2019 5 - Production/Stable pytest - :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 - :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A - :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-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. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) - :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.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 04, 2021 4 - Beta N/A - :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-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A - :pypi:`pytest-django-filefield` Replaces FileField.storage with something you can patch globally. May 06, 2022 5 - Production/Stable pytest >= 5.2 - :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A - :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) - :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A - :pypi:`pytest-django-lite` The bare minimum to integrate py.test with Django. Jan 30, 2014 N/A N/A - :pypi:`pytest-django-liveserver-ssl` Jan 20, 2022 3 - Alpha N/A - :pypi:`pytest-django-model` A Simple Way to Test your Django Models Feb 14, 2019 4 - Beta N/A - :pypi:`pytest-django-ordering` A pytest plugin for preserving the order in which Django runs tests. Jul 25, 2019 5 - Production/Stable pytest (>=2.3.0) - :pypi:`pytest-django-queries` Generate performance reports from your django database performance tests. Mar 01, 2021 N/A N/A - :pypi:`pytest-djangorestframework` A djangorestframework plugin for pytest Aug 11, 2019 4 - Beta N/A - :pypi:`pytest-django-rq` A pytest plugin to help writing unit test for django-rq Apr 13, 2020 4 - Beta N/A - :pypi:`pytest-django-sqlcounts` py.test plugin for reporting the number of SQLs executed per django testcase. Jun 16, 2015 4 - Beta N/A - :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Jan 31, 2022 4 - Beta N/A - :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 Apr 09, 2022 N/A pytest (<8.0,>=4.0) - :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 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) - :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) - :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 Nov 23, 2021 3 - Alpha N/A - :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest - :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) - :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest - :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest - :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) - :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A - :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-doctestplus` Pytest plugin with advanced doctest features. Feb 25, 2022 3 - Alpha pytest (>=4.6) - :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) - :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-drf` A Django REST framework plugin for pytest. Nov 12, 2020 5 - Production/Stable pytest (>=3.6) - :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 May 23, 2020 4 - Beta pytest (>=2.7) - :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` Jun 25, 2021 N/A N/A - :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) - :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 Jun 03, 2021 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 - :pypi:`pytest-easy-api` Simple API testing with pytest Mar 26, 2018 N/A N/A - :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A - :pypi:`pytest-easyread` pytest plugin that makes terminal printouts of the reports easier to read Nov 17, 2017 N/A N/A - :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" - :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A - :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A - :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) - :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. Apr 05, 2022 1 - Planning pytest (>=5.4.0) - :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin May 07, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 07, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 07, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 07, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 07, 2022 N/A N/A - :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 07, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 07, 2022 N/A N/A - :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 12, 2022 4 - Beta pytest (==7.0.1) - :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A - :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest - :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A - :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Jun 16, 2017 4 - Beta N/A - :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-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-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-error-for-skips` Pytest plugin to treat skipped tests a test failure Dec 19, 2019 4 - Beta pytest (>=4.6) - :pypi:`pytest-eth` PyTest plugin for testing Smart Contracts for Ethereum Virtual Machine (EVM). Aug 14, 2020 1 - Planning N/A - :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' - :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Aug 13, 2019 N/A pytest (>=4.2.0) - :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' - :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A - :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 Nov 10, 2021 4 - Beta pytest (<6.3,>=4.3) - :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A - :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-expecter` Better testing with expecter and pytest. Jan 10, 2022 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-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) - :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest - :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) - :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest - :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-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. May 02, 2022 6 - Mature pytest (>=5.0.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-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A - :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) - :pypi:`pytest-fail-slow` Fail tests that take too long to run Apr 25, 2022 4 - Beta pytest (>=6.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-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A - :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A - :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A - :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A - :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest - :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) - :pypi:`pytest-fauxfactory` Integration of fauxfactory into pytest. Dec 06, 2017 5 - Production/Stable pytest (>=3.2) - :pypi:`pytest-figleaf` py.test figleaf coverage plugin Jan 18, 2010 5 - Production/Stable N/A - :pypi:`pytest-filecov` A pytest plugin to detect unused files Jun 27, 2021 4 - Beta pytest - :pypi:`pytest-filedata` easily load data from files Jan 17, 2019 4 - Beta N/A - :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 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 Jan 09, 2020 3 - Alpha pytest (>=3.0) - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 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` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) - :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest - :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 Aug 25, 2020 N/A pytest (>=3.0) - :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-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 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 Mar 18, 2022 4 - Beta pytest (>=7.0) - :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 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-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) - :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) - :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. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) - :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) - :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-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A - :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A - :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A - :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A - :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) - :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) - :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 - :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A - :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A - :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) - :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-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. May 04, 2022 N/A N/A - :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest - :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest - :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A - :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) - :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest - :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 Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest - :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-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-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest - :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Apr 01, 2021 5 - Production/Stable N/A - :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jan 10, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A - :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest - :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) - :pypi:`pytest-hidecaptured` Hide captured output May 04, 2018 4 - Beta pytest (>=2.8.5) - :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest - :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 07, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) - :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A - :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 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 Apr 03, 2022 N/A N/A - :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 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 - :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 Dec 05, 2019 N/A N/A - :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' - :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 Jan 27, 2022 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Feb 05, 2022 5 - Production/Stable pytest (<8.*,>=6.*) - :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) - :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-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest - :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A - :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 May 04, 2022 5 - Production/Stable N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A - :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest - :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A - :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A - :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A - :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A - :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-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Apr 26, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 29, 2022 5 - Production/Stable N/A - :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A - :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) - :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) - :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) - :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A - :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) - :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-invenio` Pytest fixtures for Invenio. May 05, 2022 5 - Production/Stable pytest (<7,>=6) - :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A - :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A - :pypi:`pytest-isort` py.test plugin to check import ordering using isort Feb 08, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A - :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A - :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A - :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) - :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Mar 09, 2022 3 - Alpha pytest - :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) - :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 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-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest - :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest - :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A - :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) - :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A - :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A - :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A - :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. Aug 23, 2021 3 - Alpha pytest (>=3.6,<7) - :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A - :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-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest - :pypi:`pytest-leak-finder` Find the previous test that makes another to fail Apr 18, 2022 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-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest - :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Apr 14, 2022 4 - Beta N/A - :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 - :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest - :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest - :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A - :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 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 Oct 29, 2021 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) - :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. Jul 25, 2019 4 - Beta pytest (>=3.2) - :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-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A - :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 18, 2022 3 - Alpha pytest - :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha 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-docs` Run markdown code fences through pytest Apr 07, 2022 N/A N/A - :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A - :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) - :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A - :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-matcher` Match test output against patterns stored in files Dec 10, 2021 5 - Production/Stable N/A - :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 - :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) - :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.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 make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) - :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 Apr 19, 2022 N/A N/A - :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-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest - :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) - :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) - :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.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 Jan 28, 2022 5 - Production/Stable pytest (>=5.0) - :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 Mar 08, 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. Apr 11, 2022 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-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-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest - :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) - :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest - :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 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 - :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A - :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest - :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest - :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest - :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest - :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 Jun 10, 2021 N/A N/A - :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) - :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Mar 22, 2022 N/A N/A - :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" - :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" - :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) - :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A - :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Mar 02, 2022 N/A N/A - :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) - :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) - :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) - :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A - :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 Mar 15, 2022 N/A pytest (==6.2.5) - :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 Jul 07, 2021 N/A N/A - :pypi:`pytest-nocustom` Run all tests without custom markers Jul 07, 2021 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 Aug 29, 2021 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-notice` Send pytest execution result email Nov 05, 2020 N/A N/A - :pypi:`pytest-notification` A pytest plugin for sending a desktop notification and playing a sound upon completion of tests Jun 19, 2020 N/A pytest (>=4) - :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest - :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) - :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 Mar 16, 2022 4 - Beta pytest (>=4.6.0) - :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A - :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A - :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A - :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A - :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A - :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A - :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A - :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators May 04, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) - :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 Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" - :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest - :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A - :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A - :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A - :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) - :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) - :pypi:`pytest-parametrization` Simpler PyTest parametrization Nov 30, 2021 5 - Production/Stable pytest - :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 plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest - :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A - :pypi:`pytest-passrunner` Pytest plugin providing the 'run_on_pass' marker Feb 10, 2021 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-paste-config` Allow setting the path to a paste config file Sep 18, 2013 3 - Alpha N/A - :pypi:`pytest-patches` A contextmanager pytest fixture for handling multiple mock patches Aug 30, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-pdb` pytest plugin which adds pdb helper commands related to pytest. Jul 31, 2018 N/A N/A - :pypi:`pytest-peach` pytest plugin for fuzzing with Peach API Security Apr 12, 2019 4 - Beta pytest (>=2.8.7) - :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A - :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A - :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) - :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=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-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) - :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) - :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) - :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) - :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest - :pypi:`pytest-pilot` Slice in your test base thanks to powerful markers. Oct 09, 2020 5 - Production/Stable N/A - :pypi:`pytest-pings` 🦊 The pytest plugin for Firefox Telemetry 📊 Jun 29, 2019 3 - Alpha pytest (>=5.0.0) - :pypi:`pytest-pinned` A simple pytest plugin for pinning tests Sep 17, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-pinpoint` A pytest plugin which runs SBFL algorithms to detect faults. Sep 25, 2020 N/A pytest (>=4.4.0) - :pypi:`pytest-pipeline` Pytest plugin for functional testing of data analysispipelines Jan 24, 2017 3 - Alpha N/A - :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 Mar 16, 2022 N/A pytest - :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-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 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 Mar 19, 2020 5 - Production/Stable pytest (>=3.50) - :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A - :pypi:`pytest-pointers` Pytest plugin to define functions you test with special marks for better navigation and reports Oct 14, 2021 N/A N/A - :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-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 - :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Apr 20, 2022 5 - Production/Stable pytest - :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest - :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :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-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) Dec 28, 2021 5 - Production/Stable pytest (>=6) - :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) - :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A - :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 May 05, 2022 5 - Production/Stable pytest - :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A - :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) - :pypi:`pytest-ptera` Use ptera probes in tests Mar 01, 2022 N/A pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) - :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha 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 Mar 13, 2022 3 - Alpha N/A - :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 Mar 13, 2022 3 - Alpha N/A - :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :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) - :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 15, 2021 5 - Production/Stable pytest - :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Aug 16, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.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-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest - :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. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) - :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 Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A - :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 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) - :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A - :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A - :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest - :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) - :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. Jan 10, 2022 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 Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Mar 31, 2022 3 - Alpha N/A - :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 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-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest - :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A - :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A - :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A - :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) - :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. Dec 21, 2021 3 - Alpha pytest (>=4.6) - :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 30, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest - :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest - :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-replay` Saves previous test runs and allow re-execute previous pytest runs to reproduce crashes or flaky tests Jun 09, 2021 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance Dec 16, 2021 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 Jul 22, 2021 4 - Beta pytest - :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Jun 08, 2021 4 - Beta N/A - :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 Dec 11, 2020 3 - Alpha pytest (>=5.2) - :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 Apr 26, 2022 N/A pytest (>=3.8.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-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 Jun 17, 2021 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-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) - :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-resilient-circuits` Resilient Circuits fixtures for PyTest. Apr 13, 2022 N/A N/A - :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 01, 2021 5 - Production/Stable pytest (>=3.5.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 Apr 26, 2021 N/A pytest (>=2.5) - :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-reverse` Pytest plugin to reverse test order. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) - :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) - :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A - :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 Jul 29, 2021 5 - Production/Stable pytest - :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) - :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest - :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-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-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A 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 Apr 06, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) - :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A - :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 02, 2022 5 - Production/Stable N/A - :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A - :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A - :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 02, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A - :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest - :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. Nov 27, 2021 4 - Beta N/A - :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A - :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 - :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-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest - :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 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 May 28, 2019 5 - Production/Stable pytest - :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 - :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-markers` Pytest Salt Plugin Feb 22, 2022 5 - Production/Stable pytest (>=6.0.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) - :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A N/A - :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A - :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A - :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-smell` Automated bad smell detection tool for Pytest May 02, 2022 N/A N/A - :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest - :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) - :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A - :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A - :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) - :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest - :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' - :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Apr 11, 2022 2 - Pre-Alpha pytest - :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. Feb 23, 2020 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. May 04, 2021 N/A N/A - :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A - :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A - :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) - :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) - :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 Apr 19, 2022 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 Mar 13, 2018 3 - Alpha N/A - :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest - :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 N/A - :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest - :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A - :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) - :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-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A - :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A - :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 Sep 21, 2021 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) - :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-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) - :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 13, 2022 4 - Beta pytest (>=7.0) - :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A - :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). Jul 06, 2020 3 - Alpha N/A - :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' - :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest - :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-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-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A - :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A - :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A - :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) - :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A - :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 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-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-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest - :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) - :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A - :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest - :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) - :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Mar 11, 2022 N/A pytest (>=5.5) - :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest - :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A - :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A - :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 05, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest - :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A - :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) - :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) - :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) - :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A - :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A - :pypi:`pytest-threadleak` Detects thread leaks Jan 18, 2022 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A - :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A - :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A - :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A - :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) - :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest - :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A - :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest - :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A 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 - :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) - :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A - :pypi:`pytest-tornasync` py.test plugin for testing Python 3.5+ Tornado code Jul 15, 2019 3 - Alpha pytest (>=3.0) - :pypi:`pytest-track` Feb 26, 2021 3 - Alpha pytest (>=3.0) - :pypi:`pytest-translations` Test your translation files. Nov 05, 2021 5 - Production/Stable N/A - :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-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 Oct 16, 2020 N/A N/A - :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) - :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) - :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) for Pytest, automatically launched after your test run is finished May 02, 2022 4 - Beta pytest (>=6.2.5) - :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A - :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) - :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-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-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) - :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 Mar 28, 2021 4 - Beta N/A - :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Apr 12, 2022 4 - Beta pytest (>=3.5.0) - :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. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest - :pypi:`pytest-valgrind` May 19, 2021 N/A N/A - :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A - :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Apr 21, 2022 4 - Beta pytest (>=6.2.2,<7.0.0) - :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest - :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A - :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest - :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 May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest - :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A - :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) - :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A - :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A - :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A - :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A - :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A - :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 - :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A - :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest - :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Dec 10, 2021 5 - Production/Stable pytest (>=6.2.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-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) - :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-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jul 28, 2021 4 - Beta pytest (>=2.8) - :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A - :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) - :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) - :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) - :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-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-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) - :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-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A - :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 - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) - :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest - =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ + =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ + name summary last release status requires + =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ + :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 26, 2022 N/A pytest (>=5.4.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) + :pypi:`pytest-agent` Service that exposes a REST API that can be used to interract remotely with Pytest. It is shipped with a dashboard that enables running tests in a more convenient way. Nov 25, 2021 N/A N/A + :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) + :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest + :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A + :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) + :pypi:`pytest-aiomoto` pytest-aiomoto Mar 13, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) + :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Apr 10, 2022 N/A pytest (>=1.0) + :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest + :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) + :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Feb 21, 2022 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-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest + :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) + :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 Oct 14, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Nov 29, 2021 3 - Alpha pytest (<7.0.0,>=3.2.0) + :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A + :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 + :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest + :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest + :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A + :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' + :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-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A + :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-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) + :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 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) + :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A + :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A + :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-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) + :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A + :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest + :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. May 02, 2022 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) + :pypi:`pytest-atomic` Skip rest of tests if previous test failed. Nov 24, 2018 4 - Beta N/A + :pypi:`pytest-attrib` pytest plugin to select tests based on attributes similar to the nose-attrib plugin May 24, 2016 4 - Beta N/A + :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A + :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A + :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 12, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 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-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest + :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A + :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A + :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) + :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.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-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 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. Apr 17, 2021 5 - Production/Stable pytest (>=3.8) + :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A + :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Aug 05, 2021 N/A pytest (>=5.0) + :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A + :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-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. May 12, 2022 N/A pytest ; extra == 'dev' + :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-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A + :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A + :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A + :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A + :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-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 + :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A + :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Apr 13, 2022 5 - Production/Stable pytest (>=6.2.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) + :pypi:`pytest-buildkite` Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite. Jul 13, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest + :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A + :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data May 02, 2022 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest + :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-caprng` A plugin that replays pRNG state on failure. May 02, 2018 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-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest + :pypi:`pytest-cases` Separate test code from test cases in pytest. May 12, 2022 5 - Production/Stable N/A + :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 + :pypi:`pytest-celery` pytest-celery a shim pytest plugin to enable celery.contrib.pytest May 06, 2021 N/A N/A + :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A + :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A + :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest + :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-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' + :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) + :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) + :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest + :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A + :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A + :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest + :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A + :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A + :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-clld` Nov 29, 2021 N/A pytest (>=3.6) + :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-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) + :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 Apr 12, 2022 4 - Beta pytest (>=4.6.0) + :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-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 + :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 Nov 12, 2020 N/A pytest (>=3.6,<7) + :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) + :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 Mar 18, 2022 4 - Beta N/A + :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 Feb 01, 2022 3 - Alpha 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-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) + :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. Oct 04, 2021 5 - Production/Stable pytest (>=4.6) + :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 Jan 04, 2021 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types May 13, 2022 N/A N/A + :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A + :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) + :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 + :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) + :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A + :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A + :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A + :pypi:`pytest-custom-exit-code` Exit pytest test session with custom exit code in different scenarios Aug 07, 2019 4 - Beta pytest (>=4.0.2) + :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A + :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest + :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A + :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-cython-collect` May 04, 2022 N/A pytest + :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' + :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A + :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A + :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 Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) + :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest + :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-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) + :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A + :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 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-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. Apr 20, 2020 5 - Production/Stable pytest + :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) + :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A + :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A + :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) + :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) + :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' + :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A + :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A + :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A + :pypi:`pytest-defer` Aug 24, 2021 N/A N/A + :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A + :pypi:`pytest-dependency` Manage dependencies of tests Feb 14, 2020 4 - Beta N/A + :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) + :pypi:`pytest-deprecate` Mark tests as testing a deprecated feature with a warning note. Jul 01, 2019 N/A N/A + :pypi:`pytest-describe` Describe-style plugin for pytest Nov 13, 2021 4 - Beta pytest (>=4.0.0) + :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest + :pypi:`pytest-devpi-server` DevPI server fixture for py.test May 28, 2019 5 - Production/Stable pytest + :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 + :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A + :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-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. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.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 04, 2021 4 - Beta N/A + :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-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A + :pypi:`pytest-django-filefield` Replaces FileField.storage with something you can patch globally. May 09, 2022 5 - Production/Stable pytest >= 5.2 + :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A + :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) + :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A + :pypi:`pytest-django-lite` The bare minimum to integrate py.test with Django. Jan 30, 2014 N/A N/A + :pypi:`pytest-django-liveserver-ssl` Jan 20, 2022 3 - Alpha N/A + :pypi:`pytest-django-model` A Simple Way to Test your Django Models Feb 14, 2019 4 - Beta N/A + :pypi:`pytest-django-ordering` A pytest plugin for preserving the order in which Django runs tests. Jul 25, 2019 5 - Production/Stable pytest (>=2.3.0) + :pypi:`pytest-django-queries` Generate performance reports from your django database performance tests. Mar 01, 2021 N/A N/A + :pypi:`pytest-djangorestframework` A djangorestframework plugin for pytest Aug 11, 2019 4 - Beta N/A + :pypi:`pytest-django-rq` A pytest plugin to help writing unit test for django-rq Apr 13, 2020 4 - Beta N/A + :pypi:`pytest-django-sqlcounts` py.test plugin for reporting the number of SQLs executed per django testcase. Jun 16, 2015 4 - Beta N/A + :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Jan 31, 2022 4 - Beta N/A + :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 Apr 09, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 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) + :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) + :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 Nov 23, 2021 3 - Alpha N/A + :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest + :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) + :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest + :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) + :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A + :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A + :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-doctestplus` Pytest plugin with advanced doctest features. Feb 25, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) + :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-drf` A Django REST framework plugin for pytest. Nov 12, 2020 5 - Production/Stable pytest (>=3.6) + :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 May 23, 2020 4 - Beta pytest (>=2.7) + :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` Jun 25, 2021 N/A N/A + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) + :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 Jun 03, 2021 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 + :pypi:`pytest-easy-api` Simple API testing with pytest Mar 26, 2018 N/A N/A + :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A + :pypi:`pytest-easyread` pytest plugin that makes terminal printouts of the reports easier to read Nov 17, 2017 N/A N/A + :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" + :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A + :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A + :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) + :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. Apr 05, 2022 1 - Planning pytest (>=5.4.0) + :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest + :pypi:`pytest-embedded` pytest embedded plugin May 09, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 09, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 09, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 09, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 09, 2022 N/A N/A + :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 09, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 09, 2022 N/A N/A + :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 12, 2022 4 - Beta pytest (==7.0.1) + :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A + :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest + :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A + :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Jun 16, 2017 4 - Beta N/A + :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-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-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-error-for-skips` Pytest plugin to treat skipped tests a test failure Dec 19, 2019 4 - Beta pytest (>=4.6) + :pypi:`pytest-eth` PyTest plugin for testing Smart Contracts for Ethereum Virtual Machine (EVM). Aug 14, 2020 1 - Planning N/A + :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' + :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Aug 13, 2019 N/A pytest (>=4.2.0) + :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' + :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A + :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 Nov 10, 2021 4 - Beta pytest (<6.3,>=4.3) + :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A + :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-expecter` Better testing with expecter and pytest. Jan 10, 2022 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-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) + :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest + :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) + :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest + :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-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. May 13, 2022 6 - Mature pytest (>=5.0.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-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A + :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) + :pypi:`pytest-fail-slow` Fail tests that take too long to run Apr 25, 2022 4 - Beta pytest (>=6.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-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A + :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A + :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 May 09, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A + :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest + :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) + :pypi:`pytest-fauxfactory` Integration of fauxfactory into pytest. Dec 06, 2017 5 - Production/Stable pytest (>=3.2) + :pypi:`pytest-figleaf` py.test figleaf coverage plugin Jan 18, 2010 5 - Production/Stable N/A + :pypi:`pytest-filecov` A pytest plugin to detect unused files Jun 27, 2021 4 - Beta pytest + :pypi:`pytest-filedata` easily load data from files Jan 17, 2019 4 - Beta N/A + :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 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 Jan 09, 2020 3 - Alpha pytest (>=3.0) + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 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` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) + :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest + :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 Aug 25, 2020 N/A pytest (>=3.0) + :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-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 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 Mar 18, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. May 11, 2022 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-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) + :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) + :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. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) + :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) + :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-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A + :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A + :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A + :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A + :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) + :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) + :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 + :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A + :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A + :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) + :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-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. May 04, 2022 N/A N/A + :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest + :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest + :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A + :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) + :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest + :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 Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest + :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-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-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest + :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Apr 01, 2021 5 - Production/Stable N/A + :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. May 11, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A + :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest + :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-hidecaptured` Hide captured output May 04, 2018 4 - Beta pytest (>=2.8.5) + :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest + :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 13, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) + :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A + :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 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 Apr 03, 2022 N/A N/A + :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 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 + :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 Dec 05, 2019 N/A N/A + :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' + :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 Jan 27, 2022 3 - Alpha N/A + :pypi:`pytest-httpx` Send responses to httpx. Feb 05, 2022 5 - Production/Stable pytest (<8.*,>=6.*) + :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) + :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-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest + :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A + :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 May 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A + :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A + :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest + :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A + :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A + :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A + :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-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 13, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules May 10, 2022 4 - Beta N/A + :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A + :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) + :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) + :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) + :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A + :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) + :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-invenio` Pytest fixtures for Invenio. May 05, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A + :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A + :pypi:`pytest-isort` py.test plugin to check import ordering using isort Feb 08, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A + :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A + :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A + :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) + :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 11, 2022 4 - Beta pytest + :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) + :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 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-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest + :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest + :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) + :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A + :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A + :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A + :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. Aug 23, 2021 3 - Alpha pytest (>=3.6,<7) + :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A + :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-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest + :pypi:`pytest-leak-finder` Find the previous test that makes another to fail Apr 18, 2022 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-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest + :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Apr 14, 2022 4 - Beta N/A + :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 + :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest + :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest + :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A + :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) + :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 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 Oct 29, 2021 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) + :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. Jul 25, 2019 4 - Beta pytest (>=3.2) + :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-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A + :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 18, 2022 3 - Alpha pytest + :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha 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-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A + :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A + :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) + :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A + :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-matcher` Match test output against patterns stored in files Dec 10, 2021 5 - Production/Stable N/A + :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 + :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) + :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.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 make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :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 Apr 19, 2022 N/A N/A + :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-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest + :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) + :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) + :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.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 Jan 28, 2022 5 - Production/Stable pytest (>=5.0) + :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 Mar 08, 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. Apr 11, 2022 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-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-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest + :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) + :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest + :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) + :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 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 + :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A + :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest + :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest + :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest + :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest + :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 Jun 10, 2021 N/A N/A + :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) + :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Mar 22, 2022 N/A N/A + :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" + :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" + :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) + :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A + :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Mar 02, 2022 N/A N/A + :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) + :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) + :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) + :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A + :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 Mar 15, 2022 N/A pytest (==6.2.5) + :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 Jul 07, 2021 N/A N/A + :pypi:`pytest-nocustom` Run all tests without custom markers Jul 07, 2021 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 Aug 29, 2021 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-notice` Send pytest execution result email Nov 05, 2020 N/A N/A + :pypi:`pytest-notification` A pytest plugin for sending a desktop notification and playing a sound upon completion of tests Jun 19, 2020 N/A pytest (>=4) + :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest + :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) + :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 Mar 16, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A + :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A + :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A + :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A + :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A + :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A + :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A + :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-operator` Fixtures for Operators May 04, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) + :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 Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" + :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest + :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A + :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A + :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A + :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) + :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) + :pypi:`pytest-parametrization` Simpler PyTest parametrization Nov 30, 2021 5 - Production/Stable pytest + :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 plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest + :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) + :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A + :pypi:`pytest-passrunner` Pytest plugin providing the 'run_on_pass' marker Feb 10, 2021 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-paste-config` Allow setting the path to a paste config file Sep 18, 2013 3 - Alpha N/A + :pypi:`pytest-patches` A contextmanager pytest fixture for handling multiple mock patches Aug 30, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pdb` pytest plugin which adds pdb helper commands related to pytest. Jul 31, 2018 N/A N/A + :pypi:`pytest-peach` pytest plugin for fuzzing with Peach API Security Apr 12, 2019 4 - Beta pytest (>=2.8.7) + :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A + :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A + :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) + :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=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-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A + :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) + :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) + :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) + :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) + :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest + :pypi:`pytest-pilot` Slice in your test base thanks to powerful markers. Oct 09, 2020 5 - Production/Stable N/A + :pypi:`pytest-pings` 🦊 The pytest plugin for Firefox Telemetry 📊 Jun 29, 2019 3 - Alpha pytest (>=5.0.0) + :pypi:`pytest-pinned` A simple pytest plugin for pinning tests Sep 17, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pinpoint` A pytest plugin which runs SBFL algorithms to detect faults. Sep 25, 2020 N/A pytest (>=4.4.0) + :pypi:`pytest-pipeline` Pytest plugin for functional testing of data analysispipelines Jan 24, 2017 3 - Alpha N/A + :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 Mar 16, 2022 N/A pytest + :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-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 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 Mar 19, 2020 5 - Production/Stable pytest (>=3.50) + :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A + :pypi:`pytest-pointers` Pytest plugin to define functions you test with special marks for better navigation and reports Oct 14, 2021 N/A N/A + :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-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 + :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Apr 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest + :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) + :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-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) Dec 28, 2021 5 - Production/Stable pytest (>=6) + :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) + :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A + :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 May 05, 2022 5 - Production/Stable pytest + :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A + :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) + :pypi:`pytest-ptera` Use ptera probes in tests Mar 01, 2022 N/A pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) + :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha 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 Mar 13, 2022 3 - Alpha N/A + :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 Mar 13, 2022 3 - Alpha N/A + :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) + :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) + :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 15, 2021 5 - Production/Stable pytest + :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Aug 16, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.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-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest + :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. Jun 26, 2021 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) + :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 Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A + :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 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) + :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A + :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A + :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest + :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) + :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. May 11, 2022 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 Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Mar 31, 2022 3 - Alpha N/A + :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 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-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest + :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A + :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A + :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A + :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) + :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. Dec 21, 2021 3 - Alpha pytest (>=4.6) + :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 30, 2021 4 - Beta pytest (>=4.6) + :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest + :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest + :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-replay` Saves previous test runs and allow re-execute previous pytest runs to reproduce crashes or flaky tests Jun 09, 2021 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance Dec 16, 2021 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 Jul 22, 2021 4 - Beta pytest + :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Jun 08, 2021 4 - Beta N/A + :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 Dec 11, 2020 3 - Alpha pytest (>=5.2) + :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 Apr 26, 2022 N/A pytest (>=3.8.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-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 Jun 17, 2021 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-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) + :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-resilient-circuits` Resilient Circuits fixtures for PyTest. Apr 13, 2022 N/A N/A + :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 01, 2021 5 - Production/Stable pytest (>=3.5.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 Apr 26, 2021 N/A pytest (>=2.5) + :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A + :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) + :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A + :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 Jul 29, 2021 5 - Production/Stable pytest + :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) + :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest + :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-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-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A + :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). May 10, 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 May 09, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) + :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A + :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A + :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A + :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 14, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A + :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest + :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 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-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A + :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 + :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-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest + :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 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 May 28, 2019 5 - Production/Stable pytest + :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 + :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-markers` Pytest Salt Plugin May 09, 2022 5 - Production/Stable pytest (>=6.0.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) + :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A N/A + :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A + :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A + :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-smell` Automated bad smell detection tool for Pytest May 02, 2022 N/A N/A + :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest + :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) + :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A + :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A + :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) + :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest + :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' + :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Apr 11, 2022 2 - Pre-Alpha pytest + :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. Feb 23, 2020 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. May 04, 2021 N/A N/A + :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A + :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A + :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) + :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) + :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 Apr 19, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 Mar 13, 2018 3 - Alpha N/A + :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest + :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 N/A + :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest + :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A + :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) + :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-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A + :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A + :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 Sep 21, 2021 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) + :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-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 13, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A + :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). Jul 06, 2020 3 - Alpha N/A + :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' + :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest + :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-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-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A + :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A + :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A + :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) + :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A + :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A + :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 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-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-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest + :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A + :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) + :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A + :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest + :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) + :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Mar 11, 2022 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest + :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A + :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A + :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 10, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest + :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A + :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) + :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) + :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) + :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A + :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A + :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A + :pypi:`pytest-threadleak` Detects thread leaks Jan 18, 2022 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A + :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A + :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A + :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A + :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) + :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) + :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest + :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A + :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest + :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A 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 + :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) + :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A + :pypi:`pytest-tornasync` py.test plugin for testing Python 3.5+ Tornado code Jul 15, 2019 3 - Alpha pytest (>=3.0) + :pypi:`pytest-track` Feb 26, 2021 3 - Alpha pytest (>=3.0) + :pypi:`pytest-translations` Test your translation files. Nov 05, 2021 5 - Production/Stable N/A + :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-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 Oct 16, 2020 N/A N/A + :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) + :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) + :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) for Pytest, automatically launched after your test run is finished May 02, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A + :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) + :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-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-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) + :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 Mar 28, 2021 4 - Beta N/A + :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Apr 12, 2022 4 - Beta pytest (>=3.5.0) + :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. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest + :pypi:`pytest-valgrind` May 19, 2021 N/A N/A + :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A + :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Apr 21, 2022 4 - Beta pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest + :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest + :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A + :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest + :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 May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest + :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A + :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) + :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A + :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A + :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A + :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A + :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A + :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 + :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A + :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest + :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Dec 10, 2021 5 - Production/Stable pytest (>=6.2.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-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) + :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-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A + :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jul 28, 2021 4 - Beta pytest (>=2.8) + :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A + :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) + :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) + :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) + :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-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-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) + :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-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A + :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 + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) + :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest + =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ .. only:: latex @@ -1312,7 +1316,7 @@ This list contains 1043 plugins. Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures :pypi:`pytest-api` - *last release*: May 07, 2022, + *last release*: May 12, 2022, *status*: N/A, *requires*: pytest (>=7.1.1,<8.0.0) @@ -1340,9 +1344,9 @@ This list contains 1043 plugins. Pytest plugin for appium :pypi:`pytest-approvaltests` - *last release*: Feb 07, 2021, + *last release*: May 08, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=7.0.1) A plugin to use approvaltests with pytest @@ -1494,9 +1498,9 @@ This list contains 1043 plugins. automatically check condition and log all the checks :pypi:`pytest-automation` - *last release*: Oct 01, 2021, + *last release*: May 12, 2022, *status*: N/A, - *requires*: pytest + *requires*: pytest (>=7.0.0) pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. @@ -1669,7 +1673,7 @@ This list contains 1043 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: Mar 11, 2022, + *last release*: May 12, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -1879,7 +1883,7 @@ This list contains 1043 plugins. pytest plugin to capture all warnings and put them in one file of your choice :pypi:`pytest-cases` - *last release*: Mar 21, 2022, + *last release*: May 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2243,7 +2247,7 @@ This list contains 1043 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: May 06, 2022, + *last release*: May 13, 2022, *status*: N/A, *requires*: N/A @@ -2677,7 +2681,7 @@ This list contains 1043 plugins. Factories for your Django models that can be used as Pytest fixtures. :pypi:`pytest-django-filefield` - *last release*: May 06, 2022, + *last release*: May 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest >= 5.2 @@ -3111,35 +3115,35 @@ This list contains 1043 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A @@ -3153,14 +3157,14 @@ This list contains 1043 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A @@ -3398,7 +3402,7 @@ This list contains 1043 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: May 02, 2022, + *last release*: May 13, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -3474,6 +3478,13 @@ This list contains 1043 plugins. + :pypi:`pytest-fastapi-deps` + *last release*: May 09, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + A fixture which allows easy replacement of fastapi dependencies for testing + :pypi:`pytest-fastest` *last release*: Mar 05, 2020, *status*: N/A, @@ -3629,7 +3640,7 @@ This list contains 1043 plugins. pytest plugin to check FLAKE8 requirements :pypi:`pytest-flake8-path` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3944,7 +3955,7 @@ This list contains 1043 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.2,<7.0.0) @@ -4000,7 +4011,7 @@ This list contains 1043 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 07, 2022, + *last release*: May 13, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4252,7 +4263,7 @@ This list contains 1043 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: Apr 26, 2022, + *last release*: May 13, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4272,6 +4283,13 @@ This list contains 1043 plugins. Common fixtures for inmanta LSM related modules + :pypi:`pytest-inmanta-yang` + *last release*: May 10, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Common fixtures used in inmanta yang related modules + :pypi:`pytest-Inomaly` *last release*: Feb 13, 2018, *status*: 4 - Beta, @@ -4364,7 +4382,7 @@ This list contains 1043 plugins. py.test plugin to check import ordering using isort :pypi:`pytest-is-running` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4406,8 +4424,8 @@ This list contains 1043 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Mar 09, 2022, - *status*: 3 - Alpha, + *last release*: May 11, 2022, + *status*: 4 - Beta, *requires*: pytest pytest plugin to integrate tests with JIRA XRAY @@ -4749,7 +4767,7 @@ This list contains 1043 plugins. Test your markdown docs with pytest :pypi:`pytest-markdown-docs` - *last release*: Apr 07, 2022, + *last release*: May 12, 2022, *status*: N/A, *requires*: N/A @@ -6198,7 +6216,7 @@ This list contains 1043 plugins. py.test plugin to randomize tests :pypi:`pytest-randomly` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6520,7 +6538,7 @@ This list contains 1043 plugins. py.test integration for responses :pypi:`pytest-restrict` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6534,7 +6552,7 @@ This list contains 1043 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-reverse` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6645,6 +6663,13 @@ This list contains 1043 plugins. Call runtime_xfail() to mark running test as xfail. + :pypi:`pytest-saccharin` + *last release*: May 10, 2022, + *status*: 3 - Alpha, + *requires*: N/A + + 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). + :pypi:`pytest-salt` *last release*: Jan 27, 2020, *status*: 4 - Beta, @@ -6660,7 +6685,7 @@ This list contains 1043 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Apr 06, 2022, + *last release*: May 09, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6702,7 +6727,7 @@ This list contains 1043 plugins. :pypi:`pytest-sbase` - *last release*: May 02, 2022, + *last release*: May 14, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6744,7 +6769,7 @@ This list contains 1043 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: May 02, 2022, + *last release*: May 14, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6786,7 +6811,7 @@ This list contains 1043 plugins. Extensible server fixures for py.test :pypi:`pytest-serverless` - *last release*: Nov 27, 2021, + *last release*: May 09, 2022, *status*: 4 - Beta, *requires*: N/A @@ -6905,7 +6930,7 @@ This list contains 1043 plugins. Allow for multiple processes to log to a single file :pypi:`pytest-skip-markers` - *last release*: Feb 22, 2022, + *last release*: May 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -7325,7 +7350,7 @@ This list contains 1043 plugins. Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 :pypi:`pytest-super-check` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -7556,7 +7581,7 @@ This list contains 1043 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: May 05, 2022, + *last release*: May 10, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -7632,6 +7657,13 @@ This list contains 1043 plugins. pytest-ligo + :pypi:`pytest-th2-bdd` + *last release*: May 13, 2022, + *status*: N/A, + *requires*: N/A + + pytest_th2_bdd + :pypi:`pytest-thawgun` *last release*: May 26, 2020, *status*: 3 - Alpha, From 73c2d1c6e37d3c3350cbe980c2c18f4aa8d90581 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 16 May 2022 22:52:27 +0200 Subject: [PATCH 079/255] Remove "Python 2.7 and 3.4 Support" from globaltoc Follow up to #9957 - I missed that the globaltoc is hard-coded and the page needs to be removed there as well. --- doc/en/_templates/globaltoc.html | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/en/_templates/globaltoc.html b/doc/en/_templates/globaltoc.html index 7c595e7ebf2..9bd144903b1 100644 --- a/doc/en/_templates/globaltoc.html +++ b/doc/en/_templates/globaltoc.html @@ -17,7 +17,6 @@

About the project

  • Changelog
  • Contributing
  • Backwards Compatibility
  • -
  • Python 2.7 and 3.4 Support
  • Sponsor
  • pytest for Enterprise
  • License
  • From ee10ecdf7eb20033b8b46e56ae257a0344712b8a Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 16 May 2022 23:01:54 +0200 Subject: [PATCH 080/255] Reorder the reference guides in the docs This changes the order to: - API Reference - Fixtures reference - Configuration - Exit codes - Plugin List which is approximately sorted from general to specific and often used to less used. Plugin List ist at the end because it points to further external resources. --- doc/en/reference/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/reference/index.rst b/doc/en/reference/index.rst index d9648400317..ee1b2e6214d 100644 --- a/doc/en/reference/index.rst +++ b/doc/en/reference/index.rst @@ -8,8 +8,8 @@ Reference guides .. toctree:: :maxdepth: 1 + reference fixtures - plugin_list customize - reference exit-codes + plugin_list From 296b642eb3cc1c14fa4ebc0e748442ed968b8007 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Tue, 17 May 2022 07:29:32 +0200 Subject: [PATCH 081/255] Fix rst markup in TempdirFactory's docstring. --- src/_pytest/legacypath.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index 37e8c24220e..ac23888c722 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -270,8 +270,8 @@ def testdir(pytester: Pytester) -> Testdir: @final @attr.s(init=False, auto_attribs=True) class TempdirFactory: - """Backward compatibility wrapper that implements :class:``_pytest.compat.LEGACY_PATH`` - for :class:``TempPathFactory``.""" + """Backward compatibility wrapper that implements :class:`_pytest.compat.LEGACY_PATH` + for :class:`TempPathFactory`.""" _tmppath_factory: TempPathFactory From a1ed6839e38eecae809360f7641406aec3ba029b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 17 May 2022 08:09:21 -0300 Subject: [PATCH 082/255] Refer to py.path.local instead of LEGACY_PATH constant for better docs --- .pre-commit-config.yaml | 2 +- src/_pytest/legacypath.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c5856cdd8c7..189aa5b912d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -101,7 +101,7 @@ repos: types: [python] - id: py-path-deprecated name: py.path usage is deprecated - exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py + exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py|src/_pytest/legacypath.py language: pygrep entry: \bpy\.path\.local types: [python] diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index ac23888c722..49149311a7d 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -270,7 +270,7 @@ def testdir(pytester: Pytester) -> Testdir: @final @attr.s(init=False, auto_attribs=True) class TempdirFactory: - """Backward compatibility wrapper that implements :class:`_pytest.compat.LEGACY_PATH` + """Backward compatibility wrapper that implements :class:`py.path.local` for :class:`TempPathFactory`.""" _tmppath_factory: TempPathFactory @@ -282,11 +282,11 @@ def __init__( self._tmppath_factory = tmppath_factory def mktemp(self, basename: str, numbered: bool = True) -> LEGACY_PATH: - """Same as :meth:`TempPathFactory.mktemp`, but returns a ``_pytest.compat.LEGACY_PATH`` object.""" + """Same as :meth:`TempPathFactory.mktemp`, but returns a :class:`py.path.local` object.""" return legacy_path(self._tmppath_factory.mktemp(basename, numbered).resolve()) def getbasetemp(self) -> LEGACY_PATH: - """Backward compat wrapper for ``_tmppath_factory.getbasetemp``.""" + """Same as :meth:`TempPathFactory.getbasetemp`, but returns a :class:`py.path.local` object.""" return legacy_path(self._tmppath_factory.getbasetemp().resolve()) From 0e62861e847eeca1fb76bd63a03b1c5d5ef23206 Mon Sep 17 00:00:00 2001 From: Pete Baughman <99513503+petebman@users.noreply.github.com> Date: Mon, 23 May 2022 17:44:27 +0000 Subject: [PATCH 083/255] Improve error message in getfixturevalue --- changelog/9984.trivial.rst | 4 ++++ src/_pytest/fixtures.py | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 changelog/9984.trivial.rst diff --git a/changelog/9984.trivial.rst b/changelog/9984.trivial.rst new file mode 100644 index 00000000000..cca8170629c --- /dev/null +++ b/changelog/9984.trivial.rst @@ -0,0 +1,4 @@ +Improve the error message when we attempt to access a fixture that has been +torn down. +Add an additional sentence to the docstring explaining when it's not a good +idea to call getfixturevalue. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index ee3e93f1908..af5b449d0d3 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -548,11 +548,18 @@ def getfixturevalue(self, argname: str) -> Any: setup time, you may use this function to retrieve it inside a fixture or test function body. + This method can be used during the test setup phase or the test run + phase, but during the test teardown phase a fixture's value may not + be available. + :raises pytest.FixtureLookupError: If the given fixture could not be found. """ fixturedef = self._get_active_fixturedef(argname) - assert fixturedef.cached_result is not None + assert fixturedef.cached_result is not None, ( + f'The fixture value for "{argname}" is not available. ' + "This can happen when the fixture has already been torn down." + ) return fixturedef.cached_result[0] def _get_active_fixturedef( From 8ac6dce2c7ec1083e849417379e13b354d5aecfd Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Tue, 24 May 2022 01:20:51 -0700 Subject: [PATCH 084/255] Add shell-style wildcard support to 'testpaths' (#9897) This is especially useful for large repositories (e.g. monorepos) that use a hierarchical file system organization for nested test paths. src/*/tests The implementation uses the standard `glob` module to perform wildcard expansion in Config.parse(). The related logic that determines whether or not to include 'testpaths' in the terminal header was previously relying on a weak heuristic: if Config.args matched 'testpaths', then its value was printed. That generally worked, but it could also print when the user explicitly used the same arguments on the command-line as listed in 'testpaths'. Not a big deal, but it shows that the check was logically incorrect. Now that 'testpaths' can contain wildcards, it's no longer possible to perform this simple comparison, so this change also introduces a public Config.ArgSource enum and Config.args_source attribute that explicitly names the "source" of the arguments: the command line, the invocation directory, or the 'testdata' configuration value. --- AUTHORS | 1 + changelog/9897.feature.rst | 1 + doc/en/reference/reference.rst | 2 ++ src/_pytest/config/__init__.py | 26 +++++++++++++++++++++++++- src/_pytest/terminal.py | 4 ++-- testing/test_collection.py | 18 +++++++++++------- 6 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 changelog/9897.feature.rst diff --git a/AUTHORS b/AUTHORS index 86a814a137b..6baf9be2bd9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -165,6 +165,7 @@ Jeff Widman Jenni Rinker John Eddie Ayson John Towler +Jon Parise Jon Sonesen Jonas Obrist Jordan Guymon diff --git a/changelog/9897.feature.rst b/changelog/9897.feature.rst new file mode 100644 index 00000000000..7464067bfcd --- /dev/null +++ b/changelog/9897.feature.rst @@ -0,0 +1 @@ +Added shell-style wildcard support to ``testpaths``. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index d082697258c..c1fb47e33b9 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1699,6 +1699,8 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets list of directories that should be searched for tests when no specific directories, files or test ids are given in the command line when executing pytest from the :ref:`rootdir ` directory. + File system paths may use shell-style wildcards, including the recursive + ``**`` pattern. Useful when all project tests are in a known location to speed up test collection and to avoid picking up undesired tests by accident. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 05abaa8eda6..dfbda68ea78 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -3,6 +3,7 @@ import collections.abc import copy import enum +import glob import inspect import os import re @@ -899,6 +900,19 @@ class InvocationParams: dir: Path """The directory from which :func:`pytest.main` was invoked.""" + class ArgsSource(enum.Enum): + """Indicates the source of the test arguments. + + .. versionadded:: 7.2 + """ + + #: Command line arguments. + ARGS = enum.auto() + #: Invocation directory. + INCOVATION_DIR = enum.auto() + #: 'testpaths' configuration value. + TESTPATHS = enum.auto() + def __init__( self, pluginmanager: PytestPluginManager, @@ -1308,15 +1322,25 @@ def parse(self, args: List[str], addopts: bool = True) -> None: self.hook.pytest_cmdline_preparse(config=self, args=args) self._parser.after_preparse = True # type: ignore try: + source = Config.ArgsSource.ARGS args = self._parser.parse_setoption( args, self.option, namespace=self.option ) if not args: if self.invocation_params.dir == self.rootpath: - args = self.getini("testpaths") + source = Config.ArgsSource.TESTPATHS + testpaths: List[str] = self.getini("testpaths") + if self.known_args_namespace.pyargs: + args = testpaths + else: + args = [] + for path in testpaths: + args.extend(sorted(glob.iglob(path, recursive=True))) if not args: + source = Config.ArgsSource.INCOVATION_DIR args = [str(self.invocation_params.dir)] self.args = args + self.args_source = source except PrintHelp: pass diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index bb07b3ce7c6..8e47f26045a 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -730,8 +730,8 @@ def pytest_report_header(self, config: Config) -> List[str]: if config.inipath: line += ", configfile: " + bestrelpath(config.rootpath, config.inipath) - testpaths: List[str] = config.getini("testpaths") - if config.invocation_params.dir == config.rootpath and config.args == testpaths: + if config.args_source == Config.ArgsSource.TESTPATHS: + testpaths: List[str] = config.getini("testpaths") line += ", testpaths: {}".format(", ".join(testpaths)) result = [line] diff --git a/testing/test_collection.py b/testing/test_collection.py index 9099ec57fca..58e1d862a35 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -244,28 +244,32 @@ def test_testpaths_ini(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> No pytester.makeini( """ [pytest] - testpaths = gui uts + testpaths = */tests """ ) tmp_path = pytester.path - ensure_file(tmp_path / "env" / "test_1.py").write_text("def test_env(): pass") - ensure_file(tmp_path / "gui" / "test_2.py").write_text("def test_gui(): pass") - ensure_file(tmp_path / "uts" / "test_3.py").write_text("def test_uts(): pass") + ensure_file(tmp_path / "a" / "test_1.py").write_text("def test_a(): pass") + ensure_file(tmp_path / "b" / "tests" / "test_2.py").write_text( + "def test_b(): pass" + ) + ensure_file(tmp_path / "c" / "tests" / "test_3.py").write_text( + "def test_c(): pass" + ) # executing from rootdir only tests from `testpaths` directories # are collected items, reprec = pytester.inline_genitems("-v") - assert [x.name for x in items] == ["test_gui", "test_uts"] + 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 ("env", "gui", "uts"): + for dirname in ("a", "b", "c"): items, reprec = pytester.inline_genitems(tmp_path.joinpath(dirname)) assert [x.name for x in items] == ["test_%s" % dirname] # changing cwd to each subdirectory and running pytest without # arguments collects the tests in that directory normally - for dirname in ("env", "gui", "uts"): + for dirname in ("a", "b", "c"): monkeypatch.chdir(pytester.path.joinpath(dirname)) items, reprec = pytester.inline_genitems() assert [x.name for x in items] == ["test_%s" % dirname] From 9a9acf13f89da7578d0b16b48e92ea09102eb755 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 24 May 2022 10:23:39 +0200 Subject: [PATCH 085/255] Declutter doc entry page (#9969) - Remove the index page https://docs.pytest.org/en/7.1.x/genindex.html Such an index is reasonable in books but not so much in HTML pages. IMHO the integrated search is much more user-friendly and sufficient. - Remove the PDF link from the entry page. The PDF is already linked in the sidebar. I anticipate that getting the PDF documentation is not a major concern for users. - Remove the sections "Changelog" and "License" from the entry page. These section only contain links to the respective pages. These topics are purely technical. They should be easily accessible (which they still are through sidebar section "About the project"), but they don't need additional advertisement through a dedicated section on the entry page. --- doc/en/_templates/globaltoc.html | 2 -- doc/en/conf.py | 2 +- doc/en/index.rst | 17 ----------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/doc/en/_templates/globaltoc.html b/doc/en/_templates/globaltoc.html index 9bd144903b1..09d970b64ed 100644 --- a/doc/en/_templates/globaltoc.html +++ b/doc/en/_templates/globaltoc.html @@ -29,5 +29,3 @@

    About the project

    {%- endif %}
    -Index -
    diff --git a/doc/en/conf.py b/doc/en/conf.py index 1adc3493ad5..5aedd2d322d 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -247,7 +247,7 @@ html_domain_indices = True # If false, no index is generated. -html_use_index = True +html_use_index = False # If true, the index is split into individual pages for each letter. # html_split_index = False diff --git a/doc/en/index.rst b/doc/en/index.rst index 03a39aaaae8..8b4528ddf2d 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -27,8 +27,6 @@ scale to support complex functional testing for applications and libraries. **PyPI package name**: :pypi:`pytest` -**Documentation as PDF**: `download latest `_ - A quick example --------------- @@ -104,11 +102,6 @@ Bugs/Requests Please use the `GitHub issue tracker `_ to submit bugs or request features. -Changelog ---------- - -Consult the :ref:`Changelog ` page for fixes and enhancements of each version. - Support pytest -------------- @@ -141,13 +134,3 @@ Security pytest has never been associated with a security vulnerability, but in any case, to report a security vulnerability please use the `Tidelift security contact `_. Tidelift will coordinate the fix and disclosure. - - -License -------- - -Copyright Holger Krekel and others, 2004. - -Distributed under the terms of the `MIT`_ license, pytest is free and open source software. - -.. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE From 31f9e5bcdd3396ac0daf6d35c9d8aa8a2cd72993 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 11:12:31 +0200 Subject: [PATCH 086/255] [automated] Update plugin list (#9985) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 124 +++++++++++++++++-------------- 1 file changed, 70 insertions(+), 54 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 6def59d1b14..8b1202fca31 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1047 plugins. +This list contains 1049 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1047 plugins. name summary last release status requires =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 26, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 17, 2022 N/A pytest (>=5.4.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) @@ -78,8 +78,9 @@ This list contains 1047 plugins. :pypi:`pytest-atomic` Skip rest of tests if previous test failed. Nov 24, 2018 4 - Beta N/A :pypi:`pytest-attrib` pytest plugin to select tests based on attributes similar to the nose-attrib plugin May 24, 2016 4 - Beta N/A :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A + :pypi:`pytest-autocap` automatically capture test & fixture stdout/stderr to files May 15, 2022 N/A pytest (<7.2,>=7.1.2) :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A - :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 12, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 20, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 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-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest @@ -104,7 +105,7 @@ This list contains 1047 plugins. :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :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-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. May 12, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. May 17, 2022 N/A pytest ; extra == 'dev' :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 @@ -134,7 +135,7 @@ This list contains 1047 plugins. :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 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-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest - :pypi:`pytest-cases` Separate test code from test cases in pytest. May 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-cases` Separate test code from test cases in pytest. May 20, 2022 5 - Production/Stable N/A :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 @@ -168,7 +169,7 @@ This list contains 1047 plugins. :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable 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 Nov 12, 2020 N/A pytest (>=3.6,<7) + :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :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 @@ -351,7 +352,7 @@ This list contains 1047 plugins. :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-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. May 13, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 21, 2022 6 - Mature pytest (>=5.0.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-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A @@ -379,7 +380,7 @@ This list contains 1047 plugins. :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest :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 Aug 25, 2020 N/A pytest (>=3.0) + :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order May 16, 2022 5 - Production/Stable pytest (>=3.0) :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-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest @@ -419,7 +420,7 @@ This list contains 1047 plugins. :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality May 19, 2022 4 - Beta pytest :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 Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest @@ -438,7 +439,7 @@ This list contains 1047 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 13, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 19, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -474,9 +475,9 @@ This list contains 1047 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :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-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 13, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules May 10, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -512,7 +513,7 @@ This list contains 1047 plugins. :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :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. Aug 23, 2021 3 - Alpha pytest (>=3.6,<7) + :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A :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) @@ -560,7 +561,7 @@ This list contains 1047 plugins. :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 make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :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 Apr 19, 2022 N/A N/A + :pypi:`pytest-memray` A simple plugin to use with pytest May 17, 2022 N/A N/A :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-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) @@ -574,7 +575,7 @@ This list contains 1047 plugins. :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 Jan 28, 2022 5 - Production/Stable pytest (>=5.0) :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 Mar 08, 2022 5 - Production/Stable N/A + :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 @@ -587,7 +588,7 @@ This list contains 1047 plugins. :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 5 - Production/Stable pytest + :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. May 18, 2022 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 :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A @@ -595,7 +596,7 @@ This list contains 1047 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin May 17, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -639,8 +640,8 @@ This list contains 1047 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators May 04, 2022 N/A pytest + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi May 18, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-operator` Fixtures for Operators May 19, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -758,7 +759,7 @@ This list contains 1047 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 Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Mar 31, 2022 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. May 16, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 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-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -826,13 +827,13 @@ This list contains 1047 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 21, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 21, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -846,7 +847,7 @@ This list contains 1047 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-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system May 20, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 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) @@ -863,7 +864,7 @@ This list contains 1047 plugins. :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :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-smell` Automated bad smell detection tool for Pytest May 02, 2022 N/A N/A + :pypi:`pytest-smell` Automated bad smell detection tool for Pytest May 17, 2022 N/A N/A :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A @@ -948,7 +949,7 @@ This list contains 1047 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 10, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 16, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -1052,6 +1053,7 @@ This list contains 1047 plugins. :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) + :pypi:`pytest-xreport` May 17, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) :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-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) @@ -1062,7 +1064,7 @@ This list contains 1047 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :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 - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting May 20, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -1078,7 +1080,7 @@ This list contains 1047 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Apr 26, 2022, + *last release*: May 17, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1490,6 +1492,13 @@ This list contains 1047 plugins. Austin plugin for pytest + :pypi:`pytest-autocap` + *last release*: May 15, 2022, + *status*: N/A, + *requires*: pytest (<7.2,>=7.1.2) + + automatically capture test & fixture stdout/stderr to files + :pypi:`pytest-autochecklog` *last release*: Apr 25, 2015, *status*: 4 - Beta, @@ -1498,7 +1507,7 @@ This list contains 1047 plugins. automatically check condition and log all the checks :pypi:`pytest-automation` - *last release*: May 12, 2022, + *last release*: May 20, 2022, *status*: N/A, *requires*: pytest (>=7.0.0) @@ -1673,7 +1682,7 @@ This list contains 1047 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: May 12, 2022, + *last release*: May 17, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -1883,7 +1892,7 @@ This list contains 1047 plugins. pytest plugin to capture all warnings and put them in one file of your choice :pypi:`pytest-cases` - *last release*: May 12, 2022, + *last release*: May 20, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2121,9 +2130,9 @@ This list contains 1047 plugins. An interactive GUI test runner for PyTest :pypi:`pytest-common-subject` - *last release*: Nov 12, 2020, + *last release*: May 15, 2022, *status*: N/A, - *requires*: pytest (>=3.6,<7) + *requires*: pytest (>=3.6,<8) pytest framework for testing different aspects of a common method @@ -3402,7 +3411,7 @@ This list contains 1047 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: May 13, 2022, + *last release*: May 21, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -3598,8 +3607,8 @@ This list contains 1047 plugins. A pytest plugin to add markers based on fixtures used. :pypi:`pytest-fixture-order` - *last release*: Aug 25, 2020, - *status*: N/A, + *last release*: May 16, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=3.0) pytest plugin to control fixture evaluation order @@ -3878,7 +3887,7 @@ This list contains 1047 plugins. py.test plugin to ignore the same files as git :pypi:`pytest-glamor-allure` - *last release*: Nov 26, 2021, + *last release*: May 19, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4011,7 +4020,7 @@ This list contains 1047 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 13, 2022, + *last release*: May 19, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4263,7 +4272,7 @@ This list contains 1047 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: May 13, 2022, + *last release*: May 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4277,7 +4286,7 @@ This list contains 1047 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Apr 29, 2022, + *last release*: May 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4529,9 +4538,9 @@ This list contains 1047 plugins. Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks :pypi:`pytest-lambda` - *last release*: Aug 23, 2021, + *last release*: May 17, 2022, *status*: 3 - Alpha, - *requires*: pytest (>=3.6,<7) + *requires*: pytest (>=3.6,<8) Define pytest fixtures with lambda functions. @@ -4865,7 +4874,7 @@ This list contains 1047 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: Apr 19, 2022, + *last release*: May 17, 2022, *status*: N/A, *requires*: N/A @@ -4963,7 +4972,7 @@ This list contains 1047 plugins. A mock API server with configurable routes and responses available as a fixture. :pypi:`pytest-mock-generator` - *last release*: Mar 08, 2022, + *last release*: May 16, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -5054,7 +5063,7 @@ This list contains 1047 plugins. pytest plugin for MongoDB fixtures :pypi:`pytest-monitor` - *last release*: Dec 23, 2021, + *last release*: May 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -5110,7 +5119,7 @@ This list contains 1047 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Feb 28, 2022, + *last release*: May 17, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5418,14 +5427,14 @@ This list contains 1047 plugins. A pytest plugin for instrumenting test runs via OpenTelemetry :pypi:`pytest-opentmi` - *last release*: Feb 28, 2022, + *last release*: May 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: May 04, 2022, + *last release*: May 19, 2022, *status*: N/A, *requires*: pytest @@ -6251,7 +6260,7 @@ This list contains 1047 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Mar 31, 2022, + *last release*: May 16, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -6727,7 +6736,7 @@ This list contains 1047 plugins. :pypi:`pytest-sbase` - *last release*: May 14, 2022, + *last release*: May 21, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6769,7 +6778,7 @@ This list contains 1047 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: May 14, 2022, + *last release*: May 21, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6867,7 +6876,7 @@ This list contains 1047 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Feb 21, 2022, + *last release*: May 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6986,7 +6995,7 @@ This list contains 1047 plugins. Smart coverage plugin for pytest. :pypi:`pytest-smell` - *last release*: May 02, 2022, + *last release*: May 17, 2022, *status*: N/A, *requires*: N/A @@ -7581,7 +7590,7 @@ This list contains 1047 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: May 10, 2022, + *last release*: May 16, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -8308,6 +8317,13 @@ This list contains 1047 plugins. + :pypi:`pytest-xreport` + *last release*: May 17, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + + :pypi:`pytest-xvfb` *last release*: Jun 09, 2020, *status*: 4 - Beta, @@ -8379,7 +8395,7 @@ This list contains 1047 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Apr 15, 2022, + *last release*: May 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From c988e49af63a50f0704a46a93e73463666451af0 Mon Sep 17 00:00:00 2001 From: Cheuk Ting Ho Date: Wed, 25 May 2022 06:48:02 -0600 Subject: [PATCH 087/255] Warn when test functions return other than None (#9956) Closes #7337 --- AUTHORS | 1 + changelog/7337.improvement.rst | 1 + doc/en/deprecations.rst | 41 ++++++++++++++++++++++++++++++++++ doc/en/reference/reference.rst | 3 +++ src/_pytest/python.py | 9 ++++++++ src/_pytest/warning_types.py | 7 ++++++ src/pytest/__init__.py | 2 ++ testing/acceptance_test.py | 11 +++++++++ 8 files changed, 75 insertions(+) create mode 100644 changelog/7337.improvement.rst diff --git a/AUTHORS b/AUTHORS index 6baf9be2bd9..af9c7a56bce 100644 --- a/AUTHORS +++ b/AUTHORS @@ -63,6 +63,7 @@ Ceridwen Charles Cloud Charles Machalow Charnjit SiNGH (CCSJ) +Cheuk Ting Ho Chris Lamb Chris NeJame Chris Rose diff --git a/changelog/7337.improvement.rst b/changelog/7337.improvement.rst new file mode 100644 index 00000000000..74d98d9b6c9 --- /dev/null +++ b/changelog/7337.improvement.rst @@ -0,0 +1 @@ +A warning 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` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 91944b758f9..3bbd29bb509 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -252,6 +252,47 @@ or ``pytest.warns(Warning)``. See :ref:`warns use cases` for examples. + +Returning non-None value in test functions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 7.2 + +A :class:`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 ``--strict`` command-line option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index c1fb47e33b9..a4a5fd3fba4 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1130,6 +1130,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.PytestUnhandledCoroutineWarning :show-inheritance: diff --git a/src/_pytest/python.py b/src/_pytest/python.py index cd951939e7a..4d1f722e474 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -77,10 +77,12 @@ from _pytest.pathlib import visit from _pytest.scope import Scope from _pytest.warning_types import PytestCollectionWarning +from _pytest.warning_types import PytestReturnNotNoneWarning from _pytest.warning_types import PytestUnhandledCoroutineWarning if TYPE_CHECKING: from typing_extensions import Literal + from _pytest.scope import _ScopeName @@ -192,6 +194,13 @@ def pytest_pyfunc_call(pyfuncitem: "Function") -> Optional[object]: result = testfunction(**testargs) if hasattr(result, "__await__") or hasattr(result, "__aiter__"): async_warn_and_skip(pyfuncitem.nodeid) + elif result is not None: + warnings.warn( + PytestReturnNotNoneWarning( + f"Expected None, but {pyfuncitem.nodeid} returned {result!r}, which will be an error in a " + "future version of pytest. Did you mean to use `assert` instead of `return`?" + ) + ) return True diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index ac79bb53acc..ebfeb87d842 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -55,6 +55,13 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning): __module__ = "pytest" +@final +class PytestReturnNotNoneWarning(PytestDeprecationWarning): + """Warning emitted when a test function is returning value other than None.""" + + __module__ = "pytest" + + @final class PytestExperimentalApiWarning(PytestWarning, FutureWarning): """Warning category used to denote experiments in pytest. diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index 777d3774064..c1634e296bc 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -69,6 +69,7 @@ from _pytest.warning_types import PytestDeprecationWarning from _pytest.warning_types import PytestExperimentalApiWarning from _pytest.warning_types import PytestRemovedIn8Warning +from _pytest.warning_types import PytestReturnNotNoneWarning from _pytest.warning_types import PytestUnhandledCoroutineWarning from _pytest.warning_types import PytestUnhandledThreadExceptionWarning from _pytest.warning_types import PytestUnknownMarkWarning @@ -127,6 +128,7 @@ "PytestDeprecationWarning", "PytestExperimentalApiWarning", "PytestRemovedIn8Warning", + "PytestReturnNotNoneWarning", "Pytester", "PytestPluginManager", "PytestUnhandledCoroutineWarning", diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 92661b0f23a..c7139b538b2 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1292,3 +1292,14 @@ def test_no_brokenpipeerror_message(pytester: Pytester) -> None: # Cleanup. popen.stderr.close() + + +def test_function_return_non_none_warning(testdir) -> None: + testdir.makepyfile( + """ + def test_stuff(): + return "something" + """ + ) + res = testdir.runpytest() + res.stdout.fnmatch_lines(["*Did you mean to use `assert` instead of `return`?*"]) From e547cd565d32f7bc1db17800f38ade5077c47e03 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 29 May 2022 13:04:53 -0300 Subject: [PATCH 088/255] [automated] Update plugin list (#10001) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 190 ++++++++++++++++++++----------- 1 file changed, 123 insertions(+), 67 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 8b1202fca31..c59689c507c 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,15 +11,16 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1049 plugins. +This list contains 1056 plugins. .. only:: not latex =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ name summary last release status requires =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ + :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 Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 17, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 24, 2022 N/A pytest (>=5.4.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) @@ -62,6 +63,7 @@ This list contains 1049 plugins. :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 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) :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 May 22, 2022 N/A N/A :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A :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 @@ -92,6 +94,7 @@ This list contains 1049 plugins. :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) + :pypi:`pytest-bdd-ng` BDD for pytest May 25, 2022 4 - Beta pytest (>=5.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 @@ -222,7 +225,7 @@ This list contains 1049 plugins. :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' + :pypi:`pytest-dbt-core` Pytest extension for dbt. May 27, 2022 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A @@ -311,14 +314,14 @@ This list contains 1049 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin May 09, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 09, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 09, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 09, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 09, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin May 25, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 25, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 25, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 25, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 25, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 09, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 09, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 25, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 25, 2022 N/A N/A :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 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -363,7 +366,7 @@ This list contains 1049 plugins. :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A :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 May 09, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing May 24, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) @@ -413,7 +416,7 @@ This list contains 1049 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 04, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 26, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -439,7 +442,7 @@ This list contains 1049 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 19, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 28, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -457,7 +460,7 @@ This list contains 1049 plugins. :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 Jan 27, 2022 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Feb 05, 2022 5 - Production/Stable pytest (<8.*,>=6.*) + :pypi:`pytest-httpx` Send responses to httpx. May 24, 2022 5 - Production/Stable pytest (<8.*,>=6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :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 @@ -495,10 +498,11 @@ This list contains 1049 plugins. :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A + :pypi:`pytest-iters` A contextmanager pytest fixture for handling multiple mock iters May 24, 2022 N/A N/A :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 11, 2022 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 23, 2022 4 - Beta pytest :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) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -544,7 +548,7 @@ This list contains 1049 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-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 18, 2022 3 - Alpha pytest + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers May 26, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha 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-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A @@ -557,11 +561,12 @@ This list contains 1049 plugins. :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 :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) + :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-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 make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :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 May 17, 2022 N/A N/A + :pypi:`pytest-memray` A simple plugin to use with pytest May 27, 2022 N/A N/A :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-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) @@ -596,7 +601,7 @@ This list contains 1049 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin May 17, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin May 28, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -641,14 +646,14 @@ This list contains 1049 plugins. :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi May 18, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators May 19, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators May 25, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :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 Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed May 26, 2022 N/A N/A :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) @@ -656,7 +661,7 @@ This list contains 1049 plugins. :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) - :pypi:`pytest-parametrization` Simpler PyTest parametrization Nov 30, 2021 5 - Production/Stable pytest + :pypi:`pytest-parametrization` Simpler PyTest parametrization May 22, 2022 5 - Production/Stable N/A :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 plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) @@ -795,7 +800,7 @@ This list contains 1049 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :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-resilient-circuits` Resilient Circuits fixtures for PyTest. Apr 13, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. May 23, 2022 N/A N/A :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 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A @@ -821,19 +826,19 @@ This list contains 1049 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). May 10, 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 May 09, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin May 28, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 21, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 27, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 21, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 27, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -847,7 +852,7 @@ This list contains 1049 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-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system May 20, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system May 26, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 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) @@ -889,7 +894,7 @@ This list contains 1049 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 Apr 19, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 26, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -912,7 +917,7 @@ This list contains 1049 plugins. :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-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 13, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture May 26, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A :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). Jul 06, 2020 3 - Alpha N/A :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' @@ -930,6 +935,7 @@ This list contains 1049 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-terra-fixt` Terraform fixtures for pytest May 26, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 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-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A @@ -949,11 +955,11 @@ This list contains 1049 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 16, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 24, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results May 23, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A - :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) @@ -1023,6 +1029,7 @@ This list contains 1049 plugins. :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :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 May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-vnc` VNC client for Pytest May 22, 2022 N/A pytest :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) @@ -1049,7 +1056,7 @@ This list contains 1049 plugins. :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-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jul 28, 2021 4 - Beta pytest (>=2.8) + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. May 24, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) @@ -1064,7 +1071,7 @@ This list contains 1049 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :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 - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting May 20, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting May 27, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -1072,6 +1079,13 @@ This list contains 1049 plugins. .. only:: latex + :pypi:`pytest-abstracts` + *last release*: May 25, 2022, + *status*: N/A, + *requires*: N/A + + A contextmanager pytest fixture for handling multiple mock abstracts + :pypi:`pytest-accept` *last release*: Jan 07, 2022, *status*: N/A, @@ -1080,7 +1094,7 @@ This list contains 1049 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: May 17, 2022, + *last release*: May 24, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1380,6 +1394,13 @@ This list contains 1049 plugins. test Answer Set Programming programs + :pypi:`pytest-assertcount` + *last release*: May 22, 2022, + *status*: N/A, + *requires*: N/A + + Plugin to count actual number of asserts in pytest + :pypi:`pytest-assertions` *last release*: Apr 27, 2022, *status*: N/A, @@ -1590,6 +1611,13 @@ This list contains 1049 plugins. BDD for pytest + :pypi:`pytest-bdd-ng` + *last release*: May 25, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=5.0) + + BDD for pytest + :pypi:`pytest-bdd-splinter` *last release*: Aug 12, 2019, *status*: 5 - Production/Stable, @@ -2501,7 +2529,7 @@ This list contains 1049 plugins. A pytest plugin for linting a dbt project's conventions :pypi:`pytest-dbt-core` - *last release*: Jan 28, 2022, + *last release*: May 27, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) ; extra == 'test' @@ -3124,35 +3152,35 @@ This list contains 1049 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A @@ -3166,14 +3194,14 @@ This list contains 1049 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A @@ -3488,7 +3516,7 @@ This list contains 1049 plugins. :pypi:`pytest-fastapi-deps` - *last release*: May 09, 2022, + *last release*: May 24, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3838,7 +3866,7 @@ This list contains 1049 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: May 04, 2022, + *last release*: May 26, 2022, *status*: N/A, *requires*: N/A @@ -4020,7 +4048,7 @@ This list contains 1049 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 19, 2022, + *last release*: May 28, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4146,7 +4174,7 @@ This list contains 1049 plugins. pytest-httpserver is a httpserver for pytest :pypi:`pytest-httpx` - *last release*: Feb 05, 2022, + *last release*: May 24, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<8.*,>=6.*) @@ -4411,6 +4439,13 @@ This list contains 1049 plugins. Nicer list and iterable assertion messages for pytest + :pypi:`pytest-iters` + *last release*: May 24, 2022, + *status*: N/A, + *requires*: N/A + + A contextmanager pytest fixture for handling multiple mock iters + :pypi:`pytest-jasmine` *last release*: Nov 04, 2017, *status*: 1 - Planning, @@ -4433,7 +4468,7 @@ This list contains 1049 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: May 11, 2022, + *last release*: May 23, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4755,7 +4790,7 @@ This list contains 1049 plugins. Pytest Loguru :pypi:`pytest-lsp` - *last release*: Apr 18, 2022, + *last release*: May 26, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4845,6 +4880,13 @@ This list contains 1049 plugins. Provide tools for generating tests from combinations of fixtures. + :pypi:`pytest-maybe-raises` + *last release*: May 27, 2022, + *status*: N/A, + *requires*: pytest ; extra == 'dev' + + Pytest fixture for optional exception testing. + :pypi:`pytest-mccabe` *last release*: Jul 22, 2020, *status*: 3 - Alpha, @@ -4874,7 +4916,7 @@ This list contains 1049 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: May 17, 2022, + *last release*: May 27, 2022, *status*: N/A, *requires*: N/A @@ -5119,7 +5161,7 @@ This list contains 1049 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: May 17, 2022, + *last release*: May 28, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5434,7 +5476,7 @@ This list contains 1049 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: May 19, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: pytest @@ -5483,7 +5525,7 @@ This list contains 1049 plugins. OS X notifications for py.test results. :pypi:`pytest-otel` - *last release*: Mar 24, 2022, + *last release*: May 26, 2022, *status*: N/A, *requires*: N/A @@ -5539,9 +5581,9 @@ This list contains 1049 plugins. Configure pytest fixtures using a combination of"parametrize" and markers :pypi:`pytest-parametrization` - *last release*: Nov 30, 2021, + *last release*: May 22, 2022, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: N/A Simpler PyTest parametrization @@ -6512,7 +6554,7 @@ This list contains 1049 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: Apr 13, 2022, + *last release*: May 23, 2022, *status*: N/A, *requires*: N/A @@ -6694,7 +6736,7 @@ This list contains 1049 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: May 09, 2022, + *last release*: May 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6736,7 +6778,7 @@ This list contains 1049 plugins. :pypi:`pytest-sbase` - *last release*: May 21, 2022, + *last release*: May 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6778,7 +6820,7 @@ This list contains 1049 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: May 21, 2022, + *last release*: May 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6876,7 +6918,7 @@ This list contains 1049 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: May 20, 2022, + *last release*: May 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7170,7 +7212,7 @@ This list contains 1049 plugins. :pypi:`pytest-splunk-addon` - *last release*: Apr 19, 2022, + *last release*: May 26, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7331,7 +7373,7 @@ This list contains 1049 plugins. A hack to explicitly set up and tear down fixtures. :pypi:`pytest-subtests` - *last release*: Feb 13, 2022, + *last release*: May 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.0) @@ -7456,6 +7498,13 @@ This list contains 1049 plugins. Predictable and repeatable tempdir support. + :pypi:`pytest-terra-fixt` + *last release*: May 26, 2022, + *status*: N/A, + *requires*: pytest (==6.2.5) + + Terraform fixtures for pytest + :pypi:`pytest-terraform` *last release*: Jan 17, 2022, *status*: N/A, @@ -7590,16 +7639,16 @@ This list contains 1049 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: May 16, 2022, + *last release*: May 24, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) Pytest plugin for sending report to testrail system. :pypi:`pytest-testrail-ns` - *last release*: Oct 08, 2021, + *last release*: May 23, 2022, *status*: N/A, - *requires*: pytest (>=3.6) + *requires*: N/A pytest plugin for creating TestRail runs and adding results @@ -7618,7 +7667,7 @@ This list contains 1049 plugins. :pypi:`pytest-testreport` - *last release*: Nov 12, 2021, + *last release*: May 23, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -8107,6 +8156,13 @@ This list contains 1049 plugins. Virtualenv fixture for py.test + :pypi:`pytest-vnc` + *last release*: May 22, 2022, + *status*: N/A, + *requires*: pytest + + VNC client for Pytest + :pypi:`pytest-voluptuous` *last release*: Jun 09, 2020, *status*: N/A, @@ -8290,7 +8346,7 @@ This list contains 1049 plugins. An extended parametrizing plugin of pytest. :pypi:`pytest-xprocess` - *last release*: Jul 28, 2021, + *last release*: May 24, 2022, *status*: 4 - Beta, *requires*: pytest (>=2.8) @@ -8395,7 +8451,7 @@ This list contains 1049 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: May 20, 2022, + *last release*: May 27, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 0efd7a6ec617b55af733f6794436543604e4b5e4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 21:00:26 +0000 Subject: [PATCH 089/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.950 → v0.960](https://github.com/pre-commit/mirrors-mypy/compare/v0.950...v0.960) --- .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 189aa5b912d..c98ff7ea12a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.950 + rev: v0.960 hooks: - id: mypy files: ^(src/|testing/) From 6017666fe180205221f9969222a0e1208d4f5fe7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 31 May 2022 09:51:09 -0300 Subject: [PATCH 090/255] Do not advertise that importlib will be default import mode It is clear at this point that changing the default would break a lot of suites, and is not a clear win in all cases anyway. Close #10003 --- doc/en/explanation/goodpractices.rst | 5 ++--- doc/en/explanation/pythonpath.rst | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 92110f4f901..0b812ba5857 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -173,10 +173,9 @@ This layout prevents a lot of common pitfalls and has many benefits, which are b `blog post by Ionel Cristian Mărieș `_. .. note:: - The new ``--import-mode=importlib`` (see :ref:`import-modes`) doesn't have + The ``--import-mode=importlib`` option (see :ref:`import-modes`) does not have any of the drawbacks above because ``sys.path`` is not changed when importing - test modules, so users that run - into this issue are strongly encouraged to try it and report if the new option works well for them. + test modules, so users that run into this issue are strongly encouraged to try it. The ``src`` directory layout is still strongly recommended however. diff --git a/doc/en/explanation/pythonpath.rst b/doc/en/explanation/pythonpath.rst index 2330356b863..e1d240b498a 100644 --- a/doc/en/explanation/pythonpath.rst +++ b/doc/en/explanation/pythonpath.rst @@ -45,10 +45,19 @@ these values: * ``importlib``: new in pytest-6.0, this mode uses :mod:`importlib` to import test modules. This gives full control over the import process, and doesn't require changing :py:data:`sys.path`. - For this reason this doesn't require test module names to be unique, but also makes test - modules non-importable by each other. + For this reason this doesn't require test module names to be unique. + + One drawback however is that test modules are non-importable by each other. Also, utility + modules in the tests directories are not automatically importable because the tests directory is no longer + added to :py:data:`sys.path`. + + Initially we intended to make ``importlib`` the default in future releases, however it is clear now that + it has its own set of drawbacks so the default will remain ``prepend`` for the foreseeable future. + +.. seealso:: + + The :confval:`pythonpath` configuration variable. - We intend to make ``importlib`` the default in future releases, depending on feedback. ``prepend`` and ``append`` import modes scenarios ------------------------------------------------- From e54c6a1362589b32a2e63bb780192b86216ecec8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 31 May 2022 22:32:51 +0300 Subject: [PATCH 091/255] Document the --code-highlight default (#9883) Also normalized all help text using the patterns: * `One sentence help text` * `First sentence of help. Second sentence of help.` --- changelog/9883.improvement.rst | 1 + doc/en/reference/reference.rst | 282 +++++++++++++++--------------- src/_pytest/assertion/__init__.py | 2 +- src/_pytest/cacheprovider.py | 14 +- src/_pytest/capture.py | 4 +- src/_pytest/config/__init__.py | 6 +- src/_pytest/config/argparsing.py | 2 +- src/_pytest/debugging.py | 6 +- src/_pytest/doctest.py | 14 +- src/_pytest/faulthandler.py | 2 +- src/_pytest/fixtures.py | 2 +- src/_pytest/helpconfig.py | 27 +-- src/_pytest/junitxml.py | 4 +- src/_pytest/logging.py | 26 +-- src/_pytest/main.py | 52 +++--- src/_pytest/mark/__init__.py | 10 +- src/_pytest/pastebin.py | 2 +- src/_pytest/pytester.py | 6 +- src/_pytest/python.py | 12 +- src/_pytest/runner.py | 7 +- src/_pytest/setuponly.py | 4 +- src/_pytest/setupplan.py | 4 +- src/_pytest/skipping.py | 4 +- src/_pytest/stepwise.py | 6 +- src/_pytest/terminal.py | 32 ++-- testing/test_config.py | 6 +- testing/test_helpconfig.py | 12 +- testing/test_stepwise.py | 2 +- 28 files changed, 279 insertions(+), 272 deletions(-) create mode 100644 changelog/9883.improvement.rst diff --git a/changelog/9883.improvement.rst b/changelog/9883.improvement.rst new file mode 100644 index 00000000000..180784b5dba --- /dev/null +++ b/changelog/9883.improvement.rst @@ -0,0 +1 @@ +Normalize the help description of all command-line options. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index a4a5fd3fba4..6402e0af64f 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1752,11 +1752,11 @@ All the command-line flags can be obtained by running ``pytest --help``:: $ pytest --help usage: pytest [options] [file_or_dir] [file_or_dir] [...] - positional arguments: + Positional arguments: file_or_dir - general: - -k EXPRESSION only run tests which match the given substring + General: + -k EXPRESSION Only run tests which match the given substring expression. An expression is a python evaluatable expression where all names are substring-matched against test names and their parent classes. @@ -1771,217 +1771,217 @@ All the command-line flags can be obtained by running ``pytest --help``:: 'extra_keyword_matches' set, as well as functions which have names assigned directly to them. The matching is case-insensitive. - -m MARKEXPR only run tests matching given mark expression. + -m MARKEXPR Only run tests matching given mark expression. For 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. + --markers Show markers (builtin, plugin and per-project ones) + -x, --exitfirst Exit instantly on first error or failed test --fixtures, --funcargs - show available fixtures, sorted by plugin appearance + Show available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v') - --fixtures-per-test show fixtures per test - --pdb start the interactive Python debugger on errors or - KeyboardInterrupt. + --fixtures-per-test Show fixtures per test + --pdb Start the interactive Python debugger on errors or + KeyboardInterrupt --pdbcls=modulename:classname - specify a custom interactive Python debugger for use - with --pdb.For example: + Specify a custom interactive Python debugger for use + with --pdb. For example: --pdbcls=IPython.terminal.debugger:TerminalPdb - --trace Immediately break when running each test. - --capture=method per-test capturing method: one of fd|sys|no|tee-sys. - -s shortcut for --capture=no. - --runxfail report the results of xfail tests as if they were + --trace Immediately break when running each test + --capture=method Per-test capturing method: one of fd|sys|no|tee-sys. + -s Shortcut for --capture=no. + --runxfail Report the results of xfail tests as if they were not marked - --lf, --last-failed rerun only the tests that failed at the last run (or + --lf, --last-failed Rerun only the tests that failed at the last run (or all if none failed) - --ff, --failed-first run all tests, but run the last failures first. + --ff, --failed-first Run all tests, but run the last failures first This may re-order tests and thus lead to repeated - fixture setup/teardown. - --nf, --new-first run tests from new files first, then the rest of the + fixture setup/teardown + --nf, --new-first Run tests from new files first, then the rest of the tests sorted by file mtime --cache-show=[CACHESHOW] - show cache contents, don't perform collection or + Show cache contents, don't perform collection or tests. Optional argument: glob (default: '*'). - --cache-clear remove all cache contents at start of test run. + --cache-clear Remove all cache contents at start of test run --lfnf={all,none}, --last-failed-no-failures={all,none} - which tests to run with no previously (known) - failures. - --sw, --stepwise exit on test failure and continue from last failing + Which tests to run with no previously (known) + failures + --sw, --stepwise Exit on test failure and continue from last failing test next time --sw-skip, --stepwise-skip - ignore the first failing test but stop on the next + Ignore the first failing test but stop on the next failing test. implicitly enables --stepwise. - reporting: - --durations=N show N slowest setup/test durations (N=0 for all). + 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 - -v, --verbose increase verbosity. - --no-header disable header - --no-summary disable summary - -q, --quiet decrease verbosity. - --verbosity=VERBOSE set verbosity. Default is 0. - -r chars show extra test summary info as specified by chars: + list. Default: 0.005. + -v, --verbose Increase verbosity + --no-header Disable header + --no-summary Disable summary + -q, --quiet Decrease verbosity + --verbosity=VERBOSE Set verbosity. Default: 0. + -r chars Show extra test summary info as specified by chars: (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default (see --disable-warnings), 'N' can be used to reset the list. (default: 'fE'). --disable-warnings, --disable-pytest-warnings - disable warnings summary - -l, --showlocals show locals in tracebacks (disabled by default). - --tb=style traceback print mode + Disable warnings summary + -l, --showlocals Show locals in tracebacks (disabled by default) + --tb=style Traceback print mode (auto/long/short/line/native/no). --show-capture={no,stdout,stderr,log,all} Controls how captured stdout/stderr/log is shown on - failed tests. Default is 'all'. - --full-trace don't cut any tracebacks (default is to cut). - --color=color color terminal output (yes/no/auto). + failed tests. Default: all. + --full-trace Don't cut any tracebacks (default is to cut) + --color=color Color terminal output (yes/no/auto) --code-highlight={yes,no} Whether code should be highlighted (only if --color - is also enabled) - --pastebin=mode send failed|all info to bpaste.net pastebin service. - --junit-xml=path create junit-xml style report file at given path. - --junit-prefix=str prepend prefix to classnames in junit-xml output + is also enabled). Default: yes. + --pastebin=mode Send failed|all info to bpaste.net pastebin service + --junit-xml=path Create junit-xml style report file at given path + --junit-prefix=str Prepend prefix to classnames in junit-xml output pytest-warnings: -W PYTHONWARNINGS, --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 file load configuration from `file` instead of trying to - locate one of the implicit configuration files. + 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 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. + 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. - --pyargs try to interpret all arguments as python packages. - --ignore=path ignore path during collection (multi-allowed). - --ignore-glob=path ignore path pattern during collection (multi- - allowed). + Collection: + --collect-only, --co Only collect tests, don't execute them + --pyargs Try to interpret all arguments as Python packages + --ignore=path Ignore path during collection (multi-allowed) + --ignore-glob=path Ignore path pattern during collection (multi- + allowed) --deselect=nodeid_prefix - deselect item (via node id prefix) during collection - (multi-allowed). - --confcutdir=dir only load conftest.py's relative to specified dir. - --noconftest Don't load any conftest.py files. - --keep-duplicates Keep duplicate tests. + Deselect item (via node id prefix) during collection + (multi-allowed) + --confcutdir=dir Only load conftest.py's relative to specified dir + --noconftest Don't load any conftest.py files + --keep-duplicates Keep duplicate tests --collect-in-virtualenv Don't ignore tests in a local virtualenv directory --import-mode={prepend,append,importlib} - prepend/append to sys.path when importing test - modules and conftest files, default is to prepend. - --doctest-modules run doctests in all .py modules + Prepend/append to sys.path when importing test + modules and conftest files. Default: prepend. + --doctest-modules Run doctests in all .py modules --doctest-report={none,cdiff,ndiff,udiff,only_first_failure} - choose another output format for diffs on doctest + Choose another output format for diffs on doctest failure - --doctest-glob=pat doctests file matching pattern, default: test*.txt + --doctest-glob=pat Doctests file matching pattern, default: test*.txt --doctest-ignore-import-errors - ignore doctest ImportErrors + Ignore doctest ImportErrors --doctest-continue-on-failure - for a given doctest, continue to run after the first + For a given doctest, continue to run after the first failure - test session debugging and configuration: - --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 + Test session debugging and configuration: + --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 plugins. When given twice, also display information about plugins. - -h, --help show help message and configuration info - -p name early-load given plugin module name or entry point - (multi-allowed). + -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`. - --trace-config trace considerations of conftest.py files. + e.g. `no:doctest` + --trace-config Trace considerations of conftest.py files --debug=[DEBUG_FILE_NAME] - store internal tracing debug information in this log + Store internal tracing debug information in this log file. This file is opened with 'w' and truncated as a result, care advised. - Defaults to 'pytestdebug.log'. + Default: pytestdebug.log. -o OVERRIDE_INI, --override-ini=OVERRIDE_INI - override ini option with "option=value" style, e.g. - `-o xfail_strict=True -o cache_dir=cache`. + Override ini option with "option=value" style, e.g. + `-o xfail_strict=True -o cache_dir=cache` --assert=MODE Control assertion debugging tools. 'plain' performs no assertion debugging. 'rewrite' (the default) rewrites assert statements in test modules on import to provide assert expression information. - --setup-only only setup fixtures, do not execute tests. - --setup-show show setup of fixtures while executing tests. - --setup-plan show what fixtures and tests would be executed but - don't execute anything. + --setup-only Only setup fixtures, do not execute tests + --setup-show Show setup of fixtures while executing tests + --setup-plan Show what fixtures and tests would be executed but + don't execute anything - logging: - --log-level=LEVEL level of messages to catch/display. + Logging: + --log-level=LEVEL Level of messages to catch/display. Not set by default, so it depends on the root/parent log handler's effective level, where it is "WARNING" by default. --log-format=LOG_FORMAT - log format as used by the logging module. + Log format used by the logging module --log-date-format=LOG_DATE_FORMAT - log date format as used by the logging module. + Log date format used by the logging module --log-cli-level=LOG_CLI_LEVEL - cli logging level. + CLI logging level --log-cli-format=LOG_CLI_FORMAT - log format as used by the logging module. + Log format used by the logging module --log-cli-date-format=LOG_CLI_DATE_FORMAT - log date format as used by the logging module. - --log-file=LOG_FILE path to a file when logging will be written to. + Log date format used by the logging module + --log-file=LOG_FILE Path to a file when logging will be written to --log-file-level=LOG_FILE_LEVEL - log file logging level. + Log file logging level --log-file-format=LOG_FILE_FORMAT - log format as used by the logging module. + Log format used by the logging module --log-file-date-format=LOG_FILE_DATE_FORMAT - log date format as used by the logging module. + Log date format used by the logging module --log-auto-indent=LOG_AUTO_INDENT Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer. [pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found: - markers (linelist): markers for test functions + markers (linelist): 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 in the command line. + 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 in the command line filterwarnings (linelist): Each line specifies a pattern for warnings.filterwarnings. Processed after -W/--pythonwarnings. - usefixtures (args): list of default fixtures to be used with this + usefixtures (args): List of default fixtures to be used with this project - python_files (args): glob-style file patterns for Python test module + python_files (args): Glob-style file patterns for Python test module discovery python_classes (args): - prefixes or glob names for Python test class + Prefixes or glob names for Python test class discovery python_functions (args): - prefixes or glob names for Python test function and + Prefixes or glob names for Python test function and method discovery disable_test_id_escaping_and_forfeit_all_rights_to_community_support (bool): - disable string escape non-ascii characters, might + Disable string escape non-ASCII characters, might cause unwanted side effects(use at your own risk) console_output_style (string): - console output: "classic", or with additional + Console output: "classic", or with additional progress information ("progress" (percentage) | - "count"). - xfail_strict (bool): default for the strict parameter of xfail markers + "count") + xfail_strict (bool): Default for the strict parameter of xfail markers when not given explicitly (default: False) enable_assertion_pass_hook (bool): - Enables the pytest_assertion_pass hook.Make sure to + Enables the pytest_assertion_pass hook. Make sure to delete any previously generated pyc cache files. junit_suite_name (string): Test suite name for JUnit report @@ -1996,45 +1996,45 @@ All the command-line flags can be obtained by running ``pytest --help``:: junit_family (string): Emit XML for schema: one of legacy|xunit1|xunit2 doctest_optionflags (args): - option flags for doctests + Option flags for doctests doctest_encoding (string): - encoding used for doctest files - cache_dir (string): cache directory path. - log_level (string): default value for --log-level - log_format (string): default value for --log-format + Encoding used for doctest files + cache_dir (string): Cache directory path + log_level (string): Default value for --log-level + log_format (string): Default value for --log-format log_date_format (string): - default value for --log-date-format - log_cli (bool): enable log display during test run (also known as - "live logging"). + Default value for --log-date-format + log_cli (bool): Enable log display during test run (also known as + "live logging") log_cli_level (string): - default value for --log-cli-level + Default value for --log-cli-level log_cli_format (string): - default value for --log-cli-format + Default value for --log-cli-format log_cli_date_format (string): - default value for --log-cli-date-format - log_file (string): default value for --log-file + Default value for --log-cli-date-format + log_file (string): Default value for --log-file log_file_level (string): - default value for --log-file-level + Default value for --log-file-level log_file_format (string): - default value for --log-file-format + Default value for --log-file-format log_file_date_format (string): - default value for --log-file-date-format + Default value for --log-file-date-format log_auto_indent (string): - default value for --log-auto-indent + 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 + more than TIMEOUT seconds to finish + addopts (args): Extra command line options + minversion (string): Minimally required pytest version required_plugins (args): - plugins that must be present for pytest to run + Plugins that must be present for pytest to run - environment variables: - PYTEST_ADDOPTS extra command line options - PYTEST_PLUGINS comma-separated plugins to load during startup - PYTEST_DISABLE_PLUGIN_AUTOLOAD set to disable plugin auto-loading - PYTEST_DEBUG set to enable debug tracing of pytest's internals + Environment variables: + PYTEST_ADDOPTS Extra command line options + PYTEST_PLUGINS Comma-separated plugins to load during startup + PYTEST_DISABLE_PLUGIN_AUTOLOAD Set to disable plugin auto-loading + PYTEST_DEBUG Set to enable debug tracing of pytest's internals to see available markers type: pytest --markers diff --git a/src/_pytest/assertion/__init__.py b/src/_pytest/assertion/__init__.py index 480a26ad867..5c971bb8622 100644 --- a/src/_pytest/assertion/__init__.py +++ b/src/_pytest/assertion/__init__.py @@ -39,7 +39,7 @@ def pytest_addoption(parser: Parser) -> None: "enable_assertion_pass_hook", type="bool", default=False, - help="Enables the pytest_assertion_pass hook." + help="Enables the pytest_assertion_pass hook. " "Make sure to delete any previously generated pyc cache files.", ) diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index 4dad599d0e3..777c1b0b05a 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -440,7 +440,7 @@ def pytest_addoption(parser: Parser) -> None: "--last-failed", action="store_true", dest="lf", - help="rerun only the tests that failed " + help="Rerun only the tests that failed " "at the last run (or all if none failed)", ) group.addoption( @@ -448,7 +448,7 @@ def pytest_addoption(parser: Parser) -> None: "--failed-first", action="store_true", dest="failedfirst", - help="run all tests, but run the last failures first.\n" + help="Run all tests, but run the last failures first. " "This may re-order tests and thus lead to " "repeated fixture setup/teardown.", ) @@ -457,7 +457,7 @@ def pytest_addoption(parser: Parser) -> None: "--new-first", action="store_true", dest="newfirst", - help="run tests from new files first, then the rest of the tests " + help="Run tests from new files first, then the rest of the tests " "sorted by file mtime", ) group.addoption( @@ -466,7 +466,7 @@ def pytest_addoption(parser: Parser) -> None: nargs="?", dest="cacheshow", help=( - "show cache contents, don't perform collection or tests. " + "Show cache contents, don't perform collection or tests. " "Optional argument: glob (default: '*')." ), ) @@ -474,12 +474,12 @@ def pytest_addoption(parser: Parser) -> None: "--cache-clear", action="store_true", dest="cacheclear", - help="remove all cache contents at start of test run.", + help="Remove all cache contents at start of test run", ) cache_dir_default = ".pytest_cache" if "TOX_ENV_DIR" in os.environ: cache_dir_default = os.path.join(os.environ["TOX_ENV_DIR"], cache_dir_default) - parser.addini("cache_dir", default=cache_dir_default, help="cache directory path.") + parser.addini("cache_dir", default=cache_dir_default, help="Cache directory path") group.addoption( "--lfnf", "--last-failed-no-failures", @@ -487,7 +487,7 @@ def pytest_addoption(parser: Parser) -> None: dest="last_failed_no_failures", choices=("all", "none"), default="all", - help="which tests to run with no previously (known) failures.", + help="Which tests to run with no previously (known) failures", ) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 2a3c4143be4..d6cf42c3b51 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -42,14 +42,14 @@ def pytest_addoption(parser: Parser) -> None: default="fd", metavar="method", choices=["fd", "sys", "no", "tee-sys"], - help="per-test capturing method: one of fd|sys|no|tee-sys.", + help="Per-test capturing method: one of fd|sys|no|tee-sys", ) group._addoption( "-s", action="store_const", const="no", dest="capture", - help="shortcut for --capture=no.", + help="Shortcut for --capture=no", ) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index dfbda68ea78..b3173d7d736 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1115,11 +1115,11 @@ def _initini(self, args: Sequence[str]) -> None: self.inicfg = inicfg self._parser.extra_info["rootdir"] = str(self.rootpath) self._parser.extra_info["inifile"] = str(self.inipath) - self._parser.addini("addopts", "extra command line options", "args") - self._parser.addini("minversion", "minimally required pytest version") + self._parser.addini("addopts", "Extra command line options", "args") + self._parser.addini("minversion", "Minimally required pytest version") self._parser.addini( "required_plugins", - "plugins that must be present for pytest to run", + "Plugins that must be present for pytest to run", type="args", default=[], ) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index b0bb3f168ff..5f281eb0992 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -48,7 +48,7 @@ def __init__( _ispytest: bool = False, ) -> None: check_ispytest(_ispytest) - self._anonymous = OptionGroup("custom options", parser=self, _ispytest=True) + self._anonymous = OptionGroup("Custom options", parser=self, _ispytest=True) self._groups: List[OptionGroup] = [] self._processopt = processopt self._usage = usage diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index 452fb18ac34..b99c3fe2d31 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -46,21 +46,21 @@ def pytest_addoption(parser: Parser) -> None: "--pdb", dest="usepdb", action="store_true", - help="start the interactive Python debugger on errors or KeyboardInterrupt.", + help="Start the interactive Python debugger on errors or KeyboardInterrupt", ) group._addoption( "--pdbcls", dest="usepdb_cls", metavar="modulename:classname", type=_validate_usepdb_cls, - help="specify a custom interactive Python debugger for use with --pdb." + help="Specify a custom interactive Python debugger for use with --pdb." "For example: --pdbcls=IPython.terminal.debugger:TerminalPdb", ) group._addoption( "--trace", dest="trace", action="store_true", - help="Immediately break when running each test.", + help="Immediately break when running each test", ) diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index aa071cde883..ac5a29bb923 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -66,26 +66,26 @@ def pytest_addoption(parser: Parser) -> None: parser.addini( "doctest_optionflags", - "option flags for doctests", + "Option flags for doctests", type="args", default=["ELLIPSIS"], ) parser.addini( - "doctest_encoding", "encoding used for doctest files", default="utf-8" + "doctest_encoding", "Encoding used for doctest files", default="utf-8" ) group = parser.getgroup("collect") group.addoption( "--doctest-modules", action="store_true", default=False, - help="run doctests in all .py modules", + help="Run doctests in all .py modules", dest="doctestmodules", ) group.addoption( "--doctest-report", type=str.lower, default="udiff", - help="choose another output format for diffs on doctest failure", + help="Choose another output format for diffs on doctest failure", choices=DOCTEST_REPORT_CHOICES, dest="doctestreport", ) @@ -94,21 +94,21 @@ def pytest_addoption(parser: Parser) -> None: action="append", default=[], metavar="pat", - help="doctests file matching pattern, default: test*.txt", + help="Doctests file matching pattern, default: test*.txt", dest="doctestglob", ) group.addoption( "--doctest-ignore-import-errors", action="store_true", default=False, - help="ignore doctest ImportErrors", + help="Ignore doctest ImportErrors", dest="doctest_ignore_import_errors", ) group.addoption( "--doctest-continue-on-failure", action="store_true", default=False, - help="for a given doctest, continue to run after the first failure", + help="For a given doctest, continue to run after the first failure", dest="doctest_continue_on_failure", ) diff --git a/src/_pytest/faulthandler.py b/src/_pytest/faulthandler.py index aaee307ff2c..b9c925582ca 100644 --- a/src/_pytest/faulthandler.py +++ b/src/_pytest/faulthandler.py @@ -18,7 +18,7 @@ def pytest_addoption(parser: Parser) -> None: help = ( "Dump the traceback of all threads if a test takes " - "more than TIMEOUT seconds to finish." + "more than TIMEOUT seconds to finish" ) parser.addini("faulthandler_timeout", help, default=0.0) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index e7075fb85bb..b4545d49dc7 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1352,7 +1352,7 @@ def pytest_addoption(parser: Parser) -> None: "usefixtures", type="args", default=[], - help="list of default fixtures to be used with this project", + help="List of default fixtures to be used with this project", ) diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index aca2cd391e4..151bc6dff95 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -49,7 +49,7 @@ def pytest_addoption(parser: Parser) -> None: action="count", default=0, dest="version", - help="display pytest version and information about plugins. " + help="Display pytest version and information about plugins. " "When given twice, also display information about plugins.", ) group._addoption( @@ -57,7 +57,7 @@ def pytest_addoption(parser: Parser) -> None: "--help", action=HelpAction, dest="help", - help="show help message and configuration info", + help="Show help message and configuration info", ) group._addoption( "-p", @@ -65,7 +65,7 @@ def pytest_addoption(parser: Parser) -> None: dest="plugins", default=[], metavar="name", - help="early-load given plugin module name or entry point (multi-allowed).\n" + help="Early-load given plugin module name or entry point (multi-allowed). " "To avoid loading of plugins, use the `no:` prefix, e.g. " "`no:doctest`.", ) @@ -74,7 +74,7 @@ def pytest_addoption(parser: Parser) -> None: "--trace-config", action="store_true", default=False, - help="trace considerations of conftest.py files.", + help="Trace considerations of conftest.py files", ) group.addoption( "--debug", @@ -83,16 +83,17 @@ def pytest_addoption(parser: Parser) -> None: const="pytestdebug.log", dest="debug", metavar="DEBUG_FILE_NAME", - help="store internal tracing debug information in this log file.\n" - "This file is opened with 'w' and truncated as a result, care advised.\n" - "Defaults to 'pytestdebug.log'.", + help="Store internal tracing debug information in this log file. " + "This file is opened with 'w' and truncated as a result, care advised. " + "Default: pytestdebug.log.", ) group._addoption( "-o", "--override-ini", dest="override_ini", action="append", - help='override ini option with "option=value" style, e.g. `-o xfail_strict=True -o cache_dir=cache`.', + help='Override ini option with "option=value" style, ' + "e.g. `-o xfail_strict=True -o cache_dir=cache`.", ) @@ -203,12 +204,12 @@ def showhelp(config: Config) -> None: tw.line(indent + line) tw.line() - tw.line("environment variables:") + tw.line("Environment variables:") vars = [ - ("PYTEST_ADDOPTS", "extra command line options"), - ("PYTEST_PLUGINS", "comma-separated plugins to load during startup"), - ("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "set to disable plugin auto-loading"), - ("PYTEST_DEBUG", "set to enable debug tracing of pytest's internals"), + ("PYTEST_ADDOPTS", "Extra command line options"), + ("PYTEST_PLUGINS", "Comma-separated plugins to load during startup"), + ("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "Set to disable plugin auto-loading"), + ("PYTEST_DEBUG", "Set to enable debug tracing of pytest's internals"), ] for name, help in vars: tw.line(f" {name:<24} {help}") diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 1b9e3bfecac..c92a227bf1e 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -386,7 +386,7 @@ def pytest_addoption(parser: Parser) -> None: metavar="path", type=functools.partial(filename_arg, optname="--junitxml"), default=None, - help="create junit-xml style report file at given path.", + help="Create junit-xml style report file at given path", ) group.addoption( "--junitprefix", @@ -394,7 +394,7 @@ def pytest_addoption(parser: Parser) -> None: action="store", metavar="str", default=None, - help="prepend prefix to classnames in junit-xml output", + help="Prepend prefix to classnames in junit-xml output", ) parser.addini( "junit_suite_name", "Test suite name for JUnit report", default="pytest" diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 0163554bae4..a4f4214b137 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -218,7 +218,7 @@ def pytest_addoption(parser: Parser) -> None: def add_option_ini(option, dest, default=None, type=None, **kwargs): parser.addini( - dest, default=default, type=type, help="default value for " + option + dest, default=default, type=type, help="Default value for " + option ) group.addoption(option, dest=dest, **kwargs) @@ -228,8 +228,8 @@ def add_option_ini(option, dest, default=None, type=None, **kwargs): default=None, metavar="LEVEL", help=( - "level of messages to catch/display.\n" - "Not set by default, so it depends on the root/parent log handler's" + "Level of messages to catch/display." + " Not set by default, so it depends on the root/parent log handler's" ' effective level, where it is "WARNING" by default.' ), ) @@ -237,58 +237,58 @@ def add_option_ini(option, dest, default=None, type=None, **kwargs): "--log-format", dest="log_format", default=DEFAULT_LOG_FORMAT, - help="log format as used by the logging module.", + help="Log format used by the logging module", ) add_option_ini( "--log-date-format", dest="log_date_format", default=DEFAULT_LOG_DATE_FORMAT, - help="log date format as used by the logging module.", + help="Log date format used by the logging module", ) parser.addini( "log_cli", default=False, type="bool", - help='enable log display during test run (also known as "live logging").', + help='Enable log display during test run (also known as "live logging")', ) add_option_ini( - "--log-cli-level", dest="log_cli_level", default=None, help="cli logging level." + "--log-cli-level", dest="log_cli_level", default=None, help="CLI logging level" ) add_option_ini( "--log-cli-format", dest="log_cli_format", default=None, - help="log format as used by the logging module.", + help="Log format used by the logging module", ) add_option_ini( "--log-cli-date-format", dest="log_cli_date_format", default=None, - help="log date format as used by the logging module.", + help="Log date format used by the logging module", ) add_option_ini( "--log-file", dest="log_file", default=None, - help="path to a file when logging will be written to.", + help="Path to a file when logging will be written to", ) add_option_ini( "--log-file-level", dest="log_file_level", default=None, - help="log file logging level.", + help="Log file logging level", ) add_option_ini( "--log-file-format", dest="log_file_format", default=DEFAULT_LOG_FORMAT, - help="log format as used by the logging module.", + help="Log format used by the logging module", ) add_option_ini( "--log-file-date-format", dest="log_file_date_format", default=DEFAULT_LOG_DATE_FORMAT, - help="log date format as used by the logging module.", + help="Log date format used by the logging module", ) add_option_ini( "--log-auto-indent", diff --git a/src/_pytest/main.py b/src/_pytest/main.py index f2f0c667141..4a117fc2ea1 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -51,7 +51,7 @@ def pytest_addoption(parser: Parser) -> None: parser.addini( "norecursedirs", - "directory patterns to avoid for recursion", + "Directory patterns to avoid for recursion", type="args", default=[ "*.egg", @@ -67,26 +67,26 @@ def pytest_addoption(parser: Parser) -> None: ) parser.addini( "testpaths", - "directories to search for tests when no files or directories are given in the " - "command line.", + "Directories to search for tests when no files or directories are given on the " + "command line", type="args", default=[], ) - group = parser.getgroup("general", "running and selection options") + group = parser.getgroup("general", "Running and selection options") group._addoption( "-x", "--exitfirst", action="store_const", dest="maxfail", const=1, - help="exit instantly on first error or failed test.", + help="Exit instantly on first error or failed test", ) group = parser.getgroup("pytest-warnings") group.addoption( "-W", "--pythonwarnings", action="append", - help="set which warnings to report, see -W option of python itself.", + help="Set which warnings to report, see -W option of Python itself", ) parser.addini( "filterwarnings", @@ -102,37 +102,39 @@ def pytest_addoption(parser: Parser) -> None: type=int, dest="maxfail", default=0, - help="exit after first num failures or errors.", + help="Exit after first num failures or errors", ) group._addoption( "--strict-config", action="store_true", - help="any warnings encountered while parsing the `pytest` section of the configuration file raise errors.", + help="Any warnings encountered while parsing the `pytest` section of the " + "configuration file raise errors", ) group._addoption( "--strict-markers", action="store_true", - help="markers not registered in the `markers` section of the configuration file raise errors.", + help="Markers not registered in the `markers` section of the configuration " + "file raise errors", ) group._addoption( "--strict", action="store_true", - help="(deprecated) alias to --strict-markers.", + help="(Deprecated) alias to --strict-markers", ) group._addoption( "-c", metavar="file", type=str, dest="inifilename", - help="load configuration from `file` instead of trying to locate one of the implicit " - "configuration files.", + help="Load configuration from `file` instead of trying to locate one of the " + "implicit configuration files", ) group._addoption( "--continue-on-collection-errors", action="store_true", default=False, dest="continue_on_collection_errors", - help="Force test execution even if collection errors occur.", + help="Force test execution even if collection errors occur", ) group._addoption( "--rootdir", @@ -149,30 +151,30 @@ def pytest_addoption(parser: Parser) -> None: "--collect-only", "--co", action="store_true", - help="only collect tests, don't execute them.", + help="Only collect tests, don't execute them", ) group.addoption( "--pyargs", action="store_true", - help="try to interpret all arguments as python packages.", + help="Try to interpret all arguments as Python packages", ) group.addoption( "--ignore", action="append", metavar="path", - help="ignore path during collection (multi-allowed).", + help="Ignore path during collection (multi-allowed)", ) group.addoption( "--ignore-glob", action="append", metavar="path", - help="ignore path pattern during collection (multi-allowed).", + help="Ignore path pattern during collection (multi-allowed)", ) group.addoption( "--deselect", action="append", metavar="nodeid_prefix", - help="deselect item (via node id prefix) during collection (multi-allowed).", + help="Deselect item (via node id prefix) during collection (multi-allowed)", ) group.addoption( "--confcutdir", @@ -180,14 +182,14 @@ def pytest_addoption(parser: Parser) -> None: default=None, metavar="dir", type=functools.partial(directory_arg, optname="--confcutdir"), - help="only load conftest.py's relative to specified dir.", + help="Only load conftest.py's relative to specified dir", ) group.addoption( "--noconftest", action="store_true", dest="noconftest", default=False, - help="Don't load any conftest.py files.", + help="Don't load any conftest.py files", ) group.addoption( "--keepduplicates", @@ -195,7 +197,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="keepduplicates", default=False, - help="Keep duplicate tests.", + help="Keep duplicate tests", ) group.addoption( "--collect-in-virtualenv", @@ -209,8 +211,8 @@ def pytest_addoption(parser: Parser) -> None: default="prepend", choices=["prepend", "append", "importlib"], dest="importmode", - help="prepend/append to sys.path when importing test modules and conftest files, " - "default is to prepend.", + help="Prepend/append to sys.path when importing test modules and conftest " + "files. Default: prepend.", ) group = parser.getgroup("debugconfig", "test session debugging and configuration") @@ -221,8 +223,8 @@ def pytest_addoption(parser: Parser) -> None: type=validate_basetemp, metavar="dir", help=( - "base temporary directory for this test run." - "(warning: this directory is removed if it exists)" + "Base temporary directory for this test run. " + "(Warning: this directory is removed if it exists.)" ), ) diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index 11e6e34d73a..a03f0f89c2a 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -76,8 +76,8 @@ def pytest_addoption(parser: Parser) -> None: dest="keyword", default="", metavar="EXPRESSION", - help="only run tests which match the given substring expression. " - "An expression is a python evaluatable expression " + help="Only run tests which match the given substring expression. " + "An expression is a Python evaluatable expression " "where all names are substring-matched against test names " "and their parent classes. Example: -k 'test_method or test_" "other' matches all test functions and classes whose name " @@ -96,7 +96,7 @@ def pytest_addoption(parser: Parser) -> None: dest="markexpr", default="", metavar="MARKEXPR", - help="only run tests matching given mark expression.\n" + help="Only run tests matching given mark expression. " "For example: -m 'mark1 and not mark2'.", ) @@ -106,8 +106,8 @@ def pytest_addoption(parser: Parser) -> None: help="show markers (builtin, plugin and per-project ones).", ) - parser.addini("markers", "markers for test functions", "linelist") - parser.addini(EMPTY_PARAMETERSET_OPTION, "default marker for empty parametersets") + parser.addini("markers", "Markers for test functions", "linelist") + parser.addini(EMPTY_PARAMETERSET_OPTION, "Default marker for empty parametersets") @hookimpl(tryfirst=True) diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py index 385b3022cc0..22c7a622373 100644 --- a/src/_pytest/pastebin.py +++ b/src/_pytest/pastebin.py @@ -24,7 +24,7 @@ def pytest_addoption(parser: Parser) -> None: dest="pastebin", default=None, choices=["failed", "all"], - help="send failed|all info to bpaste.net pastebin service.", + help="Send failed|all info to bpaste.net pastebin service", ) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 4493bdb80dc..d8586a05694 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -89,7 +89,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="lsof", default=False, - help="run FD checks if lsof is available", + help="Run FD checks if lsof is available", ) parser.addoption( @@ -98,13 +98,13 @@ def pytest_addoption(parser: Parser) -> None: dest="runpytest", choices=("inprocess", "subprocess"), help=( - "run pytest sub runs in tests using an 'inprocess' " + "Run pytest sub runs in tests using an 'inprocess' " "or 'subprocess' (python -m main) method" ), ) parser.addini( - "pytester_example_dir", help="directory to take the pytester example files from" + "pytester_example_dir", help="Directory to take the pytester example files from" ) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 4d1f722e474..91054f370d3 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -97,7 +97,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="showfixtures", default=False, - help="show available fixtures, sorted by plugin appearance " + help="Show available fixtures, sorted by plugin appearance " "(fixtures with leading '_' are only shown with '-v')", ) group.addoption( @@ -105,32 +105,32 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="show_fixtures_per_test", default=False, - help="show fixtures per test", + help="Show fixtures per test", ) parser.addini( "python_files", type="args", # NOTE: default is also used in AssertionRewritingHook. default=["test_*.py", "*_test.py"], - help="glob-style file patterns for Python test module discovery", + help="Glob-style file patterns for Python test module discovery", ) parser.addini( "python_classes", type="args", default=["Test"], - help="prefixes or glob names for Python test class discovery", + help="Prefixes or glob names for Python test class discovery", ) parser.addini( "python_functions", type="args", default=["test"], - help="prefixes or glob names for Python test function and method discovery", + help="Prefixes or glob names for Python test function and method discovery", ) parser.addini( "disable_test_id_escaping_and_forfeit_all_rights_to_community_support", type="bool", default=False, - help="disable string escape non-ascii characters, might cause unwanted " + help="Disable string escape non-ASCII characters, might cause unwanted " "side effects(use at your own risk)", ) diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index df6eecdb129..584c3229d5f 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -46,14 +46,14 @@ def pytest_addoption(parser: Parser) -> None: - group = parser.getgroup("terminal reporting", "reporting", after="general") + group = parser.getgroup("terminal reporting", "Reporting", after="general") group.addoption( "--durations", action="store", type=int, default=None, metavar="N", - help="show N slowest setup/test durations (N=0 for all).", + help="Show N slowest setup/test durations (N=0 for all)", ) group.addoption( "--durations-min", @@ -61,7 +61,8 @@ def pytest_addoption(parser: Parser) -> None: type=float, default=0.005, metavar="N", - help="Minimal duration in seconds for inclusion in slowest list. Default 0.005", + help="Minimal duration in seconds for inclusion in slowest list. " + "Default: 0.005.", ) diff --git a/src/_pytest/setuponly.py b/src/_pytest/setuponly.py index 531131ce726..583590d6b70 100644 --- a/src/_pytest/setuponly.py +++ b/src/_pytest/setuponly.py @@ -18,13 +18,13 @@ def pytest_addoption(parser: Parser) -> None: "--setuponly", "--setup-only", action="store_true", - help="only setup fixtures, do not execute tests.", + help="Only setup fixtures, do not execute tests", ) group.addoption( "--setupshow", "--setup-show", action="store_true", - help="show setup of fixtures while executing tests.", + help="Show setup of fixtures while executing tests", ) diff --git a/src/_pytest/setupplan.py b/src/_pytest/setupplan.py index 9ba81ccaf0a..1a4ebdd99ca 100644 --- a/src/_pytest/setupplan.py +++ b/src/_pytest/setupplan.py @@ -15,8 +15,8 @@ def pytest_addoption(parser: Parser) -> None: "--setupplan", "--setup-plan", action="store_true", - help="show what fixtures and tests would be executed but " - "don't execute anything.", + help="Show what fixtures and tests would be executed but " + "don't execute anything", ) diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index ac7216f8385..b20442350d6 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -31,12 +31,12 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="runxfail", default=False, - help="report the results of xfail tests as if they were not marked", + help="Report the results of xfail tests as if they were not marked", ) parser.addini( "xfail_strict", - "default for the strict parameter of xfail " + "Default for the strict parameter of xfail " "markers when not given explicitly (default: False)", default=False, type="bool", diff --git a/src/_pytest/stepwise.py b/src/_pytest/stepwise.py index 4d95a96b872..84f1a6ce8fe 100644 --- a/src/_pytest/stepwise.py +++ b/src/_pytest/stepwise.py @@ -23,7 +23,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", default=False, dest="stepwise", - help="exit on test failure and continue from last failing test next time", + help="Exit on test failure and continue from last failing test next time", ) group.addoption( "--sw-skip", @@ -31,8 +31,8 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", default=False, dest="stepwise_skip", - help="ignore the first failing test but stop on the next failing test.\n" - "implicitly enables --stepwise.", + help="Ignore the first failing test but stop on the next failing test. " + "Implicitly enables --stepwise.", ) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 8e47f26045a..9739a467a66 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -112,28 +112,28 @@ def __call__( def pytest_addoption(parser: Parser) -> None: - group = parser.getgroup("terminal reporting", "reporting", after="general") + group = parser.getgroup("terminal reporting", "Reporting", after="general") group._addoption( "-v", "--verbose", action="count", default=0, dest="verbose", - help="increase verbosity.", + help="Increase verbosity", ) group._addoption( "--no-header", action="store_true", default=False, dest="no_header", - help="disable header", + help="Disable header", ) group._addoption( "--no-summary", action="store_true", default=False, dest="no_summary", - help="disable summary", + help="Disable summary", ) group._addoption( "-q", @@ -141,14 +141,14 @@ def pytest_addoption(parser: Parser) -> None: action=MoreQuietAction, default=0, dest="verbose", - help="decrease verbosity.", + help="Decrease verbosity", ) group._addoption( "--verbosity", dest="verbose", type=int, default=0, - help="set verbosity. Default is 0.", + help="Set verbosity. Default: 0.", ) group._addoption( "-r", @@ -156,7 +156,7 @@ def pytest_addoption(parser: Parser) -> None: dest="reportchars", default=_REPORTCHARS_DEFAULT, metavar="chars", - help="show extra test summary info as specified by chars: (f)ailed, " + help="Show extra test summary info as specified by chars: (f)ailed, " "(E)rror, (s)kipped, (x)failed, (X)passed, " "(p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. " "(w)arnings are enabled by default (see --disable-warnings), " @@ -168,7 +168,7 @@ def pytest_addoption(parser: Parser) -> None: default=False, dest="disable_warnings", action="store_true", - help="disable warnings summary", + help="Disable warnings summary", ) group._addoption( "-l", @@ -176,7 +176,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="showlocals", default=False, - help="show locals in tracebacks (disabled by default).", + help="Show locals in tracebacks (disabled by default)", ) group._addoption( "--tb", @@ -185,7 +185,7 @@ def pytest_addoption(parser: Parser) -> None: dest="tbstyle", default="auto", choices=["auto", "long", "short", "no", "line", "native"], - help="traceback print mode (auto/long/short/line/native/no).", + help="Traceback print mode (auto/long/short/line/native/no)", ) group._addoption( "--show-capture", @@ -194,14 +194,14 @@ def pytest_addoption(parser: Parser) -> None: choices=["no", "stdout", "stderr", "log", "all"], default="all", help="Controls how captured stdout/stderr/log is shown on failed tests. " - "Default is 'all'.", + "Default: all.", ) group._addoption( "--fulltrace", "--full-trace", action="store_true", default=False, - help="don't cut any tracebacks (default is to cut).", + help="Don't cut any tracebacks (default is to cut)", ) group._addoption( "--color", @@ -210,18 +210,20 @@ def pytest_addoption(parser: Parser) -> None: dest="color", default="auto", choices=["yes", "no", "auto"], - help="color terminal output (yes/no/auto).", + help="Color terminal output (yes/no/auto)", ) group._addoption( "--code-highlight", default="yes", choices=["yes", "no"], - help="Whether code should be highlighted (only if --color is also enabled)", + help="Whether code should be highlighted (only if --color is also enabled). " + "Default: yes.", ) parser.addini( "console_output_style", - help='console output: "classic", or with additional progress information ("progress" (percentage) | "count").', + help='Console output: "classic", or with additional progress information ' + '("progress" (percentage) | "count")', default="progress", ) diff --git a/testing/test_config.py b/testing/test_config.py index b2c74085eae..ac0c159a833 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -2117,8 +2117,8 @@ def test_debug_help(self, pytester: Pytester) -> None: result = pytester.runpytest("-h") result.stdout.fnmatch_lines( [ - "*store internal tracing debug information in this log*", - "*This file is opened with 'w' and truncated as a result*", - "*Defaults to 'pytestdebug.log'.", + "*Store internal tracing debug information in this log*", + "*file. This file is opened with 'w' and truncated as a*", + "*Default: pytestdebug.log.", ] ) diff --git a/testing/test_helpconfig.py b/testing/test_helpconfig.py index 44c2c9295bf..ba89d0c4acf 100644 --- a/testing/test_helpconfig.py +++ b/testing/test_helpconfig.py @@ -30,11 +30,11 @@ def test_help(pytester: Pytester) -> None: assert result.ret == 0 result.stdout.fnmatch_lines( """ - -m MARKEXPR only run tests matching given mark expression. - For example: -m 'mark1 and not mark2'. - reporting: + -m MARKEXPR Only run tests matching given mark expression. For + example: -m 'mark1 and not mark2'. + Reporting: --durations=N * - -V, --version display pytest version and information about plugins. + -V, --version Display pytest version and information about plugins. When given twice, also display information about plugins. *setup.cfg* @@ -71,9 +71,9 @@ def pytest_addoption(parser): assert result.ret == 0 lines = [ " required_plugins (args):", - " plugins that must be present for pytest to run*", + " Plugins that must be present for pytest to run*", " test_ini (bool):*", - "environment variables:", + "Environment variables:", ] result.stdout.fnmatch_lines(lines, consecutive=True) diff --git a/testing/test_stepwise.py b/testing/test_stepwise.py index 63d29d6241f..20781d42cce 100644 --- a/testing/test_stepwise.py +++ b/testing/test_stepwise.py @@ -277,4 +277,4 @@ def test_three(): def test_sw_skip_help(pytester: Pytester) -> None: result = pytester.runpytest("-h") - result.stdout.fnmatch_lines("*implicitly enables --stepwise.") + result.stdout.fnmatch_lines("*Implicitly enables --stepwise.") From c2f684fcd6af2818a5ddeb99cd5b8367a91e99ef Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Thu, 2 Jun 2022 08:16:59 -0500 Subject: [PATCH 092/255] docs(monkeypatch): Fix autodoc reference links (#10013) Close #10014 --- AUTHORS | 1 + doc/en/how-to/monkeypatch.rst | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index af9c7a56bce..61c3901beaa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -334,6 +334,7 @@ Tom Dalton Tom Viner Tomáš Gavenčiak Tomer Keren +Tony Narlock Tor Colvin Trevor Bekolay Tyler Goodlet diff --git a/doc/en/how-to/monkeypatch.rst b/doc/en/how-to/monkeypatch.rst index 9c61233f7e5..0ae87824030 100644 --- a/doc/en/how-to/monkeypatch.rst +++ b/doc/en/how-to/monkeypatch.rst @@ -3,7 +3,7 @@ How to monkeypatch/mock modules and environments ================================================================ -.. currentmodule:: _pytest.monkeypatch +.. currentmodule:: pytest Sometimes tests need to invoke functionality which depends on global settings or which invokes code which cannot be easily @@ -436,7 +436,7 @@ separate fixtures for each potential mock and reference them in the needed tests _ = app.create_connection_string() -.. currentmodule:: _pytest.monkeypatch +.. currentmodule:: pytest API Reference ------------- From 5adfb0e1876a39704bfd257ac63e21ca6652b34b Mon Sep 17 00:00:00 2001 From: Neil Girdhar Date: Fri, 3 Jun 2022 06:59:48 -0400 Subject: [PATCH 093/255] Use symbolic NoReturn as a type annotation (#10018) Use symbolic NoReturn as a type annotation --- src/_pytest/compat.py | 4 ++-- src/_pytest/config/argparsing.py | 4 ++-- src/_pytest/fixtures.py | 6 +++--- src/_pytest/mark/expression.py | 7 ++----- src/_pytest/outcomes.py | 12 +++++------- src/_pytest/reports.py | 4 ++-- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 8b77de28f10..d0cb07b2291 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -10,6 +10,7 @@ from typing import Any from typing import Callable from typing import Generic +from typing import NoReturn from typing import Optional from typing import Tuple from typing import TYPE_CHECKING @@ -20,7 +21,6 @@ import py if TYPE_CHECKING: - from typing import NoReturn from typing_extensions import Final @@ -403,5 +403,5 @@ def __get__(self, instance, owner=None): # previously. # # This also work for Enums (if you use `is` to compare) and Literals. -def assert_never(value: "NoReturn") -> "NoReturn": +def assert_never(value: NoReturn) -> NoReturn: assert False, f"Unhandled value: {value} ({type(value).__name__})" diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 5f281eb0992..fa27aa6203b 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -9,6 +9,7 @@ from typing import Dict from typing import List from typing import Mapping +from typing import NoReturn from typing import Optional from typing import Sequence from typing import Tuple @@ -24,7 +25,6 @@ from _pytest.deprecated import check_ispytest if TYPE_CHECKING: - from typing import NoReturn from typing_extensions import Literal FILE_OR_DIR = "file_or_dir" @@ -403,7 +403,7 @@ def __init__( # an usage error to provide more contextual information to the user. self.extra_info = extra_info if extra_info else {} - def error(self, message: str) -> "NoReturn": + def error(self, message: str) -> NoReturn: """Transform argparse error message into UsageError.""" msg = f"{self.prog}: error: {message}" diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index b4545d49dc7..fc6539db0fd 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -18,6 +18,7 @@ from typing import Iterator from typing import List from typing import MutableMapping +from typing import NoReturn from typing import Optional from typing import overload from typing import Sequence @@ -67,7 +68,6 @@ if TYPE_CHECKING: from typing import Deque - from typing import NoReturn from _pytest.scope import _ScopeName from _pytest.main import Session @@ -524,7 +524,7 @@ def applymarker(self, marker: Union[str, MarkDecorator]) -> None: """ self.node.add_marker(marker) - def raiseerror(self, msg: Optional[str]) -> "NoReturn": + def raiseerror(self, msg: Optional[str]) -> NoReturn: """Raise a FixtureLookupError with the given message.""" raise self._fixturemanager.FixtureLookupError(None, self, msg) @@ -866,7 +866,7 @@ def toterminal(self, tw: TerminalWriter) -> None: tw.line("%s:%d" % (os.fspath(self.filename), self.firstlineno + 1)) -def fail_fixturefunc(fixturefunc, msg: str) -> "NoReturn": +def fail_fixturefunc(fixturefunc, msg: str) -> NoReturn: fs, lineno = getfslineno(fixturefunc) location = f"{fs}:{lineno + 1}" source = _pytest._code.Source(fixturefunc) diff --git a/src/_pytest/mark/expression.py b/src/_pytest/mark/expression.py index 92220d7723a..0a2e7c65676 100644 --- a/src/_pytest/mark/expression.py +++ b/src/_pytest/mark/expression.py @@ -21,15 +21,12 @@ from typing import Callable from typing import Iterator from typing import Mapping +from typing import NoReturn from typing import Optional from typing import Sequence -from typing import TYPE_CHECKING import attr -if TYPE_CHECKING: - from typing import NoReturn - __all__ = [ "Expression", @@ -117,7 +114,7 @@ def accept(self, type: TokenType, *, reject: bool = False) -> Optional[Token]: self.reject((type,)) return None - def reject(self, expected: Sequence[TokenType]) -> "NoReturn": + def reject(self, expected: Sequence[TokenType]) -> NoReturn: raise ParseError( self.current.pos + 1, "expected {}; got {}".format( diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 25206fe0e85..684efae7715 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -5,6 +5,7 @@ from typing import Any from typing import Callable from typing import cast +from typing import NoReturn from typing import Optional from typing import Type from typing import TypeVar @@ -14,7 +15,6 @@ TYPE_CHECKING = False # Avoid circular import through compat. if TYPE_CHECKING: - from typing import NoReturn from typing_extensions import Protocol else: # typing.Protocol is only available starting from Python 3.8. It is also @@ -115,7 +115,7 @@ def decorate(func: _F) -> _WithException[_F, _ET]: @_with_exception(Exit) def exit( reason: str = "", returncode: Optional[int] = None, *, msg: Optional[str] = None -) -> "NoReturn": +) -> NoReturn: """Exit testing process. :param reason: @@ -146,7 +146,7 @@ def exit( @_with_exception(Skipped) def skip( reason: str = "", *, allow_module_level: bool = False, msg: Optional[str] = None -) -> "NoReturn": +) -> NoReturn: """Skip an executing test with the given message. This function should be called only during testing (setup, call or teardown) or @@ -176,9 +176,7 @@ def skip( @_with_exception(Failed) -def fail( - reason: str = "", pytrace: bool = True, msg: Optional[str] = None -) -> "NoReturn": +def fail(reason: str = "", pytrace: bool = True, msg: Optional[str] = None) -> NoReturn: """Explicitly fail an executing test with the given message. :param reason: @@ -238,7 +236,7 @@ class XFailed(Failed): @_with_exception(XFailed) -def xfail(reason: str = "") -> "NoReturn": +def xfail(reason: str = "") -> NoReturn: """Imperatively xfail an executing test or setup function with the given reason. This function should be called only during testing (setup, call or teardown). diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 725fdf61739..20862d60388 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -8,6 +8,7 @@ from typing import Iterator from typing import List from typing import Mapping +from typing import NoReturn from typing import Optional from typing import Tuple from typing import Type @@ -36,7 +37,6 @@ from _pytest.outcomes import skip if TYPE_CHECKING: - from typing import NoReturn from typing_extensions import Literal from _pytest.runner import CallInfo @@ -229,7 +229,7 @@ def _from_json(cls: Type[_R], reportdict: Dict[str, object]) -> _R: def _report_unserialization_failure( type_name: str, report_class: Type[BaseReport], reportdict -) -> "NoReturn": +) -> NoReturn: url = "https://github.com/pytest-dev/pytest/issues" stream = StringIO() pprint("-" * 100, stream=stream) From 433c7376c5193446769b7307df93f27a94e72435 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 5 Jun 2022 12:44:38 -0300 Subject: [PATCH 094/255] [automated] Update plugin list (#10020) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 138 +++++++++++++++++++++---------- 1 file changed, 93 insertions(+), 45 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index c59689c507c..68b2352db7f 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1056 plugins. +This list contains 1062 plugins. .. only:: not latex @@ -20,7 +20,7 @@ This list contains 1056 plugins. =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ :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 Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 24, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 31, 2022 N/A pytest (>=5.4.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) @@ -90,6 +90,7 @@ This list contains 1056 plugins. :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.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. Jun 02, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) @@ -108,7 +109,7 @@ This list contains 1056 plugins. :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :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-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. May 17, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. May 30, 2022 N/A pytest ; extra == 'dev' :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 @@ -190,7 +191,7 @@ This list contains 1056 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types May 13, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jun 02, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -314,14 +315,14 @@ This list contains 1056 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin May 25, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 25, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 25, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 25, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 25, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jun 01, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jun 01, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 25, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 25, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 01, 2022 N/A N/A :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 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -355,7 +356,7 @@ This list contains 1056 plugins. :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-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. May 21, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 31, 2022 6 - Mature pytest (>=5.0.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-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A @@ -366,7 +367,7 @@ This list contains 1056 plugins. :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A :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 May 24, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jun 02, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) @@ -422,6 +423,7 @@ This list contains 1056 plugins. :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) + :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality May 19, 2022 4 - Beta pytest :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest @@ -442,7 +444,7 @@ This list contains 1056 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 28, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 03, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -519,6 +521,7 @@ This list contains 1056 plugins. :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 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A + :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 03, 2022 N/A pytest :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-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest @@ -601,7 +604,7 @@ This list contains 1056 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin May 28, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 03, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -612,7 +615,7 @@ This list contains 1056 plugins. :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A - :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Mar 02, 2022 N/A N/A + :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. May 30, 2022 N/A N/A :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :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) @@ -636,6 +639,7 @@ This list contains 1056 plugins. :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :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 Mar 16, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jun 02, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A @@ -645,7 +649,7 @@ This list contains 1056 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi May 18, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators May 25, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) @@ -807,6 +811,7 @@ This list contains 1056 plugins. :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Jun 01, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) @@ -832,13 +837,13 @@ This list contains 1056 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 03, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 03, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -852,7 +857,7 @@ This list contains 1056 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-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system May 26, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jun 02, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 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) @@ -945,7 +950,8 @@ This list contains 1056 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Jun 01, 2022 4 - Beta N/A + :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 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-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) @@ -1029,7 +1035,7 @@ This list contains 1056 plugins. :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :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 May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-vnc` VNC client for Pytest May 22, 2022 N/A pytest + :pypi:`pytest-vnc` VNC client for Pytest Jun 03, 2022 N/A pytest :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) @@ -1071,7 +1077,7 @@ This list contains 1056 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :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 - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting May 27, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Jun 02, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -1094,7 +1100,7 @@ This list contains 1056 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: May 24, 2022, + *last release*: May 31, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1583,6 +1589,13 @@ This list contains 1056 plugins. pytest plugin for axe-selenium-python + :pypi:`pytest-azure-devops` + *last release*: Jun 02, 2022, + *status*: 4 - Beta, + *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. + :pypi:`pytest-azurepipelines` *last release*: Mar 16, 2022, *status*: 4 - Beta, @@ -1710,7 +1723,7 @@ This list contains 1056 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: May 17, 2022, + *last release*: May 30, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -2284,7 +2297,7 @@ This list contains 1056 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: May 13, 2022, + *last release*: Jun 02, 2022, *status*: N/A, *requires*: N/A @@ -3152,35 +3165,35 @@ This list contains 1056 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A @@ -3194,14 +3207,14 @@ This list contains 1056 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A @@ -3439,7 +3452,7 @@ This list contains 1056 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: May 21, 2022, + *last release*: May 31, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -3516,7 +3529,7 @@ This list contains 1056 plugins. :pypi:`pytest-fastapi-deps` - *last release*: May 24, 2022, + *last release*: Jun 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3907,6 +3920,13 @@ This list contains 1056 plugins. pytest plugin to annotate failed tests with a workflow command for GitHub Actions + :pypi:`pytest-github-report` + *last release*: Jun 03, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Generate a GitHub report using pytest in GitHub Workflows + :pypi:`pytest-gitignore` *last release*: Jul 17, 2015, *status*: 4 - Beta, @@ -4048,7 +4068,7 @@ This list contains 1056 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 28, 2022, + *last release*: Jun 03, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4586,6 +4606,13 @@ This list contains 1056 plugins. + :pypi:`pytest-launchable` + *last release*: Jun 03, 2022, + *status*: N/A, + *requires*: pytest + + Launchable Pytest Plugin + :pypi:`pytest-layab` *last release*: Oct 05, 2020, *status*: 5 - Production/Stable, @@ -5161,7 +5188,7 @@ This list contains 1056 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: May 28, 2022, + *last release*: Jun 03, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5238,7 +5265,7 @@ This list contains 1056 plugins. Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. :pypi:`pytest-mypy-testing` - *last release*: Mar 02, 2022, + *last release*: May 30, 2022, *status*: N/A, *requires*: N/A @@ -5405,6 +5432,13 @@ This list contains 1056 plugins. A pytest plugin for generating NUnit3 test result XML output + :pypi:`pytest-object-getter` + *last release*: Jun 02, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Import any object from a 3rd party module while mocking its namespace on demand. + :pypi:`pytest-ochrus` *last release*: Feb 21, 2018, *status*: 4 - Beta, @@ -5469,7 +5503,7 @@ This list contains 1056 plugins. A pytest plugin for instrumenting test runs via OpenTelemetry :pypi:`pytest-opentmi` - *last release*: May 18, 2022, + *last release*: Jun 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -6602,6 +6636,13 @@ This list contains 1056 plugins. A RethinkDB plugin for pytest. + :pypi:`pytest-retry` + *last release*: Jun 01, 2022, + *status*: N/A, + *requires*: pytest (>=7.0.0) + + Adds the ability to retry flaky tests in CI environments + :pypi:`pytest-reverse` *last release*: May 11, 2022, *status*: 5 - Production/Stable, @@ -6778,7 +6819,7 @@ This list contains 1056 plugins. :pypi:`pytest-sbase` - *last release*: May 27, 2022, + *last release*: Jun 03, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6820,7 +6861,7 @@ This list contains 1056 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: May 27, 2022, + *last release*: Jun 03, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6918,7 +6959,7 @@ This list contains 1056 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: May 26, 2022, + *last release*: Jun 02, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7569,12 +7610,19 @@ This list contains 1056 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Mar 11, 2022, + *last release*: Jun 01, 2022, *status*: 4 - Beta, *requires*: N/A selects tests affected by changed files and methods + :pypi:`pytest-testmon-oc` + *last release*: Jun 01, 2022, + *status*: 4 - Beta, + *requires*: pytest (<8,>=5) + + nOly selects tests affected by changed files and methods + :pypi:`pytest-testobject` *last release*: Sep 24, 2019, *status*: 4 - Beta, @@ -8157,7 +8205,7 @@ This list contains 1056 plugins. Virtualenv fixture for py.test :pypi:`pytest-vnc` - *last release*: May 22, 2022, + *last release*: Jun 03, 2022, *status*: N/A, *requires*: pytest @@ -8451,7 +8499,7 @@ This list contains 1056 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: May 27, 2022, + *last release*: Jun 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 083285948f2a425b9b5f3f3b4c25b02c13a30bc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 08:01:15 -0300 Subject: [PATCH 095/255] build(deps): Bump django from 4.0.4 to 4.0.5 in /testing/plugins_integration (#10021) Bumps [django](https://github.com/django/django) from 4.0.4 to 4.0.5. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.4...4.0.5) --- updated-dependencies: - dependency-name: django 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 0386a613a93..965762dae4b 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.0.4 +django==4.0.5 pytest-asyncio==0.18.3 pytest-bdd==5.0.0 pytest-cov==3.0.0 From fe2c74cb1aaba82a1bc085005ba39e0c6beb0748 Mon Sep 17 00:00:00 2001 From: Sandro Tosi Date: Tue, 7 Jun 2022 14:43:34 -0400 Subject: [PATCH 096/255] Update location of `usage.rst` to fix manpage compilation `usage.rst` has been moved from `doc/en` to `doc/en/how-to`, so the `man_pages` configuration value needs to be updated to the new location, so that we dont get this warning: writing... WARNING: "man_pages" config value references unknown document usage --- doc/en/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 5aedd2d322d..0022363b27e 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -320,7 +320,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)] +man_pages = [("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)] # -- Options for Epub output --------------------------------------------------- From 27c94f573cac932a00169a59aa52e8353f4ef71b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 10 Jun 2022 14:28:40 +0200 Subject: [PATCH 097/255] Update training list --- doc/en/index.rst | 8 ++------ doc/en/talks.rst | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 8b4528ddf2d..501ec913388 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,16 +2,12 @@ .. sidebar:: Next Open Trainings - - `PyConDE `__, April 11th 2022 (3h), Berlin, Germany - - `PyConIT `__, June 3rd 2022 (4h), Florence, Italy + - `Europython `__, July 11th 2022 (3h), Dublin, Ireland + - `CH Open Workshop-Tage `__ (German), September 8th 2022, Bern, Switzerland - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. -.. - - `Europython `__, July 11th to 17th (3h), Dublin, Ireland - - `CH Open Workshoptage `__ (German), September 6th to 8th (1 day), Bern, Switzerland - .. _features: pytest: helps you write better programs diff --git a/doc/en/talks.rst b/doc/en/talks.rst index 160345614c8..b9b153a792e 100644 --- a/doc/en/talks.rst +++ b/doc/en/talks.rst @@ -17,6 +17,8 @@ Books Talks and blog postings --------------------------------------------- +- Training: `pytest - simple, rapid and fun testing with Python `_, Florian Bruhin, PyConDE 2022 + - `pytest: Simple, rapid and fun testing with Python, `_ (@ 4:22:32), Florian Bruhin, WeAreDevelopers World Congress 2021 - Webinar: `pytest: Test Driven Development für Python (German) `_, Florian Bruhin, via mylearning.ch, 2020 From 1a50e5222fdaa82dc47eecaba38a3bb04d0b4872 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 12 Jun 2022 00:22:15 +0000 Subject: [PATCH 098/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 120 +++++++++++++++---------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 68b2352db7f..d29f5ddcc44 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -20,7 +20,7 @@ This list contains 1062 plugins. =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ :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 Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 31, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jun 07, 2022 N/A pytest (>=5.4.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) @@ -45,7 +45,7 @@ This list contains 1062 plugins. :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :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 Oct 14, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Nov 29, 2021 3 - Alpha pytest (<7.0.0,>=3.2.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-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :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) @@ -191,7 +191,7 @@ This list contains 1062 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jun 02, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jun 08, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -315,14 +315,14 @@ This list contains 1062 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jun 01, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jun 01, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jun 01, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jun 01, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jun 06, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jun 06, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 01, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A :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 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -434,7 +434,7 @@ This list contains 1062 plugins. :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-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest - :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Apr 01, 2021 5 - Production/Stable N/A + :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. May 11, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A @@ -444,7 +444,7 @@ This list contains 1062 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 03, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 11, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -467,13 +467,13 @@ This list contains 1062 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-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 08, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :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 May 04, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest + :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A @@ -482,7 +482,7 @@ This list contains 1062 plugins. :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules May 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 08, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules May 10, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -521,7 +521,7 @@ This list contains 1062 plugins. :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 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A - :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 03, 2022 N/A pytest + :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 09, 2022 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-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest @@ -604,7 +604,7 @@ This list contains 1062 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 03, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 07, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -681,7 +681,7 @@ This list contains 1062 plugins. :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=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-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Jun 07, 2022 5 - Production/Stable pytest (>=6.0.0) :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) :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) @@ -755,7 +755,7 @@ This list contains 1062 plugins. :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 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A + :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest @@ -782,7 +782,7 @@ This list contains 1062 plugins. :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) :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. Dec 21, 2021 3 - Alpha pytest (>=4.6) - :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 30, 2021 4 - Beta pytest (>=4.6) + :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 05, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) @@ -837,13 +837,13 @@ This list contains 1062 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 03, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 08, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 03, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 08, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -894,7 +894,7 @@ This list contains 1062 plugins. :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A - :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) + :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Jun 11, 2022 6 - Mature pytest (<8.0,>=7.1.2) :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) :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) @@ -1020,15 +1020,15 @@ This list contains 1062 plugins. :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :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 Mar 28, 2021 4 - Beta N/A - :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Apr 12, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Jun 10, 2022 4 - Beta N/A :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. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest :pypi:`pytest-valgrind` May 19, 2021 N/A N/A :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A + :pypi:`pytest-variant` Variant support for Pytest Jun 06, 2022 N/A N/A :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Apr 21, 2022 4 - Beta pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 06, 2022 5 - Production/Stable pytest (>=6.2.2,<7.0.0) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A @@ -1100,7 +1100,7 @@ This list contains 1062 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: May 31, 2022, + *last release*: Jun 07, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1275,9 +1275,9 @@ This list contains 1062 plugins. A pytest plugin for testing Anki add-ons :pypi:`pytest-annotate` - *last release*: Nov 29, 2021, + *last release*: Jun 07, 2022, *status*: 3 - Alpha, - *requires*: pytest (<7.0.0,>=3.2.0) + *requires*: pytest (<8.0.0,>=3.2.0) pytest-annotate: Generate PyAnnotate annotations from your pytest tests. @@ -2297,7 +2297,7 @@ This list contains 1062 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Jun 02, 2022, + *last release*: Jun 08, 2022, *status*: N/A, *requires*: N/A @@ -3165,35 +3165,35 @@ This list contains 1062 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A @@ -3207,14 +3207,14 @@ This list contains 1062 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A @@ -3998,7 +3998,7 @@ This list contains 1062 plugins. Display "🔨 " instead of "." for passed pytest tests. :pypi:`pytest-harvest` - *last release*: Apr 01, 2021, + *last release*: Jun 10, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4068,7 +4068,7 @@ This list contains 1062 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 03, 2022, + *last release*: Jun 11, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4229,9 +4229,9 @@ This list contains 1062 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jan 14, 2022, + *last release*: Jun 08, 2022, *status*: 4 - Beta, - *requires*: pytest + *requires*: N/A A plugin to sent pytest results to an Ibutsu server @@ -4271,7 +4271,7 @@ This list contains 1062 plugins. ignore failures from flaky tests (pytest plugin) :pypi:`pytest-image-diff` - *last release*: Mar 17, 2022, + *last release*: Jun 08, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4334,7 +4334,7 @@ This list contains 1062 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: May 18, 2022, + *last release*: Jun 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4607,9 +4607,9 @@ This list contains 1062 plugins. :pypi:`pytest-launchable` - *last release*: Jun 03, 2022, + *last release*: Jun 09, 2022, *status*: N/A, - *requires*: pytest + *requires*: pytest (>=4.2.0) Launchable Pytest Plugin @@ -5188,9 +5188,9 @@ This list contains 1062 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jun 03, 2022, + *last release*: Jun 07, 2022, *status*: 4 - Beta, - *requires*: pytest + *requires*: pytest (>=6) low-startup-overhead, scalable, distributed-testing pytest plugin @@ -5727,11 +5727,11 @@ This list contains 1062 plugins. Pytest tool for persistent objects :pypi:`pytest-pg` - *last release*: Jan 18, 2022, + *last release*: Jun 07, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) - Helps to run PostgreSQL in docker as pytest fixture + A tiny plugin for pytest which runs PostgreSQL in Docker :pypi:`pytest-pgsql` *last release*: May 13, 2020, @@ -6245,7 +6245,7 @@ This list contains 1062 plugins. RabbitMQ process and client fixtures for pytest :pypi:`pytest-race` - *last release*: Nov 21, 2016, + *last release*: Jun 07, 2022, *status*: 4 - Beta, *requires*: N/A @@ -6434,7 +6434,7 @@ This list contains 1062 plugins. Pytest plugin for controlling remote data access. :pypi:`pytest-remote-response` - *last release*: Jun 30, 2021, + *last release*: Jun 05, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.6) @@ -6819,7 +6819,7 @@ This list contains 1062 plugins. :pypi:`pytest-sbase` - *last release*: Jun 03, 2022, + *last release*: Jun 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6861,7 +6861,7 @@ This list contains 1062 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jun 03, 2022, + *last release*: Jun 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7218,9 +7218,9 @@ This list contains 1062 plugins. Splinter plugin for pytest testing framework :pypi:`pytest-splinter4` - *last release*: Dec 22, 2021, + *last release*: Jun 11, 2022, *status*: 6 - Mature, - *requires*: pytest (>=6.2.4) + *requires*: pytest (<8.0,>=7.1.2) Pytest plugin for the splinter automation library @@ -8100,9 +8100,9 @@ This list contains 1062 plugins. Test equality of unordered collections in pytest :pypi:`pytest-unstable` - *last release*: Apr 12, 2022, + *last release*: Jun 10, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: N/A Set a test as unstable to return 0 even if it failed @@ -8142,7 +8142,7 @@ This list contains 1062 plugins. pytest plugin for providing variables to tests/fixtures :pypi:`pytest-variant` - *last release*: Jun 20, 2021, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A @@ -8156,8 +8156,8 @@ This list contains 1062 plugins. Plugin for managing VCR.py cassettes :pypi:`pytest-vcr-delete-on-fail` - *last release*: Apr 21, 2022, - *status*: 4 - Beta, + *last release*: Jun 06, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.2,<7.0.0) A pytest plugin that automates vcrpy cassettes deletion on test failure. From 96412d19abb244325a72f16974646cc5afb7d2b1 Mon Sep 17 00:00:00 2001 From: Zach OBrien Date: Tue, 14 Jun 2022 05:54:32 -0400 Subject: [PATCH 099/255] Fix representation of tuples in approx Closes #9917 --- AUTHORS | 1 + changelog/9917.bugfix.rst | 1 + src/_pytest/python_api.py | 20 +++++++++++-------- testing/python/approx.py | 42 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 changelog/9917.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 61c3901beaa..6a88d2bbb71 100644 --- a/AUTHORS +++ b/AUTHORS @@ -361,5 +361,6 @@ Yoav Caspi Yuval Shimon Zac Hatfield-Dodds Zachary Kneupper +Zachary OBrien Zoltán Máté Zsolt Cserna diff --git a/changelog/9917.bugfix.rst b/changelog/9917.bugfix.rst new file mode 100644 index 00000000000..ac0616d2ee7 --- /dev/null +++ b/changelog/9917.bugfix.rst @@ -0,0 +1 @@ +Fixed string representation for :func:`pytest.approx` when used to compare tuples. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index ba3b48783ce..426b93ac2d4 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -133,9 +133,11 @@ def _check_type(self) -> None: # raise if there are any non-numeric elements in the sequence. -def _recursive_list_map(f, x): - if isinstance(x, list): - return [_recursive_list_map(f, xi) for xi in x] +def _recursive_sequence_map(f, x): + """Recursively map a function over a sequence of arbitary depth""" + if isinstance(x, (list, tuple)): + seq_type = type(x) + return seq_type(_recursive_sequence_map(f, xi) for xi in x) else: return f(x) @@ -144,7 +146,9 @@ class ApproxNumpy(ApproxBase): """Perform approximate comparisons where the expected value is numpy array.""" def __repr__(self) -> str: - list_scalars = _recursive_list_map(self._approx_scalar, self.expected.tolist()) + list_scalars = _recursive_sequence_map( + self._approx_scalar, self.expected.tolist() + ) return f"approx({list_scalars!r})" def _repr_compare(self, other_side: "ndarray") -> List[str]: @@ -164,7 +168,7 @@ def get_value_from_nested_list( return value np_array_shape = self.expected.shape - approx_side_as_list = _recursive_list_map( + approx_side_as_seq = _recursive_sequence_map( self._approx_scalar, self.expected.tolist() ) @@ -179,7 +183,7 @@ def get_value_from_nested_list( max_rel_diff = -math.inf different_ids = [] for index in itertools.product(*(range(i) for i in np_array_shape)): - approx_value = get_value_from_nested_list(approx_side_as_list, index) + approx_value = get_value_from_nested_list(approx_side_as_seq, index) other_value = get_value_from_nested_list(other_side, index) if approx_value != other_value: abs_diff = abs(approx_value.expected - other_value) @@ -194,7 +198,7 @@ def get_value_from_nested_list( ( str(index), str(get_value_from_nested_list(other_side, index)), - str(get_value_from_nested_list(approx_side_as_list, index)), + str(get_value_from_nested_list(approx_side_as_seq, index)), ) for index in different_ids ] @@ -326,7 +330,7 @@ def _repr_compare(self, other_side: Sequence[float]) -> List[str]: f"Lengths: {len(self.expected)} and {len(other_side)}", ] - approx_side_as_map = _recursive_list_map(self._approx_scalar, self.expected) + approx_side_as_map = _recursive_sequence_map(self._approx_scalar, self.expected) number_of_elements = len(approx_side_as_map) max_abs_diff = -math.inf diff --git a/testing/python/approx.py b/testing/python/approx.py index 7b4fbad156e..6acb466ffb1 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -2,12 +2,14 @@ from contextlib import contextmanager from decimal import Decimal from fractions import Fraction +from math import sqrt from operator import eq from operator import ne from typing import Optional import pytest from _pytest.pytester import Pytester +from _pytest.python_api import _recursive_sequence_map from pytest import approx inf, nan = float("inf"), float("nan") @@ -133,6 +135,18 @@ def test_error_messages_native_dtypes(self, assert_approx_raises_regex): ], ) + assert_approx_raises_regex( + (1, 2.2, 4), + (1, 3.2, 4), + [ + r" comparison failed. Mismatched elements: 1 / 3:", + rf" Max absolute difference: {SOME_FLOAT}", + rf" Max relative difference: {SOME_FLOAT}", + r" Index \| Obtained\s+\| Expected ", + rf" 1 \| {SOME_FLOAT} \| {SOME_FLOAT} ± {SOME_FLOAT}", + ], + ) + # Specific test for comparison with 0.0 (relative diff will be 'inf') assert_approx_raises_regex( [0.0], @@ -878,3 +892,31 @@ 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"): assert {1, 2, 3} == approx({1, 2, 3}) + + +class TestRecursiveSequenceMap: + def test_map_over_scalar(self): + assert _recursive_sequence_map(sqrt, 16) == 4 + + def test_map_over_empty_list(self): + assert _recursive_sequence_map(sqrt, []) == [] + + def test_map_over_list(self): + assert _recursive_sequence_map(sqrt, [4, 16, 25, 676]) == [2, 4, 5, 26] + + def test_map_over_tuple(self): + assert _recursive_sequence_map(sqrt, (4, 16, 25, 676)) == (2, 4, 5, 26) + + def test_map_over_nested_lists(self): + assert _recursive_sequence_map(sqrt, [4, [25, 64], [[49]]]) == [ + 2, + [5, 8], + [[7]], + ] + + def test_map_over_mixed_sequence(self): + assert _recursive_sequence_map(sqrt, [4, (25, 64), [(49)]]) == [ + 2, + (5, 8), + [(7)], + ] From d6b837e2d31310d61be46ea954ff74f94be69e55 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 14 Jun 2022 07:01:34 -0300 Subject: [PATCH 100/255] Mark pdb+expect tests as xfail for now Related to #10042 --- testing/test_debugging.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index a95b542adec..9298726a561 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -353,6 +353,7 @@ def test_pdb_prevent_ConftestImportFailure_hiding_exception( result = pytester.runpytest_subprocess("--pdb", ".") result.stdout.fnmatch_lines(["-> import unknown"]) + @pytest.mark.xfail(reason="#10042") def test_pdb_interaction_capturing_simple(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ @@ -521,6 +522,7 @@ def function_1(): assert "BdbQuit" not in rest assert "UNEXPECTED EXCEPTION" not in rest + @pytest.mark.xfail(reason="#10042") def test_pdb_interaction_capturing_twice(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ @@ -556,6 +558,7 @@ def test_1(): assert "1 failed" in rest self.flush(child) + @pytest.mark.xfail(reason="#10042") def test_pdb_with_injected_do_debug(self, pytester: Pytester) -> None: """Simulates pdbpp, which injects Pdb into do_debug, and uses self.__class__ in do_continue. @@ -1000,6 +1003,7 @@ def test_1(): assert "reading from stdin while output" not in rest TestPDB.flush(child) + @pytest.mark.xfail(reason="#10042") def test_pdb_not_altered(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ @@ -1159,6 +1163,7 @@ def test_2(): @pytest.mark.parametrize("fixture", ("capfd", "capsys")) +@pytest.mark.xfail(reason="#10042") def test_pdb_suspends_fixture_capturing(pytester: Pytester, fixture: str) -> None: """Using "-s" with pytest should suspend/resume fixture capturing.""" p1 = pytester.makepyfile( From fab696dcd1ecd621ed05d2552b7d790ab143efe5 Mon Sep 17 00:00:00 2001 From: Chris Wheeler Date: Tue, 14 Jun 2022 07:24:35 -0400 Subject: [PATCH 101/255] Add support for .pytest.ini as an alternative to pytest.ini Closes #9987 --- AUTHORS | 1 + changelog/9987.improvement.rst | 1 + doc/en/reference/customize.rst | 4 +++- doc/en/reference/reference.rst | 7 ++++--- src/_pytest/config/findpaths.py | 1 + testing/test_config.py | 11 ++++++++--- 6 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 changelog/9987.improvement.rst diff --git a/AUTHORS b/AUTHORS index 6a88d2bbb71..d1f1b5503f2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -67,6 +67,7 @@ Cheuk Ting Ho Chris Lamb Chris NeJame Chris Rose +Chris Wheeler Christian Boelsen Christian Fetzer Christian Neumüller diff --git a/changelog/9987.improvement.rst b/changelog/9987.improvement.rst new file mode 100644 index 00000000000..cb1ae17ad2c --- /dev/null +++ b/changelog/9987.improvement.rst @@ -0,0 +1 @@ +Added support for hidden configuration file by allowing ``.pytest.ini`` as an alternative to ``pytest.ini``. diff --git a/doc/en/reference/customize.rst b/doc/en/reference/customize.rst index fe10ca066b2..b6d21445a7e 100644 --- a/doc/en/reference/customize.rst +++ b/doc/en/reference/customize.rst @@ -29,9 +29,11 @@ pytest.ini ``pytest.ini`` files take precedence over other files, even when empty. +Alternatively, the hidden version ``.pytest.ini`` can be used. + .. code-block:: ini - # pytest.ini + # pytest.ini or .pytest.ini [pytest] minversion = 6.0 addopts = -ra -q diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 6402e0af64f..4ea391be2a8 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1154,9 +1154,10 @@ Consult the :ref:`internal-warnings` section in the documentation for more infor Configuration Options --------------------- -Here is a list of builtin configuration options that may be written in a ``pytest.ini``, ``pyproject.toml``, ``tox.ini`` or ``setup.cfg`` -file, usually located at the root of your repository. To see each file format in details, see -:ref:`config file formats`. +Here is a list of builtin configuration options that may be written in a ``pytest.ini`` (or ``.pytest.ini``), +``pyproject.toml``, ``tox.ini``, or ``setup.cfg`` file, usually located at the root of your repository. + +To see each file format in details, see :ref:`config file formats`. .. warning:: Usage of ``setup.cfg`` is not recommended except for very simple use cases. ``.cfg`` diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index ead344baac5..43c2367793e 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -96,6 +96,7 @@ def locate_config( and return a tuple of (rootdir, inifile, cfg-dict).""" config_names = [ "pytest.ini", + ".pytest.ini", "pyproject.toml", "tox.ini", "setup.cfg", diff --git a/testing/test_config.py b/testing/test_config.py index ac0c159a833..c2e3fe5bbcf 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -112,21 +112,26 @@ def test_tox_ini_wrong_version(self, pytester: Pytester) -> None: @pytest.mark.parametrize( "section, name", - [("tool:pytest", "setup.cfg"), ("pytest", "tox.ini"), ("pytest", "pytest.ini")], + [ + ("tool:pytest", "setup.cfg"), + ("pytest", "tox.ini"), + ("pytest", "pytest.ini"), + ("pytest", ".pytest.ini"), + ], ) def test_ini_names(self, pytester: Pytester, name, section) -> None: pytester.path.joinpath(name).write_text( textwrap.dedent( """ [{section}] - minversion = 1.0 + minversion = 3.36 """.format( section=section ) ) ) config = pytester.parseconfig() - assert config.getini("minversion") == "1.0" + assert config.getini("minversion") == "3.36" def test_pyproject_toml(self, pytester: Pytester) -> None: pytester.makepyprojecttoml( From 17c385180d7fdb160e79ca619545344ba40012ed Mon Sep 17 00:00:00 2001 From: James Gerity Date: Thu, 16 Jun 2022 11:39:41 -0400 Subject: [PATCH 102/255] Indicate support for a tuple of exceptions in xfail raises= --- doc/en/reference/reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 4ea391be2a8..4ce8ead7173 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -245,7 +245,7 @@ Marks a test function as *expected to fail*. :keyword str reason: Reason why the test function is marked as xfail. :keyword Type[Exception] raises: - Exception subclass expected to be raised by the test function; other exceptions will fail the test. + Exception subclass (or tuple of subclasses) expected to be raised by the test function; other exceptions will fail the test. :keyword bool run: If the test function should actually be executed. If ``False``, the function will always xfail and will not be executed (useful if a function is segfaulting). From 5a9536cf42a9f570de7e43285bb3313c39240816 Mon Sep 17 00:00:00 2001 From: Paul Reece Date: Fri, 17 Jun 2022 11:52:18 -0400 Subject: [PATCH 103/255] Added Docstring description for the Path property of the FixtureRequest class. --- src/_pytest/fixtures.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index fc6539db0fd..32c3ec4b0bf 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -486,6 +486,7 @@ def module(self): @property def path(self) -> Path: + """Path where the test function was collected.""" if self.scope not in ("function", "class", "module", "package"): raise AttributeError(f"path not available in {self.scope}-scoped context") # TODO: Remove ignore once _pyfuncitem is properly typed. From cdc287d21aab827d3a11981ecf26745b777e9dfe Mon Sep 17 00:00:00 2001 From: Paul Reece Date: Fri, 17 Jun 2022 12:00:18 -0400 Subject: [PATCH 104/255] Added self to Authors --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index d1f1b5503f2..939c671dcdf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -261,6 +261,7 @@ Oscar Benjamin Parth Patel Patrick Hayes Paul Müller +Paul Reece Pauli Virtanen Pavel Karateev Paweł Adamczak From 052da7128b57b9192a350f85dbbd1666555be10d Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 21 Jun 2022 22:53:28 +0300 Subject: [PATCH 105/255] Replace deprecated logging.warn with .warning --- testing/test_debugging.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index 9298726a561..08ae09658ac 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -244,7 +244,7 @@ def test_pdb_print_captured_logs(self, pytester, showcapture: str) -> None: """ def test_1(): import logging - logging.warn("get " + "rekt") + logging.warning("get " + "rekt") assert False """ ) @@ -263,7 +263,7 @@ def test_pdb_print_captured_logs_nologging(self, pytester: Pytester) -> None: """ def test_1(): import logging - logging.warn("get " + "rekt") + logging.warning("get " + "rekt") assert False """ ) From 1e6a587363f03de2644dcb4fa2ce2f5220c6fc2e Mon Sep 17 00:00:00 2001 From: Chanvin Xiao Date: Wed, 22 Jun 2022 20:06:37 +0800 Subject: [PATCH 106/255] Doc: Clear mailbox before deleting the user --- doc/en/how-to/fixtures.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 14bf12cf982..b90b40619f5 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -631,6 +631,7 @@ Here's what that might look like: def receiving_user(mail_admin): user = mail_admin.create_user() yield user + user.clear_mailbox() mail_admin.delete_user(user) From 6db715c205f0964eaaf3d452bf5fda35505fd73c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:16:23 +0000 Subject: [PATCH 107/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/en/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 0022363b27e..3c26b8ce0b7 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -320,7 +320,9 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)] +man_pages = [ + ("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1) +] # -- Options for Epub output --------------------------------------------------- From 74691346bdf89c6588cf3a2c10505fce30ccd366 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 22 Jun 2022 08:29:02 -0700 Subject: [PATCH 108/255] fix some typos to ensure pre-commit.ci fixes main --- src/_pytest/config/argparsing.py | 2 +- src/_pytest/python_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index fa27aa6203b..830bbd2e2cd 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -227,7 +227,7 @@ class Argument: _typ_map = {"int": int, "string": str, "float": float, "complex": complex} def __init__(self, *names: str, **attrs: Any) -> None: - """Store parms in private vars for use in add_argument.""" + """Store params in private vars for use in add_argument.""" self._attrs = attrs self._short_opts: List[str] = [] self._long_opts: List[str] = [] diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 426b93ac2d4..10762ee7b98 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -134,7 +134,7 @@ def _check_type(self) -> None: def _recursive_sequence_map(f, x): - """Recursively map a function over a sequence of arbitary depth""" + """Recursively map a function over a sequence of arbitrary depth""" if isinstance(x, (list, tuple)): seq_type = type(x) return seq_type(_recursive_sequence_map(f, xi) for xi in x) From cba65e74b34c0b31c0538acad86e29b78899aa29 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:32:04 +0000 Subject: [PATCH 109/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/en/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 0022363b27e..3c26b8ce0b7 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -320,7 +320,9 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)] +man_pages = [ + ("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1) +] # -- Options for Epub output --------------------------------------------------- From 0a7b8722e58fcebb5fdeb7b811c679cbae29dd92 Mon Sep 17 00:00:00 2001 From: Kevin C Date: Thu, 23 Jun 2022 17:54:51 -0700 Subject: [PATCH 110/255] Clarify writing_plugins naming instructions Fixes: #10072 --- AUTHORS | 1 + doc/en/how-to/writing_plugins.rst | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index d1f1b5503f2..9144f43be39 100644 --- a/AUTHORS +++ b/AUTHORS @@ -187,6 +187,7 @@ Katarzyna Jachim Katarzyna Król Katerina Koukiou Keri Volans +Kevin C Kevin Cox Kevin J. Foley Kian Eliasi diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 3e43d3252b7..2fbf49718ce 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -158,18 +158,20 @@ it in your setuptools-invocation: # sample ./setup.py file from setuptools import setup + + name_of_plugin = "myproject" # register plugin with this name setup( name="myproject", packages=["myproject"], # the following makes a plugin available to pytest - entry_points={"pytest11": ["name_of_plugin = myproject.pluginmodule"]}, + entry_points={"pytest11": [f"{name_of_plugin} = myproject.pluginmodule"]}, # custom PyPI classifier for pytest plugins classifiers=["Framework :: Pytest"], ) If a package is installed this way, ``pytest`` will load ``myproject.pluginmodule`` as a plugin which can define -:ref:`hooks `. +:ref:`hooks `. Confirm registration with ``pytest --trace-config`` .. note:: From c7e784f95d6ff7dc1e9d1a1dbc234a39c0125816 Mon Sep 17 00:00:00 2001 From: "zx.qiu" Date: Wed, 15 Jun 2022 23:11:55 +0800 Subject: [PATCH 111/255] Fix stage caplog records not clear Closes #9877 --- AUTHORS | 1 + changelog/9877.bugfix.rst | 1 + src/_pytest/logging.py | 12 ++++++++++++ testing/logging/test_fixture.py | 13 +++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 changelog/9877.bugfix.rst diff --git a/AUTHORS b/AUTHORS index d1f1b5503f2..7d27f5adadf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -363,5 +363,6 @@ Yuval Shimon Zac Hatfield-Dodds Zachary Kneupper Zachary OBrien +Zhouxin Qiu Zoltán Máté Zsolt Cserna diff --git a/changelog/9877.bugfix.rst b/changelog/9877.bugfix.rst new file mode 100644 index 00000000000..ace3a4385a4 --- /dev/null +++ b/changelog/9877.bugfix.rst @@ -0,0 +1 @@ +Fixed ``caplog.get_records(when)`` still get the stage records after ``caplog.clear()`` diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index a4f4214b137..96709ae93cf 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -335,6 +335,16 @@ def __init__(self) -> None: """Create a new log handler.""" super().__init__(StringIO()) self.records: List[logging.LogRecord] = [] + self.set_when(None) + + def set_when(self, when: Optional[str]) -> None: + """Prepare for the given test phase (setup/call/teardown).""" + self._when = when + + def get_when(self) -> Optional[str]: + return self._when + + when = property(get_when, set_when) def emit(self, record: logging.LogRecord) -> None: """Keep the log records in a list in addition to the log text.""" @@ -441,6 +451,7 @@ def messages(self) -> List[str]: def clear(self) -> None: """Reset the list of log records and the captured log text.""" self.handler.reset() + self._item.stash[caplog_records_key][self.handler.when] = self.records def set_level(self, level: Union[int, str], logger: Optional[str] = None) -> None: """Set the level of a logger for the duration of a test. @@ -695,6 +706,7 @@ def _runtest_for(self, item: nodes.Item, when: str) -> Generator[None, None, Non level=self.log_level, ) as report_handler: caplog_handler.reset() + caplog_handler.set_when(when) report_handler.reset() item.stash[caplog_records_key][when] = caplog_handler.records item.stash[caplog_handler_key] = caplog_handler diff --git a/testing/logging/test_fixture.py b/testing/logging/test_fixture.py index bcb20de5805..6b85ce60a63 100644 --- a/testing/logging/test_fixture.py +++ b/testing/logging/test_fixture.py @@ -172,6 +172,19 @@ def test_caplog_captures_for_all_stages(caplog, logging_during_setup_and_teardow assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} +def test_clear_for_call_stage(caplog, logging_during_setup_and_teardown): + logger.info("a_call_log") + assert [x.message for x in caplog.get_records("call")] == ["a_call_log"] + assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"] + assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} + + caplog.clear() + + assert caplog.get_records("call") == [] + assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"] + assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} + + def test_ini_controls_global_log_level(pytester: Pytester) -> None: pytester.makepyfile( """ From f29f79e39f698d33ec773b24a06b38c38ee0cdaa Mon Sep 17 00:00:00 2001 From: "zx.qiu" Date: Fri, 24 Jun 2022 19:17:55 +0800 Subject: [PATCH 112/255] Use records.clear() in LogCaptureHandler when caplog.clear() --- src/_pytest/logging.py | 19 +++++-------------- testing/logging/test_fixture.py | 5 +++++ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 96709ae93cf..2eb69fdbfb4 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -40,7 +40,6 @@ else: logging_StreamHandler = logging.StreamHandler - DEFAULT_LOG_FORMAT = "%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s" DEFAULT_LOG_DATE_FORMAT = "%H:%M:%S" _ANSI_ESCAPE_SEQ = re.compile(r"\x1b\[[\d;]+m") @@ -335,16 +334,6 @@ def __init__(self) -> None: """Create a new log handler.""" super().__init__(StringIO()) self.records: List[logging.LogRecord] = [] - self.set_when(None) - - def set_when(self, when: Optional[str]) -> None: - """Prepare for the given test phase (setup/call/teardown).""" - self._when = when - - def get_when(self) -> Optional[str]: - return self._when - - when = property(get_when, set_when) def emit(self, record: logging.LogRecord) -> None: """Keep the log records in a list in addition to the log text.""" @@ -355,6 +344,10 @@ def reset(self) -> None: self.records = [] self.stream = StringIO() + def clear(self) -> None: + self.records.clear() + self.stream = StringIO() + def handleError(self, record: logging.LogRecord) -> None: if logging.raiseExceptions: # Fail the test if the log message is bad (emit failed). @@ -450,8 +443,7 @@ def messages(self) -> List[str]: def clear(self) -> None: """Reset the list of log records and the captured log text.""" - self.handler.reset() - self._item.stash[caplog_records_key][self.handler.when] = self.records + self.handler.clear() def set_level(self, level: Union[int, str], logger: Optional[str] = None) -> None: """Set the level of a logger for the duration of a test. @@ -706,7 +698,6 @@ def _runtest_for(self, item: nodes.Item, when: str) -> Generator[None, None, Non level=self.log_level, ) as report_handler: caplog_handler.reset() - caplog_handler.set_when(when) report_handler.reset() item.stash[caplog_records_key][when] = caplog_handler.records item.stash[caplog_handler_key] = caplog_handler diff --git a/testing/logging/test_fixture.py b/testing/logging/test_fixture.py index 6b85ce60a63..e9e73d05f98 100644 --- a/testing/logging/test_fixture.py +++ b/testing/logging/test_fixture.py @@ -184,6 +184,11 @@ def test_clear_for_call_stage(caplog, logging_during_setup_and_teardown): assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"] assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} + logging.info("a_call_log_after_clear") + assert [x.message for x in caplog.get_records("call")] == ["a_call_log_after_clear"] + assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"] + assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} + def test_ini_controls_global_log_level(pytester: Pytester) -> None: pytester.makepyfile( From 62d975a69ee06bc4e94a5719145fe65a0c6c4bef Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 26 Jun 2022 00:25:07 +0000 Subject: [PATCH 113/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 200 ++++++++++++++++++++++--------- 1 file changed, 144 insertions(+), 56 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index d29f5ddcc44..a1bae76cef4 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1062 plugins. +This list contains 1073 plugins. .. only:: not latex @@ -44,7 +44,7 @@ This list contains 1062 plugins. :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-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :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 Oct 14, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jun 20, 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-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A @@ -90,7 +90,7 @@ This list contains 1062 plugins. :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.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. Jun 02, 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. Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) @@ -109,7 +109,7 @@ This list contains 1062 plugins. :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :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-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. May 30, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. Jun 16, 2022 N/A pytest ; extra == 'dev' :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 @@ -156,6 +156,7 @@ This list contains 1062 plugins. :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A + :pypi:`pytest-circleci-parallelized-rjp` Parallelize pytest across CircleCI workers. Jun 21, 2022 N/A pytest :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A @@ -164,6 +165,7 @@ This list contains 1062 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-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) + :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 Apr 12, 2022 4 - Beta pytest (>=4.6.0) :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A @@ -205,7 +207,7 @@ This list contains 1062 plugins. :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-cython-collect` May 04, 2022 N/A pytest + :pypi:`pytest-cython-collect` Jun 17, 2022 N/A pytest :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A @@ -220,6 +222,7 @@ This list contains 1062 plugins. :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :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. Apr 20, 2020 5 - Production/Stable pytest + :pypi:`pytest-data-suites` Class-based pytest parametrization Jun 18, 2022 N/A pytest (>=6.0,<8.0) :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A @@ -323,9 +326,10 @@ This list contains 1062 plugins. :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jun 24, 2022 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 12, 2022 4 - Beta pytest (==7.0.1) - :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A @@ -356,7 +360,7 @@ This list contains 1062 plugins. :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-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. May 31, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. Jun 14, 2022 6 - Mature pytest (>=5.0.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-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A @@ -444,7 +448,7 @@ This list contains 1062 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 11, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 23, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -467,7 +471,7 @@ This list contains 1062 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-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 08, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 24, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :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 May 04, 2022 5 - Production/Stable N/A @@ -483,7 +487,7 @@ This list contains 1062 plugins. :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 08, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules May 10, 2022 4 - Beta N/A + :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) @@ -521,7 +525,7 @@ This list contains 1062 plugins. :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 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A - :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 09, 2022 N/A pytest (>=4.2.0) + :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 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-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest @@ -581,13 +585,13 @@ This list contains 1062 plugins. :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.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 Jan 28, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jun 24, 2022 5 - Production/Stable pytest (>=5.0) :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. Apr 11, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jun 15, 2022 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-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -603,8 +607,8 @@ This list contains 1062 plugins. :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 07, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jun 15, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -645,7 +649,7 @@ This list contains 1062 plugins. :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A - :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A + :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest @@ -678,7 +682,7 @@ This list contains 1062 plugins. :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) - :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-perf` pytest-perf Jun 23, 2022 5 - Production/Stable pytest (>=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-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Jun 07, 2022 5 - Production/Stable pytest (>=6.0.0) @@ -750,7 +754,7 @@ This list contains 1062 plugins. :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) :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 Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 23, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A :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 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) @@ -758,7 +762,7 @@ This list contains 1062 plugins. :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Jun 20, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :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 @@ -769,13 +773,14 @@ This list contains 1062 plugins. :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. May 16, 2022 3 - Alpha N/A - :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 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-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A + :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. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A @@ -796,7 +801,7 @@ This list contains 1062 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :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 Apr 26, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 24, 2022 N/A pytest (>=3.8.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-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) @@ -831,25 +836,26 @@ This list contains 1062 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). May 10, 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 May 28, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Jun 17, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 24, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 24, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 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 Jun 24, 2022 1 - Planning pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :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 @@ -891,6 +897,7 @@ This list contains 1062 plugins. :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 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. May 04, 2021 N/A N/A + :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 19, 2022 N/A pytest (>7.0) :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A @@ -940,18 +947,20 @@ This list contains 1062 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terra-fixt` Terraform fixtures for pytest May 26, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-terra-fixt` Terraform fixtures for pytest Jun 18, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 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-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-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-test-grouping` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Jun 17, 2022 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Jun 01, 2022 4 - Beta N/A :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 Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) @@ -997,6 +1006,7 @@ This list contains 1062 plugins. :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A :pypi:`pytest-tornasync` py.test plugin for testing Python 3.5+ Tornado code Jul 15, 2019 3 - Alpha pytest (>=3.0) + :pypi:`pytest-trace` Save OpenTelemetry spans generated during testing Jun 19, 2022 N/A pytest (>=4.6) :pypi:`pytest-track` Feb 26, 2021 3 - Alpha pytest (>=3.0) :pypi:`pytest-translations` Test your translation files. Nov 05, 2021 5 - Production/Stable N/A :pypi:`pytest-travis-fold` Folds captured output sections in Travis CI build log Nov 29, 2017 4 - Beta pytest (>=2.6.0) @@ -1016,6 +1026,7 @@ This list contains 1062 plugins. :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :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-unflakable` Unflakable plugin for PyTest Jun 14, 2022 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-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A @@ -1028,7 +1039,7 @@ This list contains 1062 plugins. :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-variant` Variant support for Pytest Jun 06, 2022 N/A N/A :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 06, 2022 5 - Production/Stable pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A @@ -1268,7 +1279,7 @@ This list contains 1062 plugins. This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. :pypi:`pytest-anki` - *last release*: Oct 14, 2021, + *last release*: Jun 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -1590,7 +1601,7 @@ This list contains 1062 plugins. pytest plugin for axe-selenium-python :pypi:`pytest-azure-devops` - *last release*: Jun 02, 2022, + *last release*: Jun 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -1723,7 +1734,7 @@ This list contains 1062 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: May 30, 2022, + *last release*: Jun 16, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -2051,6 +2062,13 @@ This list contains 1062 plugins. Parallelize pytest across CircleCI workers. + :pypi:`pytest-circleci-parallelized-rjp` + *last release*: Jun 21, 2022, + *status*: N/A, + *requires*: pytest + + Parallelize pytest across CircleCI workers. + :pypi:`pytest-ckan` *last release*: Apr 28, 2020, *status*: 4 - Beta, @@ -2107,6 +2125,13 @@ This list contains 1062 plugins. PyTest plugin for testing Smart Contracts for Ethereum blockchain. + :pypi:`pytest-codecarbon` + *last release*: Jun 15, 2022, + *status*: N/A, + *requires*: pytest + + Pytest plugin for measuring carbon emissions + :pypi:`pytest-codecheckers` *last release*: Feb 13, 2010, *status*: N/A, @@ -2395,7 +2420,7 @@ This list contains 1062 plugins. A plugin for testing Cython extension modules :pypi:`pytest-cython-collect` - *last release*: May 04, 2022, + *last release*: Jun 17, 2022, *status*: N/A, *requires*: pytest @@ -2499,6 +2524,13 @@ This list contains 1062 plugins. A py.test plugin recording and comparing test output. + :pypi:`pytest-data-suites` + *last release*: Jun 18, 2022, + *status*: N/A, + *requires*: pytest (>=6.0,<8.0) + + Class-based pytest parametrization + :pypi:`pytest-datatest` *last release*: Oct 15, 2020, *status*: 4 - Beta, @@ -3220,6 +3252,13 @@ This list contains 1062 plugins. pytest embedded plugin for testing espressif boards via serial ports + :pypi:`pytest-embrace` + *last release*: Jun 24, 2022, + *status*: N/A, + *requires*: pytest (>=7.0,<8.0) + + 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. + :pypi:`pytest-emoji` *last release*: Feb 19, 2019, *status*: 4 - Beta, @@ -3235,7 +3274,7 @@ This list contains 1062 plugins. Pytest plugin to represent test output with emoji support :pypi:`pytest-enabler` - *last release*: Nov 08, 2021, + *last release*: Jun 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6) ; extra == 'testing' @@ -3452,7 +3491,7 @@ This list contains 1062 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: May 31, 2022, + *last release*: Jun 14, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -4068,7 +4107,7 @@ This list contains 1062 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 11, 2022, + *last release*: Jun 23, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4229,7 +4268,7 @@ This list contains 1062 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jun 08, 2022, + *last release*: Jun 24, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4341,7 +4380,7 @@ This list contains 1062 plugins. Common fixtures for inmanta LSM related modules :pypi:`pytest-inmanta-yang` - *last release*: May 10, 2022, + *last release*: Jun 16, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4607,7 +4646,7 @@ This list contains 1062 plugins. :pypi:`pytest-launchable` - *last release*: Jun 09, 2022, + *last release*: Jun 14, 2022, *status*: N/A, *requires*: pytest (>=4.2.0) @@ -5027,7 +5066,7 @@ This list contains 1062 plugins. pytest plugin to display test execution output like a mochajs :pypi:`pytest-mock` - *last release*: Jan 28, 2022, + *last release*: Jun 24, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -5069,7 +5108,7 @@ This list contains 1062 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*: Apr 11, 2022, + *last release*: Jun 15, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5181,14 +5220,14 @@ This list contains 1062 plugins. pytest plugin to collect information from tests :pypi:`pytest-mpl` - *last release*: Apr 22, 2022, + *last release*: Jun 15, 2022, *status*: 4 - Beta, *requires*: pytest pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jun 07, 2022, + *last release*: Jun 22, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5475,9 +5514,9 @@ This list contains 1062 plugins. The ultimate pytest output plugin :pypi:`pytest-only` - *last release*: Jan 19, 2020, - *status*: N/A, - *requires*: N/A + *last release*: Jun 14, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (<7.1); python_version <= "3.6" Use @pytest.mark.only to run a single test @@ -5706,7 +5745,7 @@ This list contains 1062 plugins. Change the exit code of pytest test sessions when a required percent of tests pass. :pypi:`pytest-perf` - *last release*: Feb 05, 2022, + *last release*: Jun 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6) ; extra == 'testing' @@ -6210,7 +6249,7 @@ This list contains 1062 plugins. pytest plugin to generate test result QR codes :pypi:`pytest-qt` - *last release*: Jun 13, 2021, + *last release*: Jun 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.0.0) @@ -6266,7 +6305,7 @@ This list contains 1062 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Apr 12, 2022, + *last release*: Jun 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6343,7 +6382,7 @@ This list contains 1062 plugins. Pytest fixtures for REANA. :pypi:`pytest-recording` - *last release*: Jul 08, 2021, + *last release*: Jun 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -6391,6 +6430,13 @@ This list contains 1062 plugins. Conveniently run pytest with a dot-formatted test reference. + :pypi:`pytest-regex-dependency` + *last release*: Jun 12, 2022, + *status*: N/A, + *requires*: pytest + + Management of Pytest dependencies via regex patterns + :pypi:`pytest-regressions` *last release*: Jan 19, 2022, *status*: 5 - Production/Stable, @@ -6532,7 +6578,7 @@ This list contains 1062 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Apr 26, 2022, + *last release*: Jun 24, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -6777,7 +6823,7 @@ This list contains 1062 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: May 28, 2022, + *last release*: Jun 17, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6819,7 +6865,7 @@ This list contains 1062 plugins. :pypi:`pytest-sbase` - *last release*: Jun 08, 2022, + *last release*: Jun 24, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6861,7 +6907,7 @@ This list contains 1062 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jun 08, 2022, + *last release*: Jun 24, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6909,6 +6955,13 @@ This list contains 1062 plugins. Automatically mocks resources from serverless.yml in pytest using moto. + :pypi:`pytest-servers` + *last release*: Jun 24, 2022, + *status*: 1 - Planning, + *requires*: pytest (==7.1.2) + + pytest servers + :pypi:`pytest-services` *last release*: Oct 30, 2020, *status*: 6 - Mature, @@ -7196,6 +7249,13 @@ This list contains 1062 plugins. Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. + :pypi:`pytest-spec2md` + *last release*: Jun 19, 2022, + *status*: N/A, + *requires*: pytest (>7.0) + + Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. + :pypi:`pytest-sphinx` *last release*: Mar 30, 2022, *status*: 4 - Beta, @@ -7540,7 +7600,7 @@ This list contains 1062 plugins. Predictable and repeatable tempdir support. :pypi:`pytest-terra-fixt` - *last release*: May 26, 2022, + *last release*: Jun 18, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -7588,6 +7648,13 @@ This list contains 1062 plugins. A testdox format reporter for pytest + :pypi:`pytest-test-grouping` + *last release*: Jun 17, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=2.5) + + A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. + :pypi:`pytest-test-groups` *last release*: Oct 25, 2016, *status*: 5 - Production/Stable, @@ -7596,7 +7663,7 @@ This list contains 1062 plugins. A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. :pypi:`pytest-testinfra` - *last release*: Apr 12, 2022, + *last release*: Jun 19, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=3.0.2) @@ -7623,6 +7690,13 @@ This list contains 1062 plugins. nOly selects tests affected by changed files and methods + :pypi:`pytest-testmon-skip-libraries` + *last release*: Jun 13, 2022, + *status*: 4 - Beta, + *requires*: N/A + + selects tests affected by changed files and methods + :pypi:`pytest-testobject` *last release*: Sep 24, 2019, *status*: 4 - Beta, @@ -7938,6 +8012,13 @@ This list contains 1062 plugins. py.test plugin for testing Python 3.5+ Tornado code + :pypi:`pytest-trace` + *last release*: Jun 19, 2022, + *status*: N/A, + *requires*: pytest (>=4.6) + + Save OpenTelemetry spans generated during testing + :pypi:`pytest-track` *last release*: Feb 26, 2021, *status*: 3 - Alpha, @@ -8071,6 +8152,13 @@ This list contains 1062 plugins. Text User Interface for running python tests + :pypi:`pytest-unflakable` + *last release*: Jun 14, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.2.0) + + Unflakable plugin for PyTest + :pypi:`pytest-unhandled-exception-exit-code` *last release*: Jun 22, 2020, *status*: 5 - Production/Stable, @@ -8156,9 +8244,9 @@ This list contains 1062 plugins. Plugin for managing VCR.py cassettes :pypi:`pytest-vcr-delete-on-fail` - *last release*: Jun 06, 2022, + *last release*: Jun 20, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=6.2.2,<7.0.0) + *requires*: pytest (>=6.2.2) A pytest plugin that automates vcrpy cassettes deletion on test failure. From f92c4a77ada65a40700272c5af8cef302dbb4c27 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 26 Jun 2022 10:06:18 -0300 Subject: [PATCH 114/255] Use PurePath directly instead of os.path.sep in rewrite.py Given we are already creating a `PurePath`, just pass the parts directly to it. This avoids using `os.path.sep`, that although is an official API, seems not to be available in all systems. Fix #9791 --- changelog/9791.bugfix.rst | 1 + src/_pytest/assertion/rewrite.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/9791.bugfix.rst diff --git a/changelog/9791.bugfix.rst b/changelog/9791.bugfix.rst new file mode 100644 index 00000000000..f81c870165b --- /dev/null +++ b/changelog/9791.bugfix.rst @@ -0,0 +1 @@ +Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems. diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 81096764e04..9d0b431b4a7 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -190,7 +190,7 @@ def _early_rewrite_bailout(self, name: str, state: "AssertionState") -> bool: return False # For matching the name it must be as if it was a filename. - path = PurePath(os.path.sep.join(parts) + ".py") + path = PurePath(*parts).with_suffix(".py") for pat in self.fnpats: # if the pattern contains subdirectories ("tests/**.py" for example) we can't bail out based From 0b1e9ba270ac99cff6d15e4ed6f626bacc86b671 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 03:02:47 +0000 Subject: [PATCH 115/255] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.7.0 to 3.8.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.7.0...v3.8.1) --- updated-dependencies: - dependency-name: pytest-mock 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 965762dae4b..2379afcd5b8 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==3.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.7.0 +pytest-mock==3.8.1 pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 From bd642fac70275133e8741a25aa652d7537c4b3db Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 26 Jun 2022 10:52:01 -0300 Subject: [PATCH 116/255] Do not call tearDown for skipped unittest.TestCases with --pdb Fix #10060 --- changelog/10060.bugfix.rst | 1 + src/_pytest/unittest.py | 5 +++- testing/test_unittest.py | 50 ++++++++++++++++++++++++++++++++++---- 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 changelog/10060.bugfix.rst diff --git a/changelog/10060.bugfix.rst b/changelog/10060.bugfix.rst new file mode 100644 index 00000000000..c8941820eca --- /dev/null +++ b/changelog/10060.bugfix.rst @@ -0,0 +1 @@ +When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``. diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index 851e4943b23..c2df986530c 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -316,7 +316,10 @@ def runtest(self) -> None: # Arguably we could always postpone tearDown(), but this changes the moment where the # TestCase instance interacts with the results object, so better to only do it # when absolutely needed. - if self.config.getoption("usepdb") and not _is_skipped(self.obj): + # We need to consider if the test itself is skipped, or the whole class. + assert isinstance(self.parent, UnitTestCase) + skipped = _is_skipped(self.obj) or _is_skipped(self.parent.obj) + if self.config.getoption("usepdb") and not skipped: self._explicit_tearDown = self._testcase.tearDown setattr(self._testcase, "tearDown", lambda *args: None) diff --git a/testing/test_unittest.py b/testing/test_unittest.py index fb312814542..d917d331a03 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1241,12 +1241,15 @@ def test_2(self): @pytest.mark.parametrize("mark", ["@unittest.skip", "@pytest.mark.skip"]) -def test_pdb_teardown_skipped( +def test_pdb_teardown_skipped_for_functions( pytester: Pytester, monkeypatch: MonkeyPatch, mark: str ) -> None: - """With --pdb, setUp and tearDown should not be called for skipped tests.""" + """ + With --pdb, setUp and tearDown should not be called for tests skipped + via a decorator (#7215). + """ tracked: List[str] = [] - monkeypatch.setattr(pytest, "test_pdb_teardown_skipped", tracked, raising=False) + monkeypatch.setattr(pytest, "track_pdb_teardown_skipped", tracked, raising=False) pytester.makepyfile( """ @@ -1256,10 +1259,10 @@ def test_pdb_teardown_skipped( class MyTestCase(unittest.TestCase): def setUp(self): - pytest.test_pdb_teardown_skipped.append("setUp:" + self.id()) + pytest.track_pdb_teardown_skipped.append("setUp:" + self.id()) def tearDown(self): - pytest.test_pdb_teardown_skipped.append("tearDown:" + self.id()) + pytest.track_pdb_teardown_skipped.append("tearDown:" + self.id()) {mark}("skipped for reasons") def test_1(self): @@ -1274,6 +1277,43 @@ def test_1(self): assert tracked == [] +@pytest.mark.parametrize("mark", ["@unittest.skip", "@pytest.mark.skip"]) +def test_pdb_teardown_skipped_for_classes( + pytester: Pytester, monkeypatch: MonkeyPatch, mark: str +) -> None: + """ + With --pdb, setUp and tearDown should not be called for tests skipped + via a decorator on the class (#10060). + """ + tracked: List[str] = [] + monkeypatch.setattr(pytest, "track_pdb_teardown_skipped", tracked, raising=False) + + pytester.makepyfile( + """ + import unittest + import pytest + + {mark}("skipped for reasons") + class MyTestCase(unittest.TestCase): + + def setUp(self): + pytest.track_pdb_teardown_skipped.append("setUp:" + self.id()) + + def tearDown(self): + pytest.track_pdb_teardown_skipped.append("tearDown:" + self.id()) + + def test_1(self): + pass + + """.format( + mark=mark + ) + ) + result = pytester.runpytest_inprocess("--pdb") + result.stdout.fnmatch_lines("* 1 skipped in *") + assert tracked == [] + + def test_async_support(pytester: Pytester) -> None: pytest.importorskip("unittest.async_case") From b961ef5b798cf698e4be7613ec555800b1762d14 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 20:50:23 +0000 Subject: [PATCH 117/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.2.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.2.0...v4.3.0) - [github.com/asottile/pyupgrade: v2.32.1 → v2.34.0](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.34.0) - [github.com/pre-commit/mirrors-mypy: v0.960 → v0.961](https://github.com/pre-commit/mirrors-mypy/compare/v0.960...v0.961) --- .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 c98ff7ea12a..2f8b36049b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: blacken-docs additional_dependencies: [black==20.8b1] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -42,7 +42,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + rev: v2.34.0 hooks: - id: pyupgrade args: [--py37-plus] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.960 + rev: v0.961 hooks: - id: mypy files: ^(src/|testing/) From c34eaaaa1c485e9c8c3d1fe7f05549b6436f49cc Mon Sep 17 00:00:00 2001 From: Alice Purcell Date: Wed, 29 Jun 2022 14:38:59 +0100 Subject: [PATCH 118/255] Pass importmode to import_path in DoctestModule This allows doctest to be used with namespace modules --- changelog/3396.improvement.rst | 1 + src/_pytest/doctest.py | 6 +++++- testing/test_doctest.py | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 changelog/3396.improvement.rst diff --git a/changelog/3396.improvement.rst b/changelog/3396.improvement.rst new file mode 100644 index 00000000000..aa3f278c2a6 --- /dev/null +++ b/changelog/3396.improvement.rst @@ -0,0 +1 @@ +Doctests now respect the ``--import-mode`` flag. diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index ac5a29bb923..ed072fcd628 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -542,7 +542,11 @@ def _find( ) else: try: - module = import_path(self.path, root=self.config.rootpath) + module = import_path( + self.path, + root=self.config.rootpath, + mode=self.config.getoption("importmode"), + ) except ImportError: if self.config.getvalue("doctest_ignore_import_errors"): pytest.skip("unable to import module %r" % self.path) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 1b4809240c0..828253d3223 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -113,6 +113,28 @@ def test_simple_doctestfile(self, pytester: Pytester): reprec = pytester.inline_run(p) reprec.assertoutcome(failed=1) + def test_importmode(self, pytester: Pytester): + p = pytester.makepyfile( + **{ + "namespacepkg/innerpkg/__init__.py": "", + "namespacepkg/innerpkg/a.py": """ + def some_func(): + return 42 + """, + "namespacepkg/innerpkg/b.py": """ + from namespacepkg.innerpkg.a import some_func + def my_func(): + ''' + >>> my_func() + 42 + ''' + return some_func() + """, + } + ) + reprec = pytester.inline_run(p, "--doctest-modules", "--import-mode=importlib") + reprec.assertoutcome(passed=1) + def test_new_pattern(self, pytester: Pytester): p = pytester.maketxtfile( xdoc=""" From 85000f037f33e34eb8b0a8d6430a9a33fbb1ee29 Mon Sep 17 00:00:00 2001 From: Alice Purcell Date: Wed, 29 Jun 2022 14:39:04 +0100 Subject: [PATCH 119/255] Added Alice Purcell to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 2d3439b6ca1..8530e2e01dc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -15,6 +15,7 @@ Alan Velasco Alexander Johnson Alexander King Alexei Kozlenok +Alice Purcell Allan Feldman Aly Sivji Amir Elkess From 1b47de7d7f2a5353dfd0c1c549532e873999f5bf Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 29 Jun 2022 13:13:15 -0400 Subject: [PATCH 120/255] update does_not_raise docs now that pytest is 3.7+ only --- doc/en/example/parametrize.rst | 31 ++++--------------------------- testing/python/raises.py | 12 ++---------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 24dd5ecaa38..f8147683975 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -657,21 +657,17 @@ Use :func:`pytest.raises` with the :ref:`pytest.mark.parametrize ref` decorator to write parametrized tests in which some tests raise exceptions and others do not. -It is helpful to define a no-op context manager ``does_not_raise`` to serve -as a complement to ``raises``. For example: +It may be helpful to use ``nullcontext`` as a complement to ``raises``. + +For example: .. code-block:: python - from contextlib import contextmanager + from contextlib import nullcontext as does_not_raise import pytest - @contextmanager - def does_not_raise(): - yield - - @pytest.mark.parametrize( "example_input,expectation", [ @@ -688,22 +684,3 @@ as a complement to ``raises``. For example: In the example above, the first three test cases should run unexceptionally, while the fourth should raise ``ZeroDivisionError``. - -If you're only supporting Python 3.7+, you can simply use ``nullcontext`` -to define ``does_not_raise``: - -.. code-block:: python - - from contextlib import nullcontext as does_not_raise - -Or, if you're supporting Python 3.3+ you can use: - -.. code-block:: python - - from contextlib import ExitStack as does_not_raise - -Or, if desired, you can ``pip install contextlib2`` and use: - -.. code-block:: python - - from contextlib2 import nullcontext as does_not_raise diff --git a/testing/python/raises.py b/testing/python/raises.py index f1f6ece4ee0..3dcec31eb1f 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -92,13 +92,9 @@ def test_raise_wrong_exception_passes_by(): def test_does_not_raise(self, pytester: Pytester) -> None: pytester.makepyfile( """ - from contextlib import contextmanager + from contextlib import nullcontext as does_not_raise import pytest - @contextmanager - def does_not_raise(): - yield - @pytest.mark.parametrize('example_input,expectation', [ (3, does_not_raise()), (2, does_not_raise()), @@ -117,13 +113,9 @@ def test_division(example_input, expectation): def test_does_not_raise_does_raise(self, pytester: Pytester) -> None: pytester.makepyfile( """ - from contextlib import contextmanager + from contextlib import nullcontext as does_not_raise import pytest - @contextmanager - def does_not_raise(): - yield - @pytest.mark.parametrize('example_input,expectation', [ (0, does_not_raise()), (1, pytest.raises(ZeroDivisionError)), From 3e590fe79e05e5fd5d1f0f328c1afe272d28ad40 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 30 Jun 2022 05:47:02 -0700 Subject: [PATCH 121/255] git mv changelog/3396.{improvement,bugfix}.rst --- changelog/{3396.improvement.rst => 3396.bugfix.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{3396.improvement.rst => 3396.bugfix.rst} (100%) diff --git a/changelog/3396.improvement.rst b/changelog/3396.bugfix.rst similarity index 100% rename from changelog/3396.improvement.rst rename to changelog/3396.bugfix.rst From 04de180f4177c7be26e993b3291f32dfcfab0d0d Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 3 Jul 2022 00:22:59 +0000 Subject: [PATCH 122/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 92 +++++++++++++++++++------------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index a1bae76cef4..ba2dde43027 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1073 plugins. +This list contains 1075 plugins. .. only:: not latex @@ -39,7 +39,7 @@ This list contains 1073 plugins. :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Feb 21, 2022 N/A pytest + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Jun 28, 2022 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-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) @@ -54,6 +54,7 @@ This list contains 1073 plugins. :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A 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-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A @@ -326,7 +327,7 @@ This list contains 1073 plugins. :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jun 24, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 01, 2022 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 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -343,7 +344,7 @@ This list contains 1073 plugins. :pypi:`pytest-error-for-skips` Pytest plugin to treat skipped tests a test failure Dec 19, 2019 4 - Beta pytest (>=4.6) :pypi:`pytest-eth` PyTest plugin for testing Smart Contracts for Ethereum Virtual Machine (EVM). Aug 14, 2020 1 - Planning N/A :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' - :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Aug 13, 2019 N/A pytest (>=4.2.0) + :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Jun 28, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A @@ -426,7 +427,7 @@ This list contains 1073 plugins. :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A - :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) + :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Jul 02, 2022 N/A pytest (>=4.0.0) :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality May 19, 2022 4 - Beta pytest @@ -471,10 +472,10 @@ This list contains 1073 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-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 24, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 27, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :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 May 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Jun 29, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest @@ -555,7 +556,7 @@ This list contains 1073 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-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers May 26, 2022 3 - Alpha pytest + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 02, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha 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-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A @@ -591,7 +592,7 @@ This list contains 1073 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. Jun 15, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jun 28, 2022 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-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -608,7 +609,7 @@ This list contains 1073 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jun 15, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 22, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 01, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -684,7 +685,7 @@ This list contains 1073 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Jun 23, 2022 5 - Production/Stable pytest (>=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-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Jun 27, 2022 N/A N/A :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Jun 07, 2022 5 - Production/Stable pytest (>=6.0.0) :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) @@ -751,7 +752,7 @@ This list contains 1073 plugins. :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-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. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) :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 Jun 23, 2022 5 - Production/Stable pytest (>=3.0.0) @@ -762,7 +763,7 @@ This list contains 1073 plugins. :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Jun 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Jun 29, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :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 @@ -832,6 +833,7 @@ This list contains 1073 plugins. :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-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Jul 02, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :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). May 10, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A @@ -842,20 +844,20 @@ This list contains 1073 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 24, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 01, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 24, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 01, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 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 Jun 24, 2022 1 - Planning pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Jul 01, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :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 @@ -880,7 +882,7 @@ This list contains 1073 plugins. :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :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-smell` Automated bad smell detection tool for Pytest May 17, 2022 N/A N/A + :pypi:`pytest-smell` Automated bad smell detection tool for Pytest Jun 26, 2022 N/A N/A :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A @@ -897,7 +899,7 @@ This list contains 1073 plugins. :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 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. May 04, 2021 N/A N/A - :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 19, 2022 N/A pytest (>7.0) + :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A @@ -978,7 +980,7 @@ This list contains 1073 plugins. :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) - :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) + :pypi:`pytest-test-utils` Jun 30, 2022 N/A pytest (>=5) :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A @@ -1244,7 +1246,7 @@ This list contains 1073 plugins. Plugin for py.test to generate allure xml reports :pypi:`pytest-allure-collection` - *last release*: Feb 21, 2022, + *last release*: Jun 28, 2022, *status*: N/A, *requires*: pytest @@ -1348,6 +1350,13 @@ This list contains 1073 plugins. Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures + :pypi:`pytest-aoreporter` + *last release*: Jun 27, 2022, + *status*: N/A, + *requires*: N/A + + pytest report + :pypi:`pytest-api` *last release*: May 12, 2022, *status*: N/A, @@ -3253,7 +3262,7 @@ This list contains 1073 plugins. pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Jun 24, 2022, + *last release*: Jul 01, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -3372,7 +3381,7 @@ This list contains 1073 plugins. pytest-ethereum: Pytest library for ethereum projects. :pypi:`pytest-eucalyptus` - *last release*: Aug 13, 2019, + *last release*: Jun 28, 2022, *status*: N/A, *requires*: pytest (>=4.2.0) @@ -3953,7 +3962,7 @@ This list contains 1073 plugins. Plugin for py.test that associates tests with github issues using a marker. :pypi:`pytest-github-actions-annotate-failures` - *last release*: Dec 08, 2021, + *last release*: Jul 02, 2022, *status*: N/A, *requires*: pytest (>=4.0.0) @@ -4268,7 +4277,7 @@ This list contains 1073 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jun 24, 2022, + *last release*: Jun 27, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4289,7 +4298,7 @@ This list contains 1073 plugins. 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 :pypi:`pytest-idem` - *last release*: May 04, 2022, + *last release*: Jun 29, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4856,7 +4865,7 @@ This list contains 1073 plugins. Pytest Loguru :pypi:`pytest-lsp` - *last release*: May 26, 2022, + *last release*: Jul 02, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -5108,7 +5117,7 @@ This list contains 1073 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*: Jun 15, 2022, + *last release*: Jun 28, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5227,7 +5236,7 @@ This list contains 1073 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jun 22, 2022, + *last release*: Jul 01, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5759,7 +5768,7 @@ This list contains 1073 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Apr 22, 2022, + *last release*: Jun 27, 2022, *status*: N/A, *requires*: N/A @@ -6228,7 +6237,7 @@ This list contains 1073 plugins. Pytest plugin for uploading test results to your QA Touch Testrun. :pypi:`pytest-qgis` - *last release*: Mar 17, 2022, + *last release*: Jun 26, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.3) @@ -6305,7 +6314,7 @@ This list contains 1073 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Jun 20, 2022, + *last release*: Jun 29, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6794,6 +6803,13 @@ This list contains 1073 plugins. Invoke py.test as distutils command with dependency resolution + :pypi:`pytest-run-subprocess` + *last release*: Jul 02, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Pytest Plugin for running and testing subprocesses. + :pypi:`pytest-runtime-xfail` *last release*: Aug 26, 2021, *status*: N/A, @@ -6865,7 +6881,7 @@ This list contains 1073 plugins. :pypi:`pytest-sbase` - *last release*: Jun 24, 2022, + *last release*: Jul 01, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6907,7 +6923,7 @@ This list contains 1073 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jun 24, 2022, + *last release*: Jul 01, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6956,8 +6972,8 @@ This list contains 1073 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jun 24, 2022, - *status*: 1 - Planning, + *last release*: Jul 01, 2022, + *status*: 3 - Alpha, *requires*: pytest (==7.1.2) pytest servers @@ -7131,7 +7147,7 @@ This list contains 1073 plugins. Smart coverage plugin for pytest. :pypi:`pytest-smell` - *last release*: May 17, 2022, + *last release*: Jun 26, 2022, *status*: N/A, *requires*: N/A @@ -7250,7 +7266,7 @@ This list contains 1073 plugins. Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. :pypi:`pytest-spec2md` - *last release*: Jun 19, 2022, + *last release*: Jun 26, 2022, *status*: N/A, *requires*: pytest (>7.0) @@ -7817,7 +7833,7 @@ This list contains 1073 plugins. Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply :pypi:`pytest-test-utils` - *last release*: Dec 14, 2021, + *last release*: Jun 30, 2022, *status*: N/A, *requires*: pytest (>=5) From b99541e7441d7d1235bb8649da14fdd67fd38368 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 22:38:23 +0000 Subject: [PATCH 123/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0) - [github.com/asottile/reorder_python_imports: v3.1.0 → v3.3.0](https://github.com/asottile/reorder_python_imports/compare/v3.1.0...v3.3.0) --- .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 2f8b36049b6..e9496d6a0c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.6.0 hooks: - id: black args: [--safe, --quiet] @@ -37,7 +37,7 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.1.0 + rev: v3.3.0 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] From 6d7973942f077bc90dd2488e6c39afe8cc8f96e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 22:37:17 +0000 Subject: [PATCH 124/255] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.0.5 to 4.0.6. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.5...4.0.6) --- updated-dependencies: - dependency-name: django 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 2379afcd5b8..6e61df2790e 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.0.5 +django==4.0.6 pytest-asyncio==0.18.3 pytest-bdd==5.0.0 pytest-cov==3.0.0 From 4449bdc068f598b226ad7dc72a7ea03f38a1307d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 6 Jul 2022 04:05:08 -0700 Subject: [PATCH 125/255] Remove europython training (#10107) --- doc/en/index.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 501ec913388..870fd5a2b15 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,6 @@ .. sidebar:: Next Open Trainings - - `Europython `__, July 11th 2022 (3h), Dublin, Ireland - `CH Open Workshop-Tage `__ (German), September 8th 2022, Bern, Switzerland - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany From aa83fa353c58c8b9f6b6afecbc5a223e9731d720 Mon Sep 17 00:00:00 2001 From: EmptyRabbit <32815055+EmptyRabbit@users.noreply.github.com> Date: Thu, 7 Jul 2022 19:29:50 +0800 Subject: [PATCH 126/255] Update changelog/9877.bugfix.rst Co-authored-by: Ronny Pfannschmidt --- changelog/9877.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/9877.bugfix.rst b/changelog/9877.bugfix.rst index ace3a4385a4..77b1b8c38ff 100644 --- a/changelog/9877.bugfix.rst +++ b/changelog/9877.bugfix.rst @@ -1 +1 @@ -Fixed ``caplog.get_records(when)`` still get the stage records after ``caplog.clear()`` +ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()`` From 87265973218e37bf7839bfbbd25fe69f1fe50a15 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 7 Jul 2022 09:39:57 -0300 Subject: [PATCH 127/255] Update changelog/9877.bugfix.rst --- changelog/9877.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/9877.bugfix.rst b/changelog/9877.bugfix.rst index 77b1b8c38ff..1d2264c6157 100644 --- a/changelog/9877.bugfix.rst +++ b/changelog/9877.bugfix.rst @@ -1 +1 @@ -ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()`` +Ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()``. From 4cd0322ca18bf2f9e4f27f22d2c46c25cdc8b1e2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 8 Jul 2022 16:01:14 -0400 Subject: [PATCH 128/255] replace atomicwrites with os.replace --- .pre-commit-config.yaml | 1 - changelog/10114.trivial.rst | 1 + setup.cfg | 1 - src/_pytest/assertion/rewrite.py | 68 +++++++++++--------------------- testing/test_assertrewrite.py | 25 ++---------- 5 files changed, 26 insertions(+), 70 deletions(-) create mode 100644 changelog/10114.trivial.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9496d6a0c6..11757b940bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -67,7 +67,6 @@ repos: - attrs>=19.2.0 - packaging - tomli - - types-atomicwrites - types-pkg_resources - repo: local hooks: diff --git a/changelog/10114.trivial.rst b/changelog/10114.trivial.rst new file mode 100644 index 00000000000..42c43a1d0d6 --- /dev/null +++ b/changelog/10114.trivial.rst @@ -0,0 +1 @@ +Replace `atomicwrites `__ dependency on windows with `os.replace`. diff --git a/setup.cfg b/setup.cfg index c4f5bd9d29f..3545a9503a8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,7 +46,6 @@ install_requires = packaging pluggy>=0.12,<2.0 py>=1.8.2 - atomicwrites>=1.0;sys_platform=="win32" colorama;sys_platform=="win32" importlib-metadata>=0.12;python_version<"3.8" tomli>=1.0.0;python_version<"3.11" diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 9d0b431b4a7..a1bbb171b4b 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -302,53 +302,29 @@ def _write_pyc_fp( fp.write(marshal.dumps(co)) -if sys.platform == "win32": - from atomicwrites import atomic_write - - def _write_pyc( - state: "AssertionState", - co: types.CodeType, - source_stat: os.stat_result, - pyc: Path, - ) -> bool: - try: - with atomic_write(os.fspath(pyc), mode="wb", overwrite=True) as fp: - _write_pyc_fp(fp, source_stat, co) - except OSError as e: - state.trace(f"error writing pyc file at {pyc}: {e}") - # we ignore any failure to write the cache file - # there are many reasons, permission-denied, pycache dir being a - # file etc. - return False - return True - -else: - - def _write_pyc( - state: "AssertionState", - co: types.CodeType, - source_stat: os.stat_result, - pyc: Path, - ) -> bool: - proc_pyc = f"{pyc}.{os.getpid()}" - try: - fp = open(proc_pyc, "wb") - except OSError as e: - state.trace(f"error writing pyc file at {proc_pyc}: errno={e.errno}") - return False - - try: +def _write_pyc( + state: "AssertionState", + co: types.CodeType, + source_stat: os.stat_result, + pyc: Path, +) -> bool: + proc_pyc = f"{pyc}.{os.getpid()}" + try: + with open(proc_pyc, "wb") as fp: _write_pyc_fp(fp, source_stat, co) - os.rename(proc_pyc, pyc) - except OSError as e: - state.trace(f"error writing pyc file at {pyc}: {e}") - # we ignore any failure to write the cache file - # there are many reasons, permission-denied, pycache dir being a - # file etc. - return False - finally: - fp.close() - return True + except OSError as e: + state.trace(f"error writing pyc file at {proc_pyc}: errno={e.errno}") + return False + + try: + os.replace(proc_pyc, pyc) + except OSError as e: + state.trace(f"error writing pyc file at {pyc}: {e}") + # we ignore any failure to write the cache file + # there are many reasons, permission-denied, pycache dir being a + # file etc. + return False + return True def _rewrite_test(fn: Path, config: Config) -> Tuple[os.stat_result, types.CodeType]: diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 41458b52b0e..3c98392ed98 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1009,7 +1009,7 @@ def test_meta_path(): ) assert pytester.runpytest().ret == 0 - def test_write_pyc(self, pytester: Pytester, tmp_path, monkeypatch) -> None: + def test_write_pyc(self, pytester: Pytester, tmp_path) -> None: from _pytest.assertion.rewrite import _write_pyc from _pytest.assertion import AssertionState @@ -1021,27 +1021,8 @@ def test_write_pyc(self, pytester: Pytester, tmp_path, monkeypatch) -> None: co = compile("1", "f.py", "single") assert _write_pyc(state, co, os.stat(source_path), pycpath) - if sys.platform == "win32": - from contextlib import contextmanager - - @contextmanager - def atomic_write_failed(fn, mode="r", overwrite=False): - e = OSError() - e.errno = 10 - raise e - yield # type:ignore[unreachable] - - monkeypatch.setattr( - _pytest.assertion.rewrite, "atomic_write", atomic_write_failed - ) - else: - - def raise_oserror(*args): - raise OSError() - - monkeypatch.setattr("os.rename", raise_oserror) - - assert not _write_pyc(state, co, os.stat(source_path), pycpath) + with mock.patch.object(os, "replace", side_effect=OSError): + assert not _write_pyc(state, co, os.stat(source_path), pycpath) def test_resources_provider_for_loader(self, pytester: Pytester) -> None: """ From dda7673f571873872ad89357265164005356aae0 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 10 Jul 2022 00:24:23 +0000 Subject: [PATCH 129/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 116 ++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 42 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index ba2dde43027..0dcf90ac574 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1075 plugins. +This list contains 1079 plugins. .. only:: not latex @@ -50,7 +50,7 @@ This list contains 1075 plugins. :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 - :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest + :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jul 05, 2022 5 - Production/Stable pytest :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' @@ -95,7 +95,7 @@ This list contains 1075 plugins. :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) + :pypi:`pytest-bdd` BDD for pytest Jul 07, 2022 6 - Mature pytest (>=5.0) :pypi:`pytest-bdd-ng` BDD for pytest May 25, 2022 4 - Beta pytest (>=5.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) @@ -155,6 +155,7 @@ This list contains 1075 plugins. :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest + :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A :pypi:`pytest-circleci-parallelized-rjp` Parallelize pytest across CircleCI workers. Jun 21, 2022 N/A pytest @@ -162,7 +163,7 @@ This list contains 1075 plugins. :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-clld` Nov 29, 2021 N/A pytest (>=3.6) + :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) :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-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) @@ -279,7 +280,7 @@ This list contains 1075 plugins. :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) :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 Nov 23, 2021 3 - Alpha N/A + :pypi:`pytest-docker-fixtures` pytest docker fixtures Jul 06, 2022 3 - Alpha N/A :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest @@ -327,7 +328,7 @@ This list contains 1075 plugins. :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 01, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 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 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -372,7 +373,7 @@ This list contains 1075 plugins. :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A :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 Jun 02, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 03, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) @@ -449,7 +450,7 @@ This list contains 1075 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 23, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 09, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -586,7 +587,7 @@ This list contains 1075 plugins. :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.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 Jun 24, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jul 05, 2022 5 - Production/Stable pytest (>=5.0) :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 @@ -609,7 +610,7 @@ This list contains 1075 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jun 15, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 01, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 03, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -631,7 +632,7 @@ This list contains 1075 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 Mar 15, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jul 07, 2022 N/A pytest (==6.2.5) :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 Jul 07, 2021 N/A N/A @@ -783,7 +784,7 @@ This list contains 1075 plugins. :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A :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. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A + :pypi:`pytest-regtest` pytest plugin for regression tests Jul 08, 2022 N/A N/A :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A @@ -805,12 +806,13 @@ This list contains 1075 plugins. :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 24, 2022 N/A pytest (>=3.8.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-requests-futures` Pytest Plugin to Mock Requests Futures Jul 06, 2022 5 - Production/Stable 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-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 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-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :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-resilient-circuits` Resilient Circuits fixtures for PyTest. May 23, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Jul 07, 2022 N/A N/A :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 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A @@ -833,7 +835,7 @@ This list contains 1075 plugins. :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-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Jul 02, 2022 5 - Production/Stable pytest + :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Jul 03, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :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). May 10, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A @@ -844,20 +846,20 @@ This list contains 1075 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 01, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 08, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 01, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 08, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 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 01, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Jul 04, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :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 @@ -900,6 +902,7 @@ This list contains 1075 plugins. :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. May 04, 2021 N/A N/A :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) + :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jul 06, 2022 3 - Alpha pytest (>=7) :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A @@ -972,7 +975,7 @@ This list contains 1075 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 24, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results May 23, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -985,7 +988,7 @@ This list contains 1075 plugins. :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A - :pypi:`pytest-threadleak` Detects thread leaks Jan 18, 2022 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-threadleak` Detects thread leaks Jul 03, 2022 4 - Beta pytest (>=3.1.1) :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) @@ -1004,6 +1007,7 @@ This list contains 1075 plugins. :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 :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) + :pypi:`pytest-tools` Pytest tools Jul 04, 2022 4 - Beta N/A :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A @@ -1032,7 +1036,7 @@ This list contains 1075 plugins. :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-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :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 Mar 28, 2021 4 - Beta N/A + :pypi:`pytest-unordered` Test equality of unordered collections in pytest Jul 08, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Jun 10, 2022 4 - Beta N/A :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. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) @@ -1323,7 +1327,7 @@ This list contains 1075 plugins. A pytest plugin for running unit tests within an ansible collection :pypi:`pytest-antilru` - *last release*: Jan 29, 2022, + *last release*: Jul 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -1638,9 +1642,9 @@ This list contains 1075 plugins. pytest plugin for URL based testing :pypi:`pytest-bdd` - *last release*: Oct 25, 2021, + *last release*: Jul 07, 2022, *status*: 6 - Mature, - *requires*: pytest (>=4.3) + *requires*: pytest (>=5.0) BDD for pytest @@ -2057,6 +2061,13 @@ This list contains 1075 plugins. pytest plugin to test Check_MK checks + :pypi:`pytest-chunks` + *last release*: Jul 05, 2022, + *status*: N/A, + *requires*: pytest (>=6.0.0) + + Run only a chunk of your test suite + :pypi:`pytest-circleci` *last release*: May 03, 2019, *status*: N/A, @@ -2107,7 +2118,7 @@ This list contains 1075 plugins. Pytest plugin for Click :pypi:`pytest-clld` - *last release*: Nov 29, 2021, + *last release*: Jul 06, 2022, *status*: N/A, *requires*: pytest (>=3.6) @@ -2926,7 +2937,7 @@ This list contains 1075 plugins. A plugin to use docker databases for pytests :pypi:`pytest-docker-fixtures` - *last release*: Nov 23, 2021, + *last release*: Jul 06, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -3262,7 +3273,7 @@ This list contains 1075 plugins. pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Jul 01, 2022, + *last release*: Jul 05, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -3577,7 +3588,7 @@ This list contains 1075 plugins. :pypi:`pytest-fastapi-deps` - *last release*: Jun 02, 2022, + *last release*: Jul 03, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4116,9 +4127,9 @@ This list contains 1075 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 23, 2022, + *last release*: Jul 09, 2022, *status*: 3 - Alpha, - *requires*: pytest (==7.1.1) + *requires*: pytest (==7.1.2) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -5075,7 +5086,7 @@ This list contains 1075 plugins. pytest plugin to display test execution output like a mochajs :pypi:`pytest-mock` - *last release*: Jun 24, 2022, + *last release*: Jul 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -5236,7 +5247,7 @@ This list contains 1075 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jul 01, 2022, + *last release*: Jul 03, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5390,7 +5401,7 @@ This list contains 1075 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Mar 15, 2022, + *last release*: Jul 07, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6454,7 +6465,7 @@ This list contains 1075 plugins. Easy to use fixtures to write regression tests. :pypi:`pytest-regtest` - *last release*: Jun 03, 2021, + *last release*: Jul 08, 2022, *status*: N/A, *requires*: N/A @@ -6607,6 +6618,13 @@ This list contains 1075 plugins. A simple plugin to use with pytest + :pypi:`pytest-requests-futures` + *last release*: Jul 06, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Pytest Plugin to Mock Requests Futures + :pypi:`pytest-requires` *last release*: Dec 21, 2021, *status*: 4 - Beta, @@ -6643,7 +6661,7 @@ This list contains 1075 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: May 23, 2022, + *last release*: Jul 07, 2022, *status*: N/A, *requires*: N/A @@ -6804,7 +6822,7 @@ This list contains 1075 plugins. Invoke py.test as distutils command with dependency resolution :pypi:`pytest-run-subprocess` - *last release*: Jul 02, 2022, + *last release*: Jul 03, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6881,7 +6899,7 @@ This list contains 1075 plugins. :pypi:`pytest-sbase` - *last release*: Jul 01, 2022, + *last release*: Jul 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6923,7 +6941,7 @@ This list contains 1075 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jul 01, 2022, + *last release*: Jul 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6972,7 +6990,7 @@ This list contains 1075 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 01, 2022, + *last release*: Jul 04, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7272,6 +7290,13 @@ This list contains 1075 plugins. Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. + :pypi:`pytest-speed` + *last release*: Jul 06, 2022, + *status*: 3 - Alpha, + *requires*: pytest (>=7) + + Modern benchmarking library for python with pytest integration. + :pypi:`pytest-sphinx` *last release*: Mar 30, 2022, *status*: 4 - Beta, @@ -7777,7 +7802,7 @@ This list contains 1075 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: May 24, 2022, + *last release*: Jul 04, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -7868,7 +7893,7 @@ This list contains 1075 plugins. Pytest plugin for time travel :pypi:`pytest-threadleak` - *last release*: Jan 18, 2022, + *last release*: Jul 03, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.1.1) @@ -8000,6 +8025,13 @@ This list contains 1075 plugins. Numerous useful plugins for pytest. + :pypi:`pytest-tools` + *last release*: Jul 04, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Pytest tools + :pypi:`pytest-tornado` *last release*: Jun 17, 2020, *status*: 5 - Production/Stable, @@ -8197,9 +8229,9 @@ This list contains 1075 plugins. Run only unmarked tests :pypi:`pytest-unordered` - *last release*: Mar 28, 2021, + *last release*: Jul 08, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (>=6.0.0) Test equality of unordered collections in pytest From da68c9d5bc191ee88386d2639fe91877b36b02ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 03:02:47 +0000 Subject: [PATCH 130/255] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.8.1 to 3.8.2. - [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.8.1...v3.8.2) --- updated-dependencies: - dependency-name: pytest-mock dependency-type: direct:production update-type: version-update:semver-patch ... 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 6e61df2790e..a226cb82ebe 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==3.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.8.1 +pytest-mock==3.8.2 pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 From b1948c60acbd47c65e3068313aafb8ffbc14f32c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 03:02:49 +0000 Subject: [PATCH 131/255] build(deps): Bump pytest-sugar in /testing/plugins_integration Bumps [pytest-sugar](https://github.com/Teemu/pytest-sugar) from 0.9.4 to 0.9.5. - [Release notes](https://github.com/Teemu/pytest-sugar/releases) - [Changelog](https://github.com/Teemu/pytest-sugar/blob/master/CHANGES.rst) - [Commits](https://github.com/Teemu/pytest-sugar/commits) --- updated-dependencies: - dependency-name: pytest-sugar dependency-type: direct:production update-type: version-update:semver-patch ... 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 6e61df2790e..3c5144023e9 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -8,7 +8,7 @@ pytest-flakes==4.0.5 pytest-html==3.1.1 pytest-mock==3.8.1 pytest-rerunfailures==10.2 -pytest-sugar==0.9.4 +pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.13.4 twisted==22.4.0 From 9c5b6fbab239ca67bd26c4096b25635bce5bba58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 03:02:51 +0000 Subject: [PATCH 132/255] build(deps): Bump pytest-bdd in /testing/plugins_integration Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd) from 5.0.0 to 6.0.1. - [Release notes](https://github.com/pytest-dev/pytest-bdd/releases) - [Changelog](https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-bdd/compare/5.0.0...6.0.1) --- updated-dependencies: - dependency-name: pytest-bdd 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 6e61df2790e..7bf7ba8e7fc 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,7 +1,7 @@ anyio[curio,trio]==3.6.1 django==4.0.6 pytest-asyncio==0.18.3 -pytest-bdd==5.0.0 +pytest-bdd==6.0.1 pytest-cov==3.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 From 334d6514c6f4726a0c053e6e1ef9fb369deec762 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 11 Jul 2022 08:27:09 -0300 Subject: [PATCH 133/255] Fix mypy pre-commit run This started to fail recently with: ``` mypy.....................................................................Failed - hook id: mypy - exit code: 1 src/_pytest/assertion/rewrite.py:284: error: Returning Any from function declared to return "TraversableResources" [no-any-return] Found 1 error in 1 file (checked 219 source files) ``` Not sure why that started failing, but seems like ignoring that error specifically is OK. --- src/_pytest/assertion/rewrite.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index a1bbb171b4b..63f9dd8f27b 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -281,7 +281,9 @@ def get_resource_reader(self, name: str) -> importlib.abc.TraversableResources: else: from importlib.resources.readers import FileReader - return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) + return FileReader( # type:ignore[no-any-return] + types.SimpleNamespace(path=self._rewritten_names[name]) + ) def _write_pyc_fp( From 5c513a5fb3c2725177f5866b31a93a98e7018d62 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 21:57:36 +0000 Subject: [PATCH 134/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.3.0 → v3.8.1](https://github.com/asottile/reorder_python_imports/compare/v3.3.0...v3.8.1) - [github.com/asottile/pyupgrade: v2.34.0 → v2.37.1](https://github.com/asottile/pyupgrade/compare/v2.34.0...v2.37.1) --- .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 11757b940bf..6ac38a1d90b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,12 +37,12 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.3.0 + rev: v3.8.1 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 + rev: v2.37.1 hooks: - id: pyupgrade args: [--py37-plus] From 09b2c9532090db84daa3aa1a243f90dc8709fc00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 13 Jul 2022 17:06:33 +0200 Subject: [PATCH 135/255] Adjust tests for a last minute Python 3.11 change in the traceback format See https://github.com/python/cpython/issues/93883 and https://github.com/python/cpython/pull/93994 Fixes https://github.com/pytest-dev/pytest/issues/10131 --- testing/test_doctest.py | 6 +++++- testing/test_main.py | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 828253d3223..2f73feb8c4b 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -223,7 +223,11 @@ def test_doctest_unexpected_exception(self, pytester: Pytester): "Traceback (most recent call last):", ' File "*/doctest.py", line *, in __run', " *", - *((" *^^^^*",) if sys.version_info >= (3, 11) else ()), + *( + (" *^^^^*",) + if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) + else () + ), ' File "", line 1, in ', "ZeroDivisionError: division by zero", "*/test_doctest_unexpected_exception.txt:2: UnexpectedException", diff --git a/testing/test_main.py b/testing/test_main.py index 2df51bb7bb9..71597626790 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -47,7 +47,7 @@ def pytest_internalerror(excrepr, excinfo): end_lines = ( result.stdout.lines[-4:] - if sys.version_info >= (3, 11) + if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) else result.stdout.lines[-3:] ) @@ -57,7 +57,7 @@ def pytest_internalerror(excrepr, excinfo): 'INTERNALERROR> raise SystemExit("boom")', *( ("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",) - if sys.version_info >= (3, 11) + if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) else () ), "INTERNALERROR> SystemExit: boom", @@ -68,7 +68,7 @@ def pytest_internalerror(excrepr, excinfo): 'INTERNALERROR> raise ValueError("boom")', *( ("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",) - if sys.version_info >= (3, 11) + if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) else () ), "INTERNALERROR> ValueError: boom", From c1d134172cff3787dbfe51cd154af8f8d4b5e556 Mon Sep 17 00:00:00 2001 From: Nipunn Koorapati Date: Thu, 14 Jul 2022 16:36:05 -0700 Subject: [PATCH 136/255] Add typing for FixtureRequest.param (#10133) For now, mark it as Any until #8073 is solved Fixes #9514 --- AUTHORS | 1 + changelog/9514.bugfix.rst | 1 + src/_pytest/fixtures.py | 11 ++++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 changelog/9514.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 09fe12e004f..b0669ba29fd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -252,6 +252,7 @@ Nicholas Murphy Niclas Olofsson Nicolas Delaby Nikolay Kondratyev +Nipunn Koorapati Olga Matoula Oleg Pidsadnyi Oleg Sushchenko diff --git a/changelog/9514.bugfix.rst b/changelog/9514.bugfix.rst new file mode 100644 index 00000000000..a940b5c72d5 --- /dev/null +++ b/changelog/9514.bugfix.rst @@ -0,0 +1 @@ +Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 32c3ec4b0bf..d1d36d7fa24 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -345,7 +345,7 @@ def reorder_items_atscope( return items_done -def get_direct_param_fixture_func(request): +def get_direct_param_fixture_func(request: "FixtureRequest") -> Any: return request.param @@ -407,6 +407,15 @@ def __init__(self, pyfuncitem, *, _ispytest: bool = False) -> None: self._arg2fixturedefs = fixtureinfo.name2fixturedefs.copy() self._arg2index: Dict[str, int] = {} self._fixturemanager: FixtureManager = pyfuncitem.session._fixturemanager + # Notes on the type of `param`: + # -`request.param` is only defined in parametrized fixtures, and will raise + # AttributeError otherwise. Python typing has no notion of "undefined", so + # this cannot be reflected in the type. + # - Technically `param` is only (possibly) defined on SubRequest, not + # FixtureRequest, but the typing of that is still in flux so this cheats. + # - In the future we might consider using a generic for the param type, but + # for now just using Any. + self.param: Any @property def scope(self) -> "_ScopeName": From 70cac3d464905cb3f7cedba9ea4f61dc56613f55 Mon Sep 17 00:00:00 2001 From: Wolfremium <64548160+Wolfremium13@users.noreply.github.com> Date: Fri, 15 Jul 2022 12:40:18 +0100 Subject: [PATCH 137/255] Explicit note that tmpdir fixture is discouraged in favour of tmp_path #9937 (#10138) Co-authored-by: Bruno Oliveira Co-authored-by: kevin.hierro-ext Co-authored-by: Dani Sancas --- AUTHORS | 4 ++++ changelog/9937.doc.rst | 1 + doc/en/how-to/tmp_path.rst | 6 ++++-- src/_pytest/legacypath.py | 14 +++++++++++++- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 changelog/9937.doc.rst diff --git a/AUTHORS b/AUTHORS index b0669ba29fd..b8e6377fb02 100644 --- a/AUTHORS +++ b/AUTHORS @@ -87,6 +87,7 @@ Damian Skrzypczak Daniel Grana Daniel Hahler Daniel Nuri +Daniel Sánchez Castelló Daniel Wandschneider Daniele Procida Danielle Jenkins @@ -190,6 +191,7 @@ Katerina Koukiou Keri Volans Kevin C Kevin Cox +Kevin Hierro Carrasco Kevin J. Foley Kian Eliasi Kian-Meng Ang @@ -328,6 +330,7 @@ Taneli Hukkinen Tanvi Mehta Tarcisio Fischer Tareq Alayan +Tatiana Ovary Ted Xiao Terje Runde Thomas Grainger @@ -346,6 +349,7 @@ Tyler Goodlet Tzu-ping Chung Vasily Kuznetsov Victor Maryama +Victor Rodriguez Victor Uriarte Vidar T. Fauske Virgil Dupras diff --git a/changelog/9937.doc.rst b/changelog/9937.doc.rst new file mode 100644 index 00000000000..326d20ec8f6 --- /dev/null +++ b/changelog/9937.doc.rst @@ -0,0 +1 @@ +Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`. diff --git a/doc/en/how-to/tmp_path.rst b/doc/en/how-to/tmp_path.rst index b261a55637e..99e9e55367a 100644 --- a/doc/en/how-to/tmp_path.rst +++ b/doc/en/how-to/tmp_path.rst @@ -104,8 +104,10 @@ The ``tmpdir`` and ``tmpdir_factory`` fixtures The ``tmpdir`` and ``tmpdir_factory`` fixtures are similar to ``tmp_path`` and ``tmp_path_factory``, but use/return legacy `py.path.local`_ objects -rather than standard :class:`pathlib.Path` objects. These days, prefer to -use ``tmp_path`` and ``tmp_path_factory``. +rather than standard :class:`pathlib.Path` objects. + +.. note:: + These days, it is preferred to use ``tmp_path`` and ``tmp_path_factory``. See :fixture:`tmpdir ` :fixture:`tmpdir_factory ` API for details. diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index 49149311a7d..f71e7e96ead 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -271,7 +271,14 @@ def testdir(pytester: Pytester) -> Testdir: @attr.s(init=False, auto_attribs=True) class TempdirFactory: """Backward compatibility wrapper that implements :class:`py.path.local` - for :class:`TempPathFactory`.""" + for :class:`TempPathFactory`. + + .. note:: + These days, it is preferred to use ``tmp_path_factory``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + + """ _tmppath_factory: TempPathFactory @@ -312,6 +319,11 @@ def tmpdir(tmp_path: Path) -> LEGACY_PATH: The returned object is a `legacy_path`_ object. + .. note:: + These days, it is preferred to use ``tmp_path``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + .. _legacy_path: https://py.readthedocs.io/en/latest/path.html """ return legacy_path(tmp_path) From b8e2f42ec1fc552ce145182ab5868cbfa357d0ec Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Fri, 15 Jul 2022 19:24:16 +0000 Subject: [PATCH 138/255] Add monkeypatch.context() to how-to doc intro --- doc/en/how-to/monkeypatch.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/en/how-to/monkeypatch.rst b/doc/en/how-to/monkeypatch.rst index 0ae87824030..9214de77edb 100644 --- a/doc/en/how-to/monkeypatch.rst +++ b/doc/en/how-to/monkeypatch.rst @@ -25,6 +25,7 @@ functionality in tests: monkeypatch.delenv(name, raising=True) monkeypatch.syspath_prepend(path) monkeypatch.chdir(path) + monkeypatch.context() All modifications will be undone after the requesting test function or fixture has finished. The ``raising`` @@ -55,6 +56,9 @@ during a test. 5. Use :py:meth:`monkeypatch.syspath_prepend ` to modify ``sys.path`` which will also call ``pkg_resources.fixup_namespace_packages`` and :py:func:`importlib.invalidate_caches`. +6. Use :py:meth:`monkeypatch.context ` to apply patches only in a specific scope, which can help +control teardown of complex fixtures or patches to the stdlib. + See the `monkeypatch blog post`_ for some introduction material and a discussion of its motivation. From 4696ba74f90d8eecad453dd08e5f5493d697f2a9 Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Tue, 19 Jul 2022 22:16:14 +0200 Subject: [PATCH 139/255] Fix typo in example/markers docs --- doc/en/example/markers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 2260dbf423b..34d96c2bc00 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -346,7 +346,7 @@ Custom marker and command line option to control test runs Plugins can provide custom markers and implement specific behaviour based on it. This is a self-contained example which adds a command line option and a parametrized test function marker to run tests -specifies via named environments: +specified via named environments: .. code-block:: python From 8c5487fd6b733de1e0e44194350908ee77e2bf0a Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Wed, 20 Jul 2022 00:01:23 +0200 Subject: [PATCH 140/255] Fix cross-reference in reference/reference docs --- doc/en/reference/reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 4ce8ead7173..bdad8fa597d 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -290,7 +290,7 @@ Example for using multiple custom markers: def test_function(): ... -When :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers>` or :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers_with_node>` is used with multiple markers, the marker closest to the function will be iterated over first. The above example will result in ``@pytest.mark.slow`` followed by ``@pytest.mark.timeout(...)``. +When :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers>` or :meth:`Node.iter_markers_with_node <_pytest.nodes.Node.iter_markers_with_node>` is used with multiple markers, the marker closest to the function will be iterated over first. The above example will result in ``@pytest.mark.slow`` followed by ``@pytest.mark.timeout(...)``. .. _`fixtures-api`: From 3bf15135e46ab525d28377cf54e97a6a9516223c Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 24 Jul 2022 00:25:01 +0000 Subject: [PATCH 141/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 258 +++++++++++++++++++------------ 1 file changed, 161 insertions(+), 97 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 0dcf90ac574..03b15620d0d 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1079 plugins. +This list contains 1087 plugins. .. only:: not latex @@ -30,12 +30,12 @@ This list contains 1079 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Mar 13, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Jul 10, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Apr 10, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Jul 20, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -73,8 +73,8 @@ This list contains 1079 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. May 02, 2022 N/A N/A + :pypi:`pytest-asyncio` Pytest support for asyncio Jul 15, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jul 11, 2022 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) @@ -96,7 +96,7 @@ This list contains 1079 plugins. :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Jul 07, 2022 6 - Mature pytest (>=5.0) - :pypi:`pytest-bdd-ng` BDD for pytest May 25, 2022 4 - Beta pytest (>=5.0) + :pypi:`pytest-bdd-ng` BDD for pytest Jul 15, 2022 4 - Beta pytest (>=5.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 @@ -153,6 +153,8 @@ This list contains 1079 plugins. :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-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) + :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A + :pypi:`pytest-check-libs` check your missing library Jul 17, 2022 N/A N/A :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) @@ -217,7 +219,7 @@ This list contains 1079 plugins. :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest :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-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) + :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A @@ -231,7 +233,7 @@ This list contains 1079 plugins. :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-dbt-core` Pytest extension for dbt. May 27, 2022 N/A pytest (>=6.2.5) ; extra == 'test' + :pypi:`pytest-dbt-core` Pytest extension for dbt. Jul 22, 2022 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A @@ -274,7 +276,7 @@ This list contains 1079 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 Apr 09, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jul 22, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 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) @@ -299,7 +301,7 @@ This list contains 1079 plugins. :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) :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-drf` A Django REST framework plugin for pytest. Nov 12, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-drf` A Django REST framework plugin for pytest. Jul 12, 2022 5 - Production/Stable pytest (>=3.7) :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 May 23, 2020 4 - Beta pytest (>=2.7) :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest @@ -320,14 +322,13 @@ This list contains 1079 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jun 06, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jul 11, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jul 11, 2022 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 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 12, 2022 4 - Beta pytest (==7.0.1) @@ -373,7 +374,7 @@ This list contains 1079 plugins. :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A :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 03, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) @@ -404,6 +405,7 @@ This list contains 1079 plugins. :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta 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-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A @@ -431,9 +433,9 @@ This list contains 1079 plugins. :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Jul 02, 2022 N/A pytest (>=4.0.0) :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality May 19, 2022 4 - Beta pytest + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 22, 2022 4 - Beta pytest :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 Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest :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 @@ -450,7 +452,7 @@ This list contains 1079 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 09, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 21, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -473,7 +475,7 @@ This list contains 1079 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-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 27, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jul 13, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :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 Jun 29, 2022 5 - Production/Stable N/A @@ -488,7 +490,7 @@ This list contains 1079 plugins. :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jul 14, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -525,7 +527,7 @@ This list contains 1079 plugins. :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :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 17, 2022 3 - Alpha pytest (>=3.6,<8) + :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Jul 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A @@ -535,7 +537,7 @@ This list contains 1079 plugins. :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Apr 14, 2022 4 - Beta N/A + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Jul 11, 2022 4 - Beta N/A :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 @@ -547,7 +549,7 @@ This list contains 1079 plugins. :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 5 - Production/Stable pytest + :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 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 Oct 29, 2021 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) @@ -557,8 +559,10 @@ This list contains 1079 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-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 02, 2022 3 - Alpha pytest + :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 18, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) + :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-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A @@ -578,9 +582,10 @@ This list contains 1079 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest May 27, 2022 N/A N/A :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-mesh` pytest_mesh插件 Jul 19, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-metadata` pytest plugin for test session metadata Jul 15, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) @@ -593,7 +598,7 @@ This list contains 1079 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. Jun 28, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jul 20, 2022 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-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -609,9 +614,9 @@ This list contains 1079 plugins. :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jun 15, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 03, 2022 4 - Beta pytest (>=6) - :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 15, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :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 Jun 10, 2021 N/A N/A :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) @@ -632,7 +637,7 @@ This list contains 1079 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 Jul 07, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jul 21, 2022 N/A pytest (==6.2.5) :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 Jul 07, 2021 N/A N/A @@ -741,6 +746,7 @@ This list contains 1079 plugins. :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 Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-pyodide` "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" Jul 21, 2022 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) @@ -840,32 +846,33 @@ This list contains 1079 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). May 10, 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 Jun 17, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Jul 14, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 17, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 17, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 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 04, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Jul 13, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :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 :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-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 :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jun 02, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest @@ -933,10 +940,10 @@ This list contains 1079 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-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) - :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A + :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 May 26, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A - :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). Jul 06, 2020 3 - Alpha N/A + :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). Jul 10, 2022 3 - Alpha pytest (>=2.9) :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -963,7 +970,7 @@ This list contains 1079 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Jun 01, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Jul 16, 2022 4 - Beta N/A :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 Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -975,7 +982,7 @@ This list contains 1079 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 04, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 19, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results May 23, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -983,7 +990,7 @@ This list contains 1079 plugins. :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) - :pypi:`pytest-test-utils` Jun 30, 2022 N/A pytest (>=5) + :pypi:`pytest-test-utils` Jul 14, 2022 N/A pytest (>=5) :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A @@ -1048,7 +1055,7 @@ This list contains 1079 plugins. :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Report Jul 20, 2022 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :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 May 28, 2019 5 - Production/Stable pytest @@ -1059,6 +1066,7 @@ This list contains 1079 plugins. :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-wake` Jul 22, 2022 N/A pytest :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A @@ -1187,9 +1195,9 @@ This list contains 1079 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Mar 13, 2022, + *last release*: Jul 10, 2022, *status*: N/A, - *requires*: pytest (>=6.2.5,<7.0.0) + *requires*: pytest (>=7.0,<8.0) pytest-aiomoto @@ -1222,7 +1230,7 @@ This list contains 1079 plugins. :pypi:`pytest-alembic` - *last release*: Apr 10, 2022, + *last release*: Jul 20, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1488,14 +1496,14 @@ This list contains 1079 plugins. :pypi:`pytest-asyncio` - *last release*: Mar 25, 2022, + *last release*: Jul 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: May 02, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A @@ -1649,7 +1657,7 @@ This list contains 1079 plugins. BDD for pytest :pypi:`pytest-bdd-ng` - *last release*: May 25, 2022, + *last release*: Jul 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=5.0) @@ -2047,6 +2055,20 @@ This list contains 1079 plugins. plugin to check if there are ipdb debugs left + :pypi:`pytest-check-library` + *last release*: Jul 17, 2022, + *status*: N/A, + *requires*: N/A + + check your missing library + + :pypi:`pytest-check-libs` + *last release*: Jul 17, 2022, + *status*: N/A, + *requires*: N/A + + check your missing library + :pypi:`pytest-check-links` *last release*: Jul 29, 2020, *status*: N/A, @@ -2496,7 +2518,7 @@ This list contains 1079 plugins. Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. :pypi:`pytest-data-extractor` - *last release*: Mar 09, 2022, + *last release*: Jul 19, 2022, *status*: N/A, *requires*: pytest (>=7.0.1) @@ -2594,7 +2616,7 @@ This list contains 1079 plugins. A pytest plugin for linting a dbt project's conventions :pypi:`pytest-dbt-core` - *last release*: May 27, 2022, + *last release*: Jul 22, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) ; extra == 'test' @@ -2895,7 +2917,7 @@ This list contains 1079 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Apr 09, 2022, + *last release*: Jul 22, 2022, *status*: N/A, *requires*: pytest (<8.0,>=4.0) @@ -3070,9 +3092,9 @@ This list contains 1079 plugins. A py.test plugin that parses environment files before running tests :pypi:`pytest-drf` - *last release*: Nov 12, 2020, + *last release*: Jul 12, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.6) + *requires*: pytest (>=3.7) A Django REST framework plugin for pytest. @@ -3217,56 +3239,49 @@ This list contains 1079 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip - :pypi:`pytest-embedded-qemu-idf` - *last release*: Jun 29, 2021, - *status*: N/A, - *requires*: N/A - - pytest embedded plugin for esp-idf project by qemu, not target chip - :pypi:`pytest-embedded-serial` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A @@ -3588,7 +3603,7 @@ This list contains 1079 plugins. :pypi:`pytest-fastapi-deps` - *last release*: Jul 03, 2022, + *last release*: Jul 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3804,6 +3819,13 @@ This list contains 1079 plugins. Run tests in transactions using pytest, Flask, and SQLalchemy. + :pypi:`pytest-fluent` + *last release*: Jul 12, 2022, + *status*: 4 - Beta, + *requires*: pytest + + A pytest plugin in order to provide logs via fluentd + :pypi:`pytest-flyte` *last release*: May 03, 2021, *status*: N/A, @@ -3994,7 +4016,7 @@ This list contains 1079 plugins. py.test plugin to ignore the same files as git :pypi:`pytest-glamor-allure` - *last release*: May 19, 2022, + *last release*: Jul 22, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4008,9 +4030,9 @@ This list contains 1079 plugins. Pytest fixtures for testing with gnupg. :pypi:`pytest-golden` - *last release*: Nov 23, 2020, + *last release*: Jul 18, 2022, *status*: N/A, - *requires*: pytest (>=6.1.2,<7.0.0) + *requires*: pytest (>=6.1.2) Plugin for pytest that offloads expected outputs to data files @@ -4127,7 +4149,7 @@ This list contains 1079 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 09, 2022, + *last release*: Jul 21, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4288,7 +4310,7 @@ This list contains 1079 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jun 27, 2022, + *last release*: Jul 13, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4393,7 +4415,7 @@ This list contains 1079 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Jun 08, 2022, + *last release*: Jul 14, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4652,7 +4674,7 @@ This list contains 1079 plugins. Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks :pypi:`pytest-lambda` - *last release*: May 17, 2022, + *last release*: Jul 17, 2022, *status*: 3 - Alpha, *requires*: pytest (>=3.6,<8) @@ -4722,7 +4744,7 @@ This list contains 1079 plugins. A python-libfaketime plugin for pytest. :pypi:`pytest-libiio` - *last release*: Apr 14, 2022, + *last release*: Jul 11, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4806,7 +4828,7 @@ This list contains 1079 plugins. Pytest plugin for AWS integration tests :pypi:`pytest-lockable` - *last release*: Feb 28, 2022, + *last release*: Jul 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4875,8 +4897,15 @@ This list contains 1079 plugins. Pytest Loguru + :pypi:`pytest-loop` + *last release*: Jul 22, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=6) + + pytest plugin for looping tests + :pypi:`pytest-lsp` - *last release*: Jul 02, 2022, + *last release*: Jul 18, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4889,6 +4918,13 @@ This list contains 1079 plugins. pytest marker for marking manual tests + :pypi:`pytest-markdoctest` + *last release*: Jul 22, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6) + + A pytest plugin to doctest your markdown files + :pypi:`pytest-markdown` *last release*: Jan 15, 2021, *status*: 4 - Beta, @@ -5022,6 +5058,13 @@ This list contains 1079 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals + :pypi:`pytest-mesh` + *last release*: Jul 19, 2022, + *status*: N/A, + *requires*: pytest (==7.1.2) + + pytest_mesh插件 + :pypi:`pytest-message` *last release*: May 03, 2022, *status*: N/A, @@ -5037,7 +5080,7 @@ This list contains 1079 plugins. Pytest to Slack reporting plugin :pypi:`pytest-metadata` - *last release*: Mar 26, 2022, + *last release*: Jul 15, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.0.0,<8.0.0) @@ -5128,7 +5171,7 @@ This list contains 1079 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*: Jun 28, 2022, + *last release*: Jul 20, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5240,21 +5283,21 @@ This list contains 1079 plugins. pytest plugin to collect information from tests :pypi:`pytest-mpl` - *last release*: Jun 15, 2022, + *last release*: Jul 23, 2022, *status*: 4 - Beta, *requires*: pytest pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jul 03, 2022, + *last release*: Jul 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) low-startup-overhead, scalable, distributed-testing pytest plugin :pypi:`pytest-multi-check` - *last release*: Jun 03, 2021, + *last release*: Jul 12, 2022, *status*: N/A, *requires*: pytest @@ -5401,7 +5444,7 @@ This list contains 1079 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Jul 07, 2022, + *last release*: Jul 21, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6163,6 +6206,13 @@ This list contains 1079 plugins. pytest plugin to check source code with pylint + :pypi:`pytest-pyodide` + *last release*: Jul 21, 2022, + *status*: N/A, + *requires*: pytest + + "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" + :pypi:`pytest-pypi` *last release*: Mar 04, 2018, *status*: 3 - Alpha, @@ -6857,7 +6907,7 @@ This list contains 1079 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Jun 17, 2022, + *last release*: Jul 14, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6899,7 +6949,7 @@ This list contains 1079 plugins. :pypi:`pytest-sbase` - *last release*: Jul 08, 2022, + *last release*: Jul 17, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6941,7 +6991,7 @@ This list contains 1079 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jul 08, 2022, + *last release*: Jul 17, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6990,7 +7040,7 @@ This list contains 1079 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 04, 2022, + *last release*: Jul 13, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7038,6 +7088,13 @@ This list contains 1079 plugins. + :pypi:`pytest-sharkreport` + *last release*: Jul 11, 2022, + *status*: N/A, + *requires*: pytest (>=3.5) + + this is pytest report plugin. + :pypi:`pytest-shell` *last release*: Mar 27, 2022, *status*: N/A, @@ -7508,7 +7565,7 @@ This list contains 1079 plugins. A plugin to fake subprocess for pytest :pypi:`pytest-subtesthack` - *last release*: Mar 02, 2021, + *last release*: Jul 16, 2022, *status*: N/A, *requires*: N/A @@ -7529,9 +7586,9 @@ This list contains 1079 plugins. pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. :pypi:`pytest-sugar` - *last release*: Jul 06, 2020, + *last release*: Jul 10, 2022, *status*: 3 - Alpha, - *requires*: N/A + *requires*: pytest (>=2.9) pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). @@ -7718,7 +7775,7 @@ This list contains 1079 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Jun 01, 2022, + *last release*: Jul 16, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7802,7 +7859,7 @@ This list contains 1079 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: Jul 04, 2022, + *last release*: Jul 19, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -7858,7 +7915,7 @@ This list contains 1079 plugins. Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply :pypi:`pytest-test-utils` - *last release*: Jun 30, 2022, + *last release*: Jul 14, 2022, *status*: N/A, *requires*: pytest (>=5) @@ -8313,7 +8370,7 @@ This list contains 1079 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Apr 17, 2022, + *last release*: Jul 20, 2022, *status*: 2 - Pre-Alpha, *requires*: N/A @@ -8389,6 +8446,13 @@ This list contains 1079 plugins. Pytest plugin for testing whatsapp bots with end to end tests + :pypi:`pytest-wake` + *last release*: Jul 22, 2022, + *status*: N/A, + *requires*: pytest + + + :pypi:`pytest-watch` *last release*: May 20, 2018, *status*: N/A, From dbc1017b08b4cb4f9a112ae677aab2880adfa5be Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 22:19:32 +0000 Subject: [PATCH 142/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.8.1 → v3.8.2](https://github.com/asottile/reorder_python_imports/compare/v3.8.1...v3.8.2) - [github.com/asottile/pyupgrade: v2.37.1 → v2.37.2](https://github.com/asottile/pyupgrade/compare/v2.37.1...v2.37.2) - [github.com/asottile/setup-cfg-fmt: v1.20.1 → v1.20.2](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.1...v1.20.2) - [github.com/pre-commit/mirrors-mypy: v0.961 → v0.971](https://github.com/pre-commit/mirrors-mypy/compare/v0.961...v0.971) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ac38a1d90b..694498b0850 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,17 +37,17 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.1 + rev: v3.8.2 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.1 + rev: v2.37.2 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.1 + rev: v1.20.2 hooks: - id: setup-cfg-fmt args: [--max-py-version=3.10] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.961 + rev: v0.971 hooks: - id: mypy files: ^(src/|testing/) From c0e3071fdf21eb5bf46478dc7b707720c7c25f1b Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 31 Jul 2022 00:22:46 +0000 Subject: [PATCH 143/255] [automated] Update plugin list --- 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 03b15620d0d..d03ac689a1d 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1087 plugins. +This list contains 1091 plugins. .. only:: not latex @@ -96,7 +96,8 @@ This list contains 1087 plugins. :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Jul 07, 2022 6 - Mature pytest (>=5.0) - :pypi:`pytest-bdd-ng` BDD for pytest Jul 15, 2022 4 - Beta pytest (>=5.0) + :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Jul 25, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) + :pypi:`pytest-bdd-ng` BDD for pytest Jul 24, 2022 4 - Beta pytest (>=5.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 @@ -165,6 +166,7 @@ This list contains 1087 plugins. :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 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) :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) :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) @@ -226,7 +228,7 @@ This list contains 1087 plugins. :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :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. Apr 20, 2020 5 - Production/Stable pytest - :pypi:`pytest-data-suites` Class-based pytest parametrization Jun 18, 2022 N/A pytest (>=6.0,<8.0) + :pypi:`pytest-data-suites` Class-based pytest parametrization Jul 24, 2022 N/A pytest (>=6.0,<8.0) :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A @@ -276,7 +278,7 @@ This list contains 1087 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 Jul 22, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jul 27, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 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) @@ -322,13 +324,13 @@ This list contains 1087 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jul 11, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jul 28, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jul 28, 2022 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 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 12, 2022 4 - Beta pytest (==7.0.1) @@ -425,7 +427,7 @@ This list contains 1087 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 26, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 28, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -444,7 +446,7 @@ This list contains 1087 plugins. :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. May 11, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jul 28, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) @@ -452,7 +454,7 @@ This list contains 1087 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 21, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 30, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -469,7 +471,7 @@ This list contains 1087 plugins. :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' :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 Jan 27, 2022 3 - Alpha N/A + :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jul 29, 2022 3 - Alpha N/A :pypi:`pytest-httpx` Send responses to httpx. May 24, 2022 5 - Production/Stable pytest (<8.*,>=6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A @@ -479,7 +481,7 @@ This list contains 1087 plugins. :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :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 Jun 29, 2022 5 - Production/Stable N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A @@ -582,7 +584,7 @@ This list contains 1087 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest May 27, 2022 N/A N/A :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-mesh` pytest_mesh插件 Jul 19, 2022 N/A pytest (==7.1.2) + :pypi:`pytest-mesh` pytest_mesh插件 Jul 29, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Jul 15, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) @@ -615,7 +617,7 @@ This list contains 1087 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 15, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 29, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -649,7 +651,7 @@ This list contains 1087 plugins. :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :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 Mar 16, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Jul 26, 2022 4 - Beta N/A :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jun 02, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A @@ -746,7 +748,7 @@ This list contains 1087 plugins. :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 Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pyodide` "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" Jul 21, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" Jul 28, 2022 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) @@ -865,7 +867,7 @@ This list contains 1087 plugins. :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 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 13, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Jul 25, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :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 @@ -874,7 +876,7 @@ This list contains 1087 plugins. :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :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 - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jun 02, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jul 28, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 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) @@ -918,6 +920,7 @@ This list contains 1087 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` Jul 29, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 26, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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) @@ -983,7 +986,7 @@ This list contains 1087 plugins. :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 19, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results May 23, 2022 N/A N/A + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Jul 26, 2022 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) @@ -1031,7 +1034,7 @@ This list contains 1087 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :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) for Pytest, automatically launched after your test run is finished May 02, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Jul 30, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1086,6 +1089,7 @@ This list contains 1087 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-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) Jul 28, 2022 N/A N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. May 24, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A @@ -1656,8 +1660,15 @@ This list contains 1087 plugins. BDD for pytest + :pypi:`pytest-bdd-html` + *last release*: Jul 25, 2022, + *status*: 3 - Alpha, + *requires*: pytest (!=6.0.0,>=5.0) + + pytest plugin to display BDD info in HTML test report + :pypi:`pytest-bdd-ng` - *last release*: Jul 15, 2022, + *last release*: Jul 24, 2022, *status*: 4 - Beta, *requires*: pytest (>=5.0) @@ -2139,6 +2150,13 @@ This list contains 1087 plugins. Pytest plugin for Click + :pypi:`pytest-cli-fixtures` + *last release*: Jul 28, 2022, + *status*: N/A, + *requires*: pytest (~=7.0) + + Automatically register fixtures for custom CLI arguments + :pypi:`pytest-clld` *last release*: Jul 06, 2022, *status*: N/A, @@ -2567,7 +2585,7 @@ This list contains 1087 plugins. A py.test plugin recording and comparing test output. :pypi:`pytest-data-suites` - *last release*: Jun 18, 2022, + *last release*: Jul 24, 2022, *status*: N/A, *requires*: pytest (>=6.0,<8.0) @@ -2917,7 +2935,7 @@ This list contains 1087 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Jul 22, 2022, + *last release*: Jul 27, 2022, *status*: N/A, *requires*: pytest (<8.0,>=4.0) @@ -3239,49 +3257,49 @@ This list contains 1087 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A @@ -3960,7 +3978,7 @@ This list contains 1087 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: May 26, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A @@ -4093,7 +4111,7 @@ This list contains 1087 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: May 11, 2022, + *last release*: Jul 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.2,<7.0.0) @@ -4149,7 +4167,7 @@ This list contains 1087 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 21, 2022, + *last release*: Jul 30, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4268,7 +4286,7 @@ This list contains 1087 plugins. A thin wrapper of HTTPretty for pytest :pypi:`pytest-httpserver` - *last release*: Jan 27, 2022, + *last release*: Jul 29, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -4338,7 +4356,7 @@ This list contains 1087 plugins. A pytest plugin to help with testing idem projects :pypi:`pytest-idempotent` - *last release*: Jan 30, 2022, + *last release*: Jul 25, 2022, *status*: N/A, *requires*: N/A @@ -5059,7 +5077,7 @@ This list contains 1087 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mesh` - *last release*: Jul 19, 2022, + *last release*: Jul 29, 2022, *status*: N/A, *requires*: pytest (==7.1.2) @@ -5290,7 +5308,7 @@ This list contains 1087 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jul 15, 2022, + *last release*: Jul 29, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5528,9 +5546,9 @@ This list contains 1087 plugins. A PyTest Reporter to send test runs to Notion.so :pypi:`pytest-nunit` - *last release*: Mar 16, 2022, + *last release*: Jul 26, 2022, *status*: 4 - Beta, - *requires*: pytest (>=4.6.0) + *requires*: N/A A pytest plugin for generating NUnit3 test result XML output @@ -6207,7 +6225,7 @@ This list contains 1087 plugins. pytest plugin to check source code with pylint :pypi:`pytest-pyodide` - *last release*: Jul 21, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: pytest @@ -7040,7 +7058,7 @@ This list contains 1087 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 13, 2022, + *last release*: Jul 25, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7103,7 +7121,7 @@ This list contains 1087 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Jun 02, 2022, + *last release*: Jul 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7410,6 +7428,13 @@ This list contains 1087 plugins. + :pypi:`pytest-splunk` + *last release*: Jul 29, 2022, + *status*: N/A, + *requires*: pytest (>5.4.0,<6.3) + + + :pypi:`pytest-splunk-addon` *last release*: May 26, 2022, *status*: N/A, @@ -7866,9 +7891,9 @@ This list contains 1087 plugins. Pytest plugin for sending report to testrail system. :pypi:`pytest-testrail-ns` - *last release*: May 23, 2022, + *last release*: Jul 26, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest (>=3.6) pytest plugin for creating TestRail runs and adding results @@ -8202,7 +8227,7 @@ This list contains 1087 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: May 02, 2022, + *last release*: Jul 30, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) @@ -8586,6 +8611,13 @@ This list contains 1087 plugins. Extended logging for test and decorators + :pypi:`pytest-xlsx` + *last release*: Jul 28, 2022, + *status*: N/A, + *requires*: N/A + + pytest plugin for generating test cases by xlsx(excel) + :pypi:`pytest-xpara` *last release*: Oct 30, 2017, *status*: 3 - Alpha, From 1c31a7e6598ff0290012f56c4ee6ce48a31486d9 Mon Sep 17 00:00:00 2001 From: Robert O'Shea Date: Sun, 31 Jul 2022 14:44:02 +0100 Subject: [PATCH 144/255] Added file-like methods to DontReadFromInput (#10173) Co-authored-by: Bruno Oliveira Fixes #10150 --- changelog/10150.bugfix.rst | 1 + src/_pytest/capture.py | 27 +++++++++++++++++++++++++++ testing/test_capture.py | 9 +++++++++ 3 files changed, 37 insertions(+) create mode 100644 changelog/10150.bugfix.rst diff --git a/changelog/10150.bugfix.rst b/changelog/10150.bugfix.rst new file mode 100644 index 00000000000..24c7ccd355a --- /dev/null +++ b/changelog/10150.bugfix.rst @@ -0,0 +1 @@ +:data:`sys.stdin` now contains all expected methods of a file-like object when capture is enabled. diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index d6cf42c3b51..bcfd3449f29 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -203,12 +203,39 @@ def __iter__(self): def fileno(self) -> int: raise UnsupportedOperation("redirected stdin is pseudofile, has no fileno()") + def flush(self) -> None: + raise UnsupportedOperation("redirected stdin is pseudofile, has no flush()") + def isatty(self) -> bool: return False def close(self) -> None: pass + def readable(self) -> bool: + return False + + def seek(self, offset: int) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no seek(int)") + + def seekable(self) -> bool: + return False + + def tell(self) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no tell()") + + def truncate(self, size: int) -> None: + raise UnsupportedOperation("cannont truncate stdin") + + def write(self, *args) -> None: + raise UnsupportedOperation("cannot write to stdin") + + def writelines(self, *args) -> None: + raise UnsupportedOperation("Cannot write to stdin") + + def writable(self) -> bool: + return False + @property def buffer(self): return self diff --git a/testing/test_capture.py b/testing/test_capture.py index f0c582b6651..00cab19330b 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -897,6 +897,15 @@ def test_dontreadfrominput() -> None: iter_f = iter(f) pytest.raises(OSError, next, iter_f) pytest.raises(UnsupportedOperation, f.fileno) + pytest.raises(UnsupportedOperation, f.flush) + assert not f.readable() + pytest.raises(UnsupportedOperation, f.seek, 0) + assert not f.seekable() + pytest.raises(UnsupportedOperation, f.tell) + pytest.raises(UnsupportedOperation, f.truncate, 0) + pytest.raises(UnsupportedOperation, f.write, b"") + pytest.raises(UnsupportedOperation, f.writelines, []) + assert not f.writable() f.close() # just for completeness From 58cf20edf08d84c5baf08f0566cc9bccbc4ec7fd Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 8 Aug 2022 10:14:49 +0100 Subject: [PATCH 145/255] Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. [SQUASH] (#10012) Co-authored-by: Bruno Oliveira --- changelog/10012.deprecation.rst | 1 + src/_pytest/warning_types.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 changelog/10012.deprecation.rst diff --git a/changelog/10012.deprecation.rst b/changelog/10012.deprecation.rst new file mode 100644 index 00000000000..66681263e32 --- /dev/null +++ b/changelog/10012.deprecation.rst @@ -0,0 +1 @@ +Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index ebfeb87d842..c32ce80ccb1 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -55,7 +55,6 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning): __module__ = "pytest" -@final class PytestReturnNotNoneWarning(PytestDeprecationWarning): """Warning emitted when a test function is returning value other than None.""" @@ -82,7 +81,7 @@ def simple(cls, apiname: str) -> "PytestExperimentalApiWarning": @final -class PytestUnhandledCoroutineWarning(PytestWarning): +class PytestUnhandledCoroutineWarning(PytestReturnNotNoneWarning): """Warning emitted for an unhandled coroutine. A coroutine was encountered when collecting test functions, but was not From abd5df4b3cf6c133e136be781aaf1091a22038e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 11:06:48 +0200 Subject: [PATCH 146/255] [automated] Update plugin list (#10194) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 162 ++++++++++++++++++------------- 1 file changed, 93 insertions(+), 69 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index d03ac689a1d..235628055ef 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1091 plugins. +This list contains 1094 plugins. .. only:: not latex @@ -35,7 +35,7 @@ This list contains 1091 plugins. :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Jul 20, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Aug 03, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -44,7 +44,7 @@ This list contains 1091 plugins. :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-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :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 Jun 20, 2022 4 - Beta pytest (>=3.5.0) + :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-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A @@ -69,6 +69,7 @@ This list contains 1091 plugins. :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-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) + :pypi:`pytest-assurka` A pytest plugin for Assurka Studio Aug 04, 2022 N/A N/A :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) @@ -84,7 +85,7 @@ This list contains 1091 plugins. :pypi:`pytest-autocap` automatically capture test & fixture stdout/stderr to files May 15, 2022 N/A pytest (<7.2,>=7.1.2) :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 20, 2022 N/A pytest (>=7.0.0) - :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Aug 04, 2022 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-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) @@ -179,6 +180,7 @@ This list contains 1091 plugins. :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A :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 + :pypi:`pytest-collector` Python package for collecting pytest. Aug 02, 2022 N/A pytest (>=7.0,<8.0) :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 May 15, 2022 N/A pytest (>=3.6,<8) @@ -324,13 +326,13 @@ This list contains 1091 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jul 28, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Aug 04, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Aug 04, 2022 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 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 12, 2022 4 - Beta pytest (==7.0.1) @@ -446,7 +448,7 @@ This list contains 1091 plugins. :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jul 28, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Aug 03, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) @@ -454,7 +456,7 @@ This list contains 1091 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 30, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 05, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -477,7 +479,7 @@ This list contains 1091 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-ibutsu` A plugin to sent pytest results to an Ibutsu server Jul 13, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :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 Jun 29, 2022 5 - Production/Stable N/A @@ -514,10 +516,11 @@ This list contains 1091 plugins. :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 23, 2022 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 05, 2022 4 - Beta pytest :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) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A + :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 03, 2022 4 - Beta pytest (>=7.1.0) :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-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest @@ -563,7 +566,7 @@ This list contains 1091 plugins. :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 18, 2022 3 - Alpha pytest - :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) + :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha N/A :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-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A @@ -579,13 +582,13 @@ This list contains 1091 plugins. :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-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 make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :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 May 27, 2022 N/A N/A :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-mesh` pytest_mesh插件 Jul 29, 2022 N/A pytest (==7.1.2) - :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) + :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 Feb 07, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Jul 15, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest @@ -617,7 +620,7 @@ This list contains 1091 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 29, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 01, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -652,7 +655,7 @@ This list contains 1091 plugins. :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :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 Jul 26, 2022 4 - Beta N/A - :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jun 02, 2022 5 - Production/Stable pytest + :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-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A @@ -748,7 +751,7 @@ This list contains 1091 plugins. :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 Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pyodide` "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" Jul 28, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Aug 04, 2022 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) @@ -827,7 +830,7 @@ This list contains 1091 plugins. :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Jun 01, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 05, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) @@ -837,7 +840,7 @@ This list contains 1091 plugins. :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) - :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest + :pypi:`pytest-rst` Test code from RST documents with pytest Aug 02, 2022 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-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest @@ -854,13 +857,13 @@ This list contains 1091 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 17, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 05, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 17, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 05, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -920,7 +923,6 @@ This list contains 1091 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` Jul 29, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 26, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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) @@ -985,7 +987,7 @@ This list contains 1091 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 19, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Aug 01, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Jul 26, 2022 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -1034,7 +1036,8 @@ This list contains 1091 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :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) for Pytest, automatically launched after your test run is finished Jul 30, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Aug 03, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1089,7 +1092,7 @@ This list contains 1091 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-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) Jul 28, 2022 N/A N/A + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Aug 04, 2022 N/A N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. May 24, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A @@ -1234,7 +1237,7 @@ This list contains 1091 plugins. :pypi:`pytest-alembic` - *last release*: Jul 20, 2022, + *last release*: Aug 03, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1297,7 +1300,7 @@ This list contains 1091 plugins. This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. :pypi:`pytest-anki` - *last release*: Jun 20, 2022, + *last release*: Jul 31, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -1471,6 +1474,13 @@ This list contains 1091 plugins. A pytest plugin that allows multiple failures per test + :pypi:`pytest-assurka` + *last release*: Aug 04, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin for Assurka Studio + :pypi:`pytest-ast-back-to-python` *last release*: Sep 29, 2019, *status*: 4 - Beta, @@ -1577,7 +1587,7 @@ This list contains 1091 plugins. pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. :pypi:`pytest-automock` - *last release*: Feb 01, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -2241,6 +2251,13 @@ This list contains 1091 plugins. Formatter for pytest collect output + :pypi:`pytest-collector` + *last release*: Aug 02, 2022, + *status*: N/A, + *requires*: pytest (>=7.0,<8.0) + + Python package for collecting pytest. + :pypi:`pytest-colordots` *last release*: Oct 06, 2017, *status*: 5 - Production/Stable, @@ -3257,49 +3274,49 @@ This list contains 1091 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A @@ -4111,9 +4128,9 @@ This list contains 1091 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: Jul 28, 2022, + *last release*: Aug 03, 2022, *status*: 4 - Beta, - *requires*: pytest (>=6.1.2,<7.0.0) + *requires*: pytest (>=7.1.2,<8.0.0) A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. @@ -4167,7 +4184,7 @@ This list contains 1091 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 30, 2022, + *last release*: Aug 05, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4328,7 +4345,7 @@ This list contains 1091 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jul 13, 2022, + *last release*: Aug 05, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4587,7 +4604,7 @@ This list contains 1091 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: May 23, 2022, + *last release*: Aug 05, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4614,6 +4631,13 @@ This list contains 1091 plugins. Generate JSON test reports + :pypi:`pytest-json-fixtures` + *last release*: Aug 03, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.0) + + JSON output for the --fixtures flag + :pypi:`pytest-jsonlint` *last release*: Aug 04, 2016, *status*: N/A, @@ -4930,9 +4954,9 @@ This list contains 1091 plugins. Pytest plugin for end-to-end testing of language servers :pypi:`pytest-manual-marker` - *last release*: Oct 11, 2021, + *last release*: Aug 04, 2022, *status*: 3 - Alpha, - *requires*: pytest (>=6) + *requires*: N/A pytest marker for marking manual tests @@ -5042,7 +5066,7 @@ This list contains 1091 plugins. Plugin for generating Markdown reports for pytest results :pypi:`pytest-md-report` - *last release*: Feb 06, 2022, + *last release*: Aug 06, 2022, *status*: 4 - Beta, *requires*: pytest (!=6.0.0,<8,>=3.3.2) @@ -5077,14 +5101,14 @@ This list contains 1091 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mesh` - *last release*: Jul 29, 2022, + *last release*: Aug 05, 2022, *status*: N/A, *requires*: pytest (==7.1.2) pytest_mesh插件 :pypi:`pytest-message` - *last release*: May 03, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -5308,7 +5332,7 @@ This list contains 1091 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jul 29, 2022, + *last release*: Aug 01, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5553,7 +5577,7 @@ This list contains 1091 plugins. A pytest plugin for generating NUnit3 test result XML output :pypi:`pytest-object-getter` - *last release*: Jun 02, 2022, + *last release*: Jul 31, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6225,11 +6249,11 @@ This list contains 1091 plugins. pytest plugin to check source code with pylint :pypi:`pytest-pyodide` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: pytest - "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" + "Pytest plugin for testing applications that use Pyodide" :pypi:`pytest-pypi` *last release*: Mar 04, 2018, @@ -6778,7 +6802,7 @@ This list contains 1091 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-retry` - *last release*: Jun 01, 2022, + *last release*: Aug 05, 2022, *status*: N/A, *requires*: pytest (>=7.0.0) @@ -6848,9 +6872,9 @@ This list contains 1091 plugins. Extend py.test for RPC OpenStack testing. :pypi:`pytest-rst` - *last release*: Sep 21, 2021, + *last release*: Aug 02, 2022, *status*: N/A, - *requires*: pytest + *requires*: N/A Test code from RST documents with pytest @@ -6967,7 +6991,7 @@ This list contains 1091 plugins. :pypi:`pytest-sbase` - *last release*: Jul 17, 2022, + *last release*: Aug 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7009,7 +7033,7 @@ This list contains 1091 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jul 17, 2022, + *last release*: Aug 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7428,13 +7452,6 @@ This list contains 1091 plugins. - :pypi:`pytest-splunk` - *last release*: Jul 29, 2022, - *status*: N/A, - *requires*: pytest (>5.4.0,<6.3) - - - :pypi:`pytest-splunk-addon` *last release*: May 26, 2022, *status*: N/A, @@ -7884,7 +7901,7 @@ This list contains 1091 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: Jul 19, 2022, + *last release*: Aug 01, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -8227,12 +8244,19 @@ This list contains 1091 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Jul 30, 2022, + *last release*: Aug 03, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) Text User Interface (TUI) for Pytest, automatically launched after your test run is finished + :pypi:`pytest-twilio-conversations-client-mock` + *last release*: Aug 02, 2022, + *status*: N/A, + *requires*: N/A + + + :pypi:`pytest-twisted` *last release*: Aug 30, 2021, *status*: 5 - Production/Stable, @@ -8612,7 +8636,7 @@ This list contains 1091 plugins. Extended logging for test and decorators :pypi:`pytest-xlsx` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A From 4d430ea6ffe8cf18582e756b4093405cc83d0cc4 Mon Sep 17 00:00:00 2001 From: Brandon Chinn Date: Fri, 12 Aug 2022 02:08:39 -0700 Subject: [PATCH 147/255] Fix partially unknown type (#10204) --- src/_pytest/config/argparsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 830bbd2e2cd..feae1ce7eda 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -169,7 +169,7 @@ def addini( type: Optional[ "Literal['string', 'paths', 'pathlist', 'args', 'linelist', 'bool']" ] = None, - default=None, + default: Any = None, ) -> None: """Register an ini-file option. From 433efaeaa93291fa56ef8d306922a25aad12a512 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 11:09:06 +0200 Subject: [PATCH 148/255] build(deps): Bump django in /testing/plugins_integration (#10195) Bumps [django](https://github.com/django/django) from 4.0.6 to 4.1. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.6...4.1) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] 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 bde7afa4df4..b221b8f6777 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.0.6 +django==4.1 pytest-asyncio==0.18.3 pytest-bdd==6.0.1 pytest-cov==3.0.0 From cc0092b9d898fdd903f56b9b937139fbf766d1c1 Mon Sep 17 00:00:00 2001 From: holesch <8659229+holesch@users.noreply.github.com> Date: Fri, 12 Aug 2022 11:11:03 +0200 Subject: [PATCH 149/255] JUnit XML: Escape error messages in setup/teardown (#10190) Co-authored-by: Holesch, Simon (BSH) --- AUTHORS | 1 + changelog/10190.bugfix.rst | 1 + src/_pytest/junitxml.py | 2 +- testing/test_junitxml.py | 22 ++++++++++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 changelog/10190.bugfix.rst diff --git a/AUTHORS b/AUTHORS index b8e6377fb02..e797f21461a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -313,6 +313,7 @@ Seth Junot Shantanu Jain Shubham Adep Simon Gomizelj +Simon Holesch Simon Kerr Skylar Downes Srinivas Reddy Thatiparthy diff --git a/changelog/10190.bugfix.rst b/changelog/10190.bugfix.rst new file mode 100644 index 00000000000..731d0efad9a --- /dev/null +++ b/changelog/10190.bugfix.rst @@ -0,0 +1 @@ +Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports. diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index c92a227bf1e..66057ef6f61 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -231,7 +231,7 @@ def append_error(self, report: TestReport) -> None: msg = f'failed on teardown with "{reason}"' else: msg = f'failed on setup with "{reason}"' - self._add_simple("error", msg, str(report.longrepr)) + self._add_simple("error", bin_xml_escape(msg), str(report.longrepr)) def append_skipped(self, report: TestReport) -> None: if hasattr(report, "wasxfail"): diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 02531e81435..b266c76d922 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -1625,6 +1625,28 @@ def test_skip(): snode.assert_attr(message="1 <> 2") +def test_escaped_setup_teardown_error( + pytester: Pytester, run_and_parse: RunAndParse +) -> None: + pytester.makepyfile( + """ + import pytest + + @pytest.fixture() + def my_setup(): + raise Exception("error: \033[31mred\033[m") + + def test_esc(my_setup): + pass + """ + ) + _, dom = run_and_parse() + node = dom.find_first_by_tag("testcase") + snode = node.find_first_by_tag("error") + assert "#x1B[31mred#x1B[m" in snode["message"] + assert "#x1B[31mred#x1B[m" in snode.text + + @parametrize_families def test_logging_passing_tests_disabled_does_not_log_test_output( pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str From c72d2023175887fcf3fcd4d1bdaf30e0ffb1f4ff Mon Sep 17 00:00:00 2001 From: Nhieuvu1802 <87355872+Nhieuvu1802@users.noreply.github.com> Date: Sat, 13 Aug 2022 06:56:51 +0700 Subject: [PATCH 150/255] build(deps): Bump pytest-asyncio in /testing/plugins_integration (#10212) 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 b221b8f6777..0853db6299b 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.6.1 django==4.1 -pytest-asyncio==0.18.3 +pytest-asyncio==0.19.0 pytest-bdd==6.0.1 pytest-cov==3.0.0 pytest-django==4.5.2 From cb7f5ed3b1cd0c8e90118adbcafb1b7c4bc8fd63 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 13 Aug 2022 12:35:07 +0300 Subject: [PATCH 151/255] doc: require sphinx 5 Fix #9836. --- doc/en/conf.py | 12 +++++------- doc/en/reference/customize.rst | 2 +- doc/en/reference/reference.rst | 1 + doc/en/requirements.txt | 5 +---- src/_pytest/python_api.py | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 3c26b8ce0b7..fe1d54416c0 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -162,11 +162,11 @@ _repo = "https://github.com/pytest-dev/pytest" extlinks = { - "bpo": ("https://bugs.python.org/issue%s", "bpo-"), - "pypi": ("https://pypi.org/project/%s/", ""), - "issue": (f"{_repo}/issues/%s", "issue #"), - "pull": (f"{_repo}/pull/%s", "pull request #"), - "user": ("https://github.com/%s", "@"), + "bpo": ("https://bugs.python.org/issue%s", "bpo-%s"), + "pypi": ("https://pypi.org/project/%s/", "%s"), + "issue": (f"{_repo}/issues/%s", "issue #%s"), + "pull": (f"{_repo}/pull/%s", "pull request #%s"), + "user": ("https://github.com/%s", "@%s"), } @@ -419,8 +419,6 @@ def filter(self, record: logging.LogRecord) -> bool: def setup(app: "sphinx.application.Sphinx") -> None: - # from sphinx.ext.autodoc import cut_lines - # app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_crossref_type( "fixture", "fixture", diff --git a/doc/en/reference/customize.rst b/doc/en/reference/customize.rst index b6d21445a7e..b794d646b8e 100644 --- a/doc/en/reference/customize.rst +++ b/doc/en/reference/customize.rst @@ -90,7 +90,7 @@ and can also be used to hold pytest configuration if they have a ``[pytest]`` se setup.cfg ~~~~~~~~~ -``setup.cfg`` files are general purpose configuration files, used originally by :doc:`distutils `, and can also be used to hold pytest configuration +``setup.cfg`` files are general purpose configuration files, used originally by :doc:`distutils `, and can also be used to hold pytest configuration if they have a ``[tool:pytest]`` section. .. code-block:: ini diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index bdad8fa597d..de11cba554b 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -529,6 +529,7 @@ New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`. .. autoclass:: pytest.Testdir() :members: + :noindex: TimeoutExpired .. fixture:: recwarn diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index 89446634e03..a0d54cd4c1d 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -2,9 +2,6 @@ pallets-sphinx-themes pluggy>=1.0 pygments-pytest>=2.2.0 sphinx-removed-in>=0.2.0 -sphinx>=3.1,<4 +sphinx>=5,<6 sphinxcontrib-trio sphinxcontrib-svg2pdfconverter - -# XXX: sphinx<4 is broken with latest jinja2 -jinja2<3.1 diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 10762ee7b98..d825931debc 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -521,7 +521,7 @@ 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 within some tolerance. - Due to the :std:doc:`tutorial/floatingpoint`, numbers that we + Due to the :doc:`python:tutorial/floatingpoint`, numbers that we would intuitively expect to be equal are not always so:: >>> 0.1 + 0.2 == 0.3 From 7431750bb6e48106ded6acd70ef2e4c67aad294a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 29 Oct 2021 21:18:12 +0300 Subject: [PATCH 152/255] doc: have tighter control on what autodoc shows New versions of sphinx starting showing `__init__` parameters even when we don't want them to show because they are private (have `_ispytest` argument). The only working solution I found was to switch to `autodoc_typehints_description_target = "documented"` and explicitly document parameters for which we want to show the types. It's a little tedious and repetitive in some simple cases, but overall it results in nicer API docs. --- doc/en/conf.py | 1 + doc/en/reference/reference.rst | 2 +- src/_pytest/assertion/__init__.py | 2 +- src/_pytest/config/argparsing.py | 54 +++++--- src/_pytest/fixtures.py | 19 ++- src/_pytest/hookspec.py | 208 +++++++++++++++++++++--------- src/_pytest/junitxml.py | 5 +- src/_pytest/logging.py | 25 ++-- src/_pytest/mark/__init__.py | 4 +- src/_pytest/monkeypatch.py | 5 +- src/_pytest/nodes.py | 25 ++-- src/_pytest/outcomes.py | 9 +- src/_pytest/pytester.py | 113 ++++++++++------ src/_pytest/python_api.py | 15 ++- src/_pytest/reports.py | 10 +- src/_pytest/tmpdir.py | 6 +- 16 files changed, 335 insertions(+), 168 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index fe1d54416c0..b0c158e5a21 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -38,6 +38,7 @@ autodoc_member_order = "bysource" autodoc_typehints = "description" +autodoc_typehints_description_target = "documented" todo_include_todos = 1 latex_engine = "lualatex" diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index de11cba554b..97afdef377c 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -102,7 +102,7 @@ pytest.deprecated_call **Tutorial**: :ref:`ensuring_function_triggers` -.. autofunction:: pytest.deprecated_call() +.. autofunction:: pytest.deprecated_call([match]) :with: pytest.register_assert_rewrite diff --git a/src/_pytest/assertion/__init__.py b/src/_pytest/assertion/__init__.py index 5c971bb8622..a46e58136ba 100644 --- a/src/_pytest/assertion/__init__.py +++ b/src/_pytest/assertion/__init__.py @@ -53,7 +53,7 @@ def register_assert_rewrite(*names: str) -> None: actually imported, usually in your __init__.py if you are a plugin using a package. - :raises TypeError: If the given module names are not strings. + :param names: The module names to register. """ for name in names: if not isinstance(name, str): diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index feae1ce7eda..d3f01916b61 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -66,14 +66,15 @@ def getgroup( ) -> "OptionGroup": """Get (or create) a named option Group. - :name: Name of the option group. - :description: Long description for --help output. - :after: Name of another group, used for ordering --help output. + :param name: Name of the option group. + :param description: Long description for --help output. + :param after: Name of another group, used for ordering --help output. + :returns: The option group. The returned group object has an ``addoption`` method with the same signature as :func:`parser.addoption ` but will be shown in the respective group in the output of - ``pytest. --help``. + ``pytest --help``. """ for group in self._groups: if group.name == name: @@ -89,10 +90,11 @@ def getgroup( def addoption(self, *opts: str, **attrs: Any) -> None: """Register a command line option. - :opts: Option names, can be short or long options. - :attrs: Same attributes which the ``add_argument()`` function of the - `argparse library `_ - accepts. + :param opts: + Option names, can be short or long options. + :param attrs: + Same attributes as the argparse library's :py:func:`add_argument() + ` function accepts. After command line parsing, options are available on the pytest config object via ``config.option.NAME`` where ``NAME`` is usually set @@ -148,7 +150,10 @@ def parse_known_args( args: Sequence[Union[str, "os.PathLike[str]"]], namespace: Optional[argparse.Namespace] = None, ) -> argparse.Namespace: - """Parse and return a namespace object with known arguments at this point.""" + """Parse the known arguments at this point. + + :returns: An argparse namespace object. + """ return self.parse_known_and_unknown_args(args, namespace=namespace)[0] def parse_known_and_unknown_args( @@ -156,8 +161,13 @@ def parse_known_and_unknown_args( args: Sequence[Union[str, "os.PathLike[str]"]], namespace: Optional[argparse.Namespace] = None, ) -> Tuple[argparse.Namespace, List[str]]: - """Parse and return a namespace object with known arguments, and - the remaining arguments unknown at this point.""" + """Parse the known arguments at this point, and also return the + remaining unknown arguments. + + :returns: + A tuple containing an argparse namespace object for the known + arguments, and a list of the unknown arguments. + """ optparser = self._getparser() strargs = [os.fspath(x) for x in args] return optparser.parse_known_args(strargs, namespace=namespace) @@ -173,9 +183,9 @@ def addini( ) -> None: """Register an ini-file option. - :name: + :param name: Name of the ini-variable. - :type: + :param type: Type of the variable. Can be: * ``string``: a string @@ -189,7 +199,7 @@ def addini( The ``paths`` variable type. Defaults to ``string`` if ``None`` or not passed. - :default: + :param default: Default value if no ini-file option exists but is queried. The value of ini-variables can be retrieved via a call to @@ -354,24 +364,30 @@ def __init__( self.options: List[Argument] = [] self.parser = parser - def addoption(self, *optnames: str, **attrs: Any) -> None: + def addoption(self, *opts: str, **attrs: Any) -> None: """Add an option to this group. If a shortened version of a long option is specified, it will be suppressed in the help. ``addoption('--twowords', '--two-words')`` results in help showing ``--two-words`` only, but ``--twowords`` gets accepted **and** the automatic destination is in ``args.twowords``. + + :param opts: + Option names, can be short or long options. + :param attrs: + Same attributes as the argparse library's :py:func:`add_argument() + ` function accepts. """ - conflict = set(optnames).intersection( + conflict = set(opts).intersection( name for opt in self.options for name in opt.names() ) if conflict: raise ValueError("option names %s already added" % conflict) - option = Argument(*optnames, **attrs) + option = Argument(*opts, **attrs) self._addoption_instance(option, shortupper=False) - def _addoption(self, *optnames: str, **attrs: Any) -> None: - option = Argument(*optnames, **attrs) + def _addoption(self, *opts: str, **attrs: Any) -> None: + option = Argument(*opts, **attrs) self._addoption_instance(option, shortupper=True) def _addoption_instance(self, option: "Argument", shortupper: bool = False) -> None: diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index d1d36d7fa24..30b6054d05e 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -513,8 +513,8 @@ def session(self) -> "Session": return self._pyfuncitem.session # type: ignore[no-any-return] def addfinalizer(self, finalizer: Callable[[], object]) -> None: - """Add finalizer/teardown function to be called after the last test - within the requesting test context finished execution.""" + """Add finalizer/teardown function to be called without arguments after + the last test within the requesting test context finished execution.""" # XXX usually this method is shadowed by fixturedef specific ones. self._addfinalizer(finalizer, scope=self.scope) @@ -529,13 +529,16 @@ def applymarker(self, marker: Union[str, MarkDecorator]) -> None: on all function invocations. :param marker: - A :class:`pytest.MarkDecorator` object created by a call - to ``pytest.mark.NAME(...)``. + An object created by a call to ``pytest.mark.NAME(...)``. """ self.node.add_marker(marker) def raiseerror(self, msg: Optional[str]) -> NoReturn: - """Raise a FixtureLookupError with the given message.""" + """Raise a FixtureLookupError exception. + + :param msg: + An optional custom error message. + """ raise self._fixturemanager.FixtureLookupError(None, self, msg) def _fillfixtures(self) -> None: @@ -557,6 +560,8 @@ def getfixturevalue(self, argname: str) -> Any: phase, but during the test teardown phase a fixture's value may not be available. + :param argname: + The fixture name. :raises pytest.FixtureLookupError: If the given fixture could not be found. """ @@ -768,8 +773,8 @@ def __repr__(self) -> str: return f"" def addfinalizer(self, finalizer: Callable[[], object]) -> None: - """Add finalizer/teardown function to be called after the last test - within the requesting test context finished execution.""" + """Add finalizer/teardown function to be called without arguments after + the last test within the requesting test context finished execution.""" self._fixturedef.addfinalizer(finalizer) def _schedule_finalizers( diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index a03c0e9ab79..cc0828dd19e 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -143,7 +143,7 @@ def pytest_configure(config: "Config") -> None: def pytest_cmdline_parse( pluginmanager: "PytestPluginManager", args: List[str] ) -> Optional["Config"]: - """Return an initialized config object, parsing the specified args. + """Return an initialized :class:`~pytest.Config`, parsing the specified args. Stops at first non-None result, see :ref:`firstresult`. @@ -152,8 +152,9 @@ def pytest_cmdline_parse( ``plugins`` arg when using `pytest.main`_ to perform an in-process test run. - :param pytest.PytestPluginManager pluginmanager: The pytest plugin manager. - :param List[str] args: List of arguments passed on the command line. + :param pluginmanager: The pytest plugin manager. + :param args: List of arguments passed on the command line. + :returns: A pytest config object. """ @@ -167,8 +168,8 @@ def pytest_cmdline_preparse(config: "Config", args: List[str]) -> None: .. note:: This hook will not be called for ``conftest.py`` files, only for setuptools plugins. - :param pytest.Config config: The pytest config object. - :param List[str] args: Arguments passed on the command line. + :param config: The pytest config object. + :param args: Arguments passed on the command line. """ @@ -179,7 +180,8 @@ def pytest_cmdline_main(config: "Config") -> Optional[Union["ExitCode", int]]: Stops at first non-None result, see :ref:`firstresult`. - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. + :returns: The exit code. """ @@ -192,9 +194,9 @@ def pytest_load_initial_conftests( .. note:: This hook will not be called for ``conftest.py`` files, only for setuptools plugins. - :param pytest.Config early_config: The pytest config object. - :param List[str] args: Arguments passed on the command line. - :param pytest.Parser parser: To add command line options. + :param early_config: The pytest config object. + :param args: Arguments passed on the command line. + :param parser: To add command line options. """ @@ -236,7 +238,7 @@ def pytest_collection(session: "Session") -> Optional[object]: for example the terminal plugin uses it to start displaying the collection counter (and returns `None`). - :param pytest.Session session: The pytest session object. + :param session: The pytest session object. """ @@ -246,16 +248,16 @@ def pytest_collection_modifyitems( """Called after collection has been performed. May filter or re-order the items in-place. - :param pytest.Session session: The pytest session object. - :param pytest.Config config: The pytest config object. - :param List[pytest.Item] items: List of item objects. + :param session: The pytest session object. + :param config: The pytest config object. + :param items: List of item objects. """ def pytest_collection_finish(session: "Session") -> None: """Called after collection has been performed and modified. - :param pytest.Session session: The pytest session object. + :param session: The pytest session object. """ @@ -270,9 +272,9 @@ def pytest_ignore_collect( Stops at first non-None result, see :ref:`firstresult`. - :param pathlib.Path collection_path : The path to analyze. - :param LEGACY_PATH path: The path to analyze (deprecated). - :param pytest.Config config: The pytest config object. + :param collection_path: The path to analyze. + :param path: The path to analyze (deprecated). + :param config: The pytest config object. .. versionchanged:: 7.0.0 The ``collection_path`` parameter was added as a :class:`pathlib.Path` @@ -284,12 +286,12 @@ def pytest_ignore_collect( def pytest_collect_file( file_path: Path, path: "LEGACY_PATH", parent: "Collector" ) -> "Optional[Collector]": - """Create a Collector for the given path, or None if not relevant. + """Create a :class:`~pytest.Collector` for the given path, or None if not relevant. The new node needs to have the specified ``parent`` as a parent. - :param pathlib.Path file_path: The path to analyze. - :param LEGACY_PATH path: The path to collect (deprecated). + :param file_path: The path to analyze. + :param path: The path to collect (deprecated). .. versionchanged:: 7.0.0 The ``file_path`` parameter was added as a :class:`pathlib.Path` @@ -302,21 +304,36 @@ def pytest_collect_file( def pytest_collectstart(collector: "Collector") -> None: - """Collector starts collecting.""" + """Collector starts collecting. + + :param collector: + The collector. + """ def pytest_itemcollected(item: "Item") -> None: - """We just collected a test item.""" + """We just collected a test item. + + :param item: + The item. + """ def pytest_collectreport(report: "CollectReport") -> None: - """Collector finished collecting.""" + """Collector finished collecting. + + :param report: + The collect report. + """ def pytest_deselected(items: Sequence["Item"]) -> None: """Called for deselected test items, e.g. by keyword. May be called multiple times. + + :param items: + The items. """ @@ -326,6 +343,9 @@ def pytest_make_collect_report(collector: "Collector") -> "Optional[CollectRepor a :class:`~pytest.CollectReport`. Stops at first non-None result, see :ref:`firstresult`. + + :param collector: + The collector. """ @@ -338,16 +358,16 @@ def pytest_make_collect_report(collector: "Collector") -> "Optional[CollectRepor def pytest_pycollect_makemodule( module_path: Path, path: "LEGACY_PATH", parent ) -> Optional["Module"]: - """Return a Module collector or None for the given path. + """Return a :class:`pytest.Module` collector or None for the given path. This hook will be called for each matching test module path. - The pytest_collect_file hook needs to be used if you want to + The :hook:`pytest_collect_file` hook needs to be used if you want to create test modules for files that do not match as a test module. Stops at first non-None result, see :ref:`firstresult`. - :param pathlib.Path module_path: The path of the module to collect. - :param LEGACY_PATH path: The path of the module to collect (deprecated). + :param module_path: The path of the module to collect. + :param path: The path of the module to collect (deprecated). .. versionchanged:: 7.0.0 The ``module_path`` parameter was added as a :class:`pathlib.Path` @@ -364,6 +384,15 @@ def pytest_pycollect_makeitem( """Return a custom item/collector for a Python object in a module, or None. Stops at first non-None result, see :ref:`firstresult`. + + :param collector: + The module/class collector. + :param name: + The name of the object in the module/class. + :param obj: + The object. + :returns: + The created items/collectors. """ @@ -372,11 +401,18 @@ def pytest_pyfunc_call(pyfuncitem: "Function") -> Optional[object]: """Call underlying test function. Stops at first non-None result, see :ref:`firstresult`. + + :param pyfuncitem: + The function item. """ def pytest_generate_tests(metafunc: "Metafunc") -> None: - """Generate (multiple) parametrized calls to a test function.""" + """Generate (multiple) parametrized calls to a test function. + + :param metafunc: + The :class:`~pytest.Metafunc` helper for the test function. + """ @hookspec(firstresult=True) @@ -391,7 +427,7 @@ def pytest_make_parametrize_id( Stops at first non-None result, see :ref:`firstresult`. - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. :param val: The parametrized value. :param str argname: The automatic parameter name produced by pytest. """ @@ -416,7 +452,7 @@ def pytest_runtestloop(session: "Session") -> Optional[object]: If at any point ``session.shouldfail`` or ``session.shouldstop`` are set, the loop is terminated after the runtest protocol for the current item is finished. - :param pytest.Session session: The pytest session object. + :param session: The pytest session object. Stops at first non-None result, see :ref:`firstresult`. The return value is not used, but only stops further processing. @@ -468,7 +504,7 @@ def pytest_runtest_logstart( See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. - :param str nodeid: Full node ID of the item. + :param nodeid: Full node ID of the item. :param location: A tuple of ``(filename, lineno, testname)``. """ @@ -480,7 +516,7 @@ def pytest_runtest_logfinish( See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. - :param str nodeid: Full node ID of the item. + :param nodeid: Full node ID of the item. :param location: A tuple of ``(filename, lineno, testname)``. """ @@ -492,6 +528,9 @@ def pytest_runtest_setup(item: "Item") -> None: parents (which haven't been setup yet). This includes obtaining the values of fixtures required by the item (which haven't been obtained yet). + + :param item: + The item. """ @@ -499,6 +538,9 @@ def pytest_runtest_call(item: "Item") -> None: """Called to run the test for test item (the call phase). The default implementation calls ``item.runtest()``. + + :param item: + The item. """ @@ -510,6 +552,8 @@ def pytest_runtest_teardown(item: "Item", nextitem: Optional["Item"]) -> None: includes running the teardown phase of fixtures required by the item (if they go out of scope). + :param item: + The item. :param nextitem: The scheduled-to-be-next test item (None if no further test item is scheduled). This argument is used to perform exact teardowns, i.e. @@ -527,6 +571,7 @@ def pytest_runtest_makereport( See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + :param item: The item. :param call: The :class:`~pytest.CallInfo` for the phase. Stops at first non-None result, see :ref:`firstresult`. @@ -547,7 +592,11 @@ def pytest_report_to_serializable( report: Union["CollectReport", "TestReport"], ) -> Optional[Dict[str, Any]]: """Serialize the given report object into a data structure suitable for - sending over the wire, e.g. converted to JSON.""" + sending over the wire, e.g. converted to JSON. + + :param config: The pytest config object. + :param report: The report. + """ @hookspec(firstresult=True) @@ -556,7 +605,10 @@ def pytest_report_from_serializable( data: Dict[str, Any], ) -> Optional[Union["CollectReport", "TestReport"]]: """Restore a report object previously serialized with - :hook:`pytest_report_to_serializable`.""" + :hook:`pytest_report_to_serializable`. + + :param config: The pytest config object. + """ # ------------------------------------------------------------------------- @@ -570,7 +622,12 @@ def pytest_fixture_setup( ) -> Optional[object]: """Perform fixture setup execution. - :returns: The return value of the call to the fixture function. + :param fixturdef: + The fixture definition object. + :param request: + The fixture request object. + :returns: + The return value of the call to the fixture function. Stops at first non-None result, see :ref:`firstresult`. @@ -586,7 +643,13 @@ def pytest_fixture_post_finalizer( ) -> None: """Called after fixture teardown, but before the cache is cleared, so the fixture result ``fixturedef.cached_result`` is still available (not - ``None``).""" + ``None``). + + :param fixturdef: + The fixture definition object. + :param request: + The fixture request object. + """ # ------------------------------------------------------------------------- @@ -598,7 +661,7 @@ def pytest_sessionstart(session: "Session") -> None: """Called after the ``Session`` object has been created and before performing collection and entering the run test loop. - :param pytest.Session session: The pytest session object. + :param session: The pytest session object. """ @@ -608,15 +671,15 @@ def pytest_sessionfinish( ) -> None: """Called after whole test run finished, right before returning the exit status to the system. - :param pytest.Session session: The pytest session object. - :param int exitstatus: The status which pytest will return to the system. + :param session: The pytest session object. + :param exitstatus: The status which pytest will return to the system. """ def pytest_unconfigure(config: "Config") -> None: """Called before test process is exited. - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. """ @@ -635,7 +698,10 @@ def pytest_assertrepr_compare( *in* a string will be escaped. Note that all but the first line will be indented slightly, the intention is for the first line to be a summary. - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. + :param op: The operator, e.g. `"=="`, `"!="`, `"not in"`. + :param left: The left operand. + :param right: The right operand. """ @@ -660,10 +726,10 @@ def pytest_assertion_pass(item: "Item", lineno: int, orig: str, expl: str) -> No 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. - :param pytest.Item item: pytest item object of current test. - :param int lineno: Line number of the assert statement. - :param str orig: String with the original assertion. - :param str expl: String with the assert explanation. + :param item: pytest item object of current test. + :param lineno: Line number of the assert statement. + :param orig: String with the original assertion. + :param expl: String with the assert explanation. """ @@ -677,9 +743,9 @@ def pytest_report_header( ) -> Union[str, List[str]]: """Return a string or list of strings to be displayed as header info for terminal reporting. - :param pytest.Config config: The pytest config object. - :param Path start_path: The starting dir. - :param LEGACY_PATH startdir: The starting dir (deprecated). + :param config: The pytest config object. + :param start_path: The starting dir. + :param startdir: The starting dir (deprecated). .. note:: @@ -714,9 +780,9 @@ def pytest_report_collectionfinish( .. versionadded:: 3.2 - :param pytest.Config config: The pytest config object. - :param Path start_path: The starting dir. - :param LEGACY_PATH startdir: The starting dir (deprecated). + :param config: The pytest config object. + :param start_path: The starting dir. + :param startdir: The starting dir (deprecated). :param items: List of pytest items that are going to be executed; this list should not be modified. .. note:: @@ -755,6 +821,7 @@ def pytest_report_teststatus( :param report: The report object whose status is to be returned. :param config: The pytest config object. + :returns: The test status. Stops at first non-None result, see :ref:`firstresult`. """ @@ -767,9 +834,9 @@ def pytest_terminal_summary( ) -> None: """Add a section to terminal summary reporting. - :param _pytest.terminal.TerminalReporter terminalreporter: The internal terminal reporter object. - :param int exitstatus: The exit status that will be reported back to the OS. - :param pytest.Config config: The pytest config object. + :param terminalreporter: The internal terminal reporter object. + :param exitstatus: The exit status that will be reported back to the OS. + :param config: The pytest config object. .. versionadded:: 4.2 The ``config`` parameter. @@ -785,21 +852,21 @@ def pytest_warning_recorded( ) -> None: """Process a warning captured by the internal pytest warnings plugin. - :param warnings.WarningMessage warning_message: + :param warning_message: The captured warning. This is the same object produced by :py:func:`warnings.catch_warnings`, and contains the same attributes as the parameters of :py:func:`warnings.showwarning`. - :param str when: + :param when: Indicates when the warning was captured. Possible values: * ``"config"``: during pytest configuration/initialization stage. * ``"collect"``: during test collection. * ``"runtest"``: during test execution. - :param str nodeid: + :param nodeid: Full id of the item. - :param tuple|None location: + :param location: When available, holds information about the execution context of the captured warning (filename, linenumber, function). ``function`` evaluates to when the execution context is at the module level. @@ -824,7 +891,7 @@ def pytest_markeval_namespace(config: "Config") -> Dict[str, Any]: .. versionadded:: 6.2 - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. :returns: A dictionary of additional globals to add. """ @@ -842,13 +909,19 @@ def pytest_internalerror( Return True to suppress the fallback handling of printing an INTERNALERROR message directly to sys.stderr. + + :param excrepr: The exception repr object. + :param excinfo: The exception info. """ def pytest_keyboard_interrupt( excinfo: "ExceptionInfo[Union[KeyboardInterrupt, Exit]]", ) -> None: - """Called for keyboard interrupt.""" + """Called for keyboard interrupt. + + :param excinfo: The exception info. + """ def pytest_exception_interact( @@ -867,6 +940,13 @@ def pytest_exception_interact( This hook is not called if the exception that was raised is an internal exception like ``skip.Exception``. + + :param node: + The item or collector. + :param call: + The call information. Contains the exception. + :param report: + The collection or test report. """ @@ -876,8 +956,8 @@ def pytest_enter_pdb(config: "Config", pdb: "pdb.Pdb") -> None: Can be used by plugins to take special action just before the python debugger enters interactive mode. - :param pytest.Config config: The pytest config object. - :param pdb.Pdb pdb: The Pdb instance. + :param config: The pytest config object. + :param pdb: The Pdb instance. """ @@ -887,6 +967,6 @@ def pytest_leave_pdb(config: "Config", pdb: "pdb.Pdb") -> None: Can be used by plugins to take special action just after the python debugger leaves interactive mode. - :param pytest.Config config: The pytest config object. - :param pdb.Pdb pdb: The Pdb instance. + :param config: The pytest config object. + :param pdb: The Pdb instance. """ diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 66057ef6f61..7a5170f328b 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -354,7 +354,10 @@ def test_foo(record_testsuite_property): record_testsuite_property("ARCH", "PPC") record_testsuite_property("STORAGE_TYPE", "CEPH") - ``name`` must be a string, ``value`` will be converted to a string and properly xml-escaped. + :param name: + The property name. + :param value: + The property value. Will be converted to a string. .. warning:: diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 2eb69fdbfb4..f9091399f2c 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -37,6 +37,8 @@ if TYPE_CHECKING: logging_StreamHandler = logging.StreamHandler[StringIO] + + from typing_extensions import Literal else: logging_StreamHandler = logging.StreamHandler @@ -382,20 +384,19 @@ def _finalize(self) -> None: @property def handler(self) -> LogCaptureHandler: - """Get the logging handler used by the fixture. - - :rtype: LogCaptureHandler - """ + """Get the logging handler used by the fixture.""" return self._item.stash[caplog_handler_key] - def get_records(self, when: str) -> List[logging.LogRecord]: + def get_records( + self, when: "Literal['setup', 'call', 'teardown']" + ) -> List[logging.LogRecord]: """Get the logging records for one of the possible test phases. - :param str when: - Which test phase to obtain the records from. Valid values are: "setup", "call" and "teardown". + :param when: + Which test phase to obtain the records from. + Valid values are: "setup", "call" and "teardown". :returns: The list of captured records at the given stage. - :rtype: List[logging.LogRecord] .. versionadded:: 3.4 """ @@ -452,8 +453,8 @@ def set_level(self, level: Union[int, str], logger: Optional[str] = None) -> Non The levels of the loggers changed by this function will be restored to their initial values at the end of the test. - :param int level: The level. - :param str logger: The logger to update. If not given, the root logger. + :param level: The level. + :param logger: The logger to update. If not given, the root logger. """ logger_obj = logging.getLogger(logger) # Save the original log-level to restore it during teardown. @@ -471,8 +472,8 @@ def at_level( the end of the 'with' statement the level is restored to its original value. - :param int level: The level. - :param str logger: The logger to update. If not given, the root logger. + :param level: The level. + :param logger: The logger to update. If not given, the root logger. """ logger_obj = logging.getLogger(logger) orig_level = logger_obj.level diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index a03f0f89c2a..6717d1135ee 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -62,8 +62,8 @@ def test_eval(test_input, expected): assert eval(test_input) == expected :param values: Variable args of the values of the parameter set, in order. - :keyword marks: A single mark or a list of marks to be applied to this parameter set. - :keyword str id: The id to attribute to this parameter set. + :param marks: A single mark or a list of marks to be applied to this parameter set. + :param id: The id to attribute to this parameter set. """ return ParameterSet.param(*values, marks=marks, id=id) diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 91d590fb3df..fdb252c5c0a 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -115,7 +115,7 @@ class MonkeyPatch: Returned by the :fixture:`monkeypatch` fixture. - :versionchanged:: 6.2 + .. versionchanged:: 6.2 Can now also be used directly as `pytest.MonkeyPatch()`, for when the fixture is not available. In this case, use :meth:`with MonkeyPatch.context() as mp: ` or remember to call @@ -338,7 +338,8 @@ def syspath_prepend(self, path) -> None: def chdir(self, path: Union[str, "os.PathLike[str]"]) -> None: """Change the current working directory to the specified path. - Path can be a string or a path object. + :param path: + The path to change into. """ if self._cwd is None: self._cwd = os.getcwd() diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index 1a168043a4f..cfb9b5a3634 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -193,7 +193,7 @@ def __init__( nodeid: Optional[str] = None, ) -> None: #: A unique name within the scope of the parent node. - self.name = name + self.name: str = name #: The parent collector node. self.parent = parent @@ -208,7 +208,7 @@ def __init__( if session: #: The pytest session this node is part of. - self.session = session + self.session: Session = session else: if not parent: raise TypeError("session or parent must be provided") @@ -239,9 +239,7 @@ def __init__( #: A place where plugins can store information on the node for their #: own use. - #: - #: :type: Stash - self.stash = Stash() + self.stash: Stash = Stash() # Deprecated alias. Was never public. Can be removed in a few releases. self._store = self.stash @@ -326,7 +324,10 @@ def teardown(self) -> None: def listchain(self) -> List["Node"]: """Return list of all parent collectors up to self, starting from - the root of collection tree.""" + the root of collection tree. + + :returns: The nodes. + """ chain = [] item: Optional[Node] = self while item is not None: @@ -340,6 +341,8 @@ def add_marker( ) -> None: """Dynamically add a marker object to the node. + :param marker: + The marker. :param append: Whether to append the marker, or prepend it. """ @@ -361,6 +364,7 @@ def iter_markers(self, name: Optional[str] = None) -> Iterator[Mark]: """Iterate over all markers of the node. :param name: If given, filter the results by the name attribute. + :returns: An iterator of the markers of the node. """ return (x[1] for x in self.iter_markers_with_node(name=name)) @@ -407,7 +411,8 @@ def listnames(self) -> List[str]: return [x.name for x in self.listchain()] def addfinalizer(self, fin: Callable[[], object]) -> None: - """Register a function to be called when this node is finalized. + """Register a function to be called without arguments when this node is + finalized. This method can only be called when this node is active in a setup chain, for example during self.setup(). @@ -416,7 +421,11 @@ def addfinalizer(self, fin: Callable[[], object]) -> None: def getparent(self, cls: Type[_NodeType]) -> Optional[_NodeType]: """Get the next parent node (including self) which is an instance of - the given class.""" + the given class. + + :param cls: The node class to search for. + :returns: The node, if found. + """ current: Optional[Node] = self while current and not isinstance(current, cls): current = current.parent diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 684efae7715..e46b663dd50 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -241,6 +241,9 @@ def xfail(reason: str = "") -> NoReturn: This function should be called only during testing (setup, call or teardown). + :param reason: + The message to show the user as reason for the xfail. + .. note:: It is better to use the :ref:`pytest.mark.xfail ref` marker when possible to declare a test to be xfailed under certain conditions @@ -256,12 +259,12 @@ def importorskip( """Import and return the requested module ``modname``, or skip the current test if the module cannot be imported. - :param str modname: + :param modname: The name of the module to import. - :param str minversion: + :param minversion: If given, the imported module's ``__version__`` attribute must be at least this minimal version, otherwise the test is still skipped. - :param str reason: + :param reason: If given, this reason is shown as the message when the module cannot be imported. diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index d8586a05694..a9299944dec 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -661,17 +661,7 @@ class Pytester: against expected output, perfect for black-box testing of pytest plugins. It attempts to isolate the test run from external factors as much as possible, modifying - the current working directory to ``path`` and environment variables during initialization. - - Attributes: - - :ivar Path path: temporary directory path used to create files/run tests from, etc. - - :ivar plugins: - 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. + the current working directory to :attr:`path` and environment variables during initialization. """ __test__ = False @@ -700,6 +690,10 @@ def __init__( name = request.node.name 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. self.plugins: List[Union[str, _PluggyPlugin]] = [] self._cwd_snapshot = CwdSnapshot() self._sys_path_snapshot = SysPathsSnapshot() @@ -724,7 +718,7 @@ def __init__( @property def path(self) -> Path: - """Temporary directory where files are created and pytest is executed.""" + """Temporary directory path used to create files/run tests from, etc.""" return self._path def __repr__(self) -> str: @@ -755,7 +749,7 @@ def preserve_module(name): return SysModulesSnapshot(preserve=preserve_module) def make_hook_recorder(self, pluginmanager: PytestPluginManager) -> HookRecorder: - """Create a new :py:class:`HookRecorder` for a PluginManager.""" + """Create a new :class:`HookRecorder` for a :class:`PytestPluginManager`.""" pluginmanager.reprec = reprec = HookRecorder(pluginmanager, _ispytest=True) self._request.addfinalizer(reprec.finish_recording) return reprec @@ -804,7 +798,7 @@ def to_text(s: Union[Any, bytes]) -> str: def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: r"""Create new text file(s) in the test directory. - :param str ext: + :param ext: The extension the file(s) should use, including the dot, e.g. `.py`. :param args: All args are treated as strings and joined using newlines. @@ -813,6 +807,8 @@ def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: :param kwargs: Each keyword is the name of a file, while the value of it will be written as contents of the file. + :returns: + The first created file. Examples: @@ -832,11 +828,19 @@ def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: return self._makefile(ext, args, kwargs) def makeconftest(self, source: str) -> Path: - """Write a conftest.py file with 'source' as contents.""" + """Write a contest.py file. + + :param source: The contents. + :returns: The conftest.py file. + """ return self.makepyfile(conftest=source) def makeini(self, source: str) -> Path: - """Write a tox.ini file with 'source' as contents.""" + """Write a tox.ini file. + + :param source: The contents. + :returns: The tox.ini file. + """ return self.makefile(".ini", tox=source) def getinicfg(self, source: str) -> SectionWrapper: @@ -845,7 +849,10 @@ def getinicfg(self, source: str) -> SectionWrapper: return IniConfig(str(p))["pytest"] def makepyprojecttoml(self, source: str) -> Path: - """Write a pyproject.toml file with 'source' as contents. + """Write a pyproject.toml file. + + :param source: The contents. + :returns: The pyproject.ini file. .. versionadded:: 6.0 """ @@ -898,6 +905,9 @@ def syspathinsert( This is undone automatically when this object dies at the end of each test. + + :param path: + The path. """ if path is None: path = self.path @@ -905,7 +915,13 @@ def syspathinsert( self._monkeypatch.syspath_prepend(str(path)) def mkdir(self, name: Union[str, "os.PathLike[str]"]) -> Path: - """Create a new (sub)directory.""" + """Create a new (sub)directory. + + :param name: + The name of the directory, relative to the pytester path. + :returns: + The created directory. + """ p = self.path / name p.mkdir() return p @@ -924,14 +940,15 @@ def mkpydir(self, name: Union[str, "os.PathLike[str]"]) -> Path: def copy_example(self, name: Optional[str] = None) -> Path: """Copy file from project's directory into the testdir. - :param str name: The name of the file to copy. - :return: path to the copied directory (inside ``self.path``). - + :param name: + The name of the file to copy. + :return: + Path to the copied directory (inside ``self.path``). """ - example_dir = self._request.config.getini("pytester_example_dir") - if example_dir is None: + example_dir_ = self._request.config.getini("pytester_example_dir") + if example_dir_ is None: raise ValueError("pytester_example_dir is unset, can't copy examples") - example_dir = self._request.config.rootpath / example_dir + example_dir: Path = self._request.config.rootpath / example_dir_ for extra_element in self._request.node.iter_markers("pytester_example_path"): assert extra_element.args @@ -967,14 +984,16 @@ def copy_example(self, name: Optional[str] = None) -> Path: def getnode( self, config: Config, arg: Union[str, "os.PathLike[str]"] - ) -> Optional[Union[Collector, Item]]: - """Return the collection node of a file. + ) -> Union[Collector, Item]: + """Get the collection node of a file. - :param pytest.Config config: + :param config: A pytest config. See :py:meth:`parseconfig` and :py:meth:`parseconfigure` for creating it. - :param os.PathLike[str] arg: + :param arg: Path to the file. + :returns: + The node. """ session = Session.from_config(config) assert "::" not in str(arg) @@ -984,13 +1003,18 @@ def getnode( config.hook.pytest_sessionfinish(session=session, exitstatus=ExitCode.OK) return res - def getpathnode(self, path: Union[str, "os.PathLike[str]"]): + def getpathnode( + self, path: Union[str, "os.PathLike[str]"] + ) -> Union[Collector, Item]: """Return the collection node of a file. This is like :py:meth:`getnode` but uses :py:meth:`parseconfigure` to create the (configured) pytest Config instance. - :param os.PathLike[str] path: Path to the file. + :param path: + Path to the file. + :returns: + The node. """ path = Path(path) config = self.parseconfigure(path) @@ -1006,6 +1030,11 @@ def genitems(self, colitems: Sequence[Union[Item, Collector]]) -> List[Item]: This recurses into the collection node and returns a list of all the test items contained within. + + :param colitems: + The collection nodes. + :returns: + The collected items. """ session = colitems[0].session result: List[Item] = [] @@ -1192,15 +1221,16 @@ def _ensure_basetemp( return new_args def parseconfig(self, *args: Union[str, "os.PathLike[str]"]) -> Config: - """Return a new pytest Config instance from given commandline args. + """Return a new pytest :class:`pytest.Config` instance from given + commandline args. - This invokes the pytest bootstrapping code in _pytest.config to create - a new :py:class:`_pytest.core.PluginManager` and call the - pytest_cmdline_parse hook to create a new - :py:class:`pytest.Config` instance. + This invokes the pytest bootstrapping code in _pytest.config to create a + new :py:class:`pytest.PytestPluginManager` and call the + :hook:`pytest_cmdline_parse` hook to create a new :class:`pytest.Config` + instance. - If :py:attr:`plugins` has been populated they should be plugin modules - to be registered with the PluginManager. + If :attr:`plugins` has been populated they should be plugin modules + to be registered with the plugin manager. """ import _pytest.config @@ -1218,7 +1248,8 @@ def parseconfigure(self, *args: Union[str, "os.PathLike[str]"]) -> Config: """Return a new pytest configured Config instance. Returns a new :py:class:`pytest.Config` instance like - :py:meth:`parseconfig`, but also calls the pytest_configure hook. + :py:meth:`parseconfig`, but also calls the :hook:`pytest_configure` + hook. """ config = self.parseconfig(*args) config._do_configure() @@ -1237,6 +1268,8 @@ def getitem( The module source. :param funcname: The name of the test function for which to return a test item. + :returns: + The test item. """ items = self.getitems(source) for item in items: @@ -1377,6 +1410,8 @@ def run( - Otherwise, it is passed through to :py:class:`subprocess.Popen`. For further information in this case, consult the document of the ``stdin`` parameter in :py:class:`subprocess.Popen`. + :returns: + The result. """ __tracebackhide__ = True @@ -1463,6 +1498,8 @@ def runpytest_subprocess( :param timeout: The period in seconds after which to timeout and raise :py:class:`Pytester.TimeoutExpired`. + :returns: + The result. """ __tracebackhide__ = True p = make_numbered_dir(root=self.path, prefix="runpytest-", mode=0o700) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index d825931debc..00e377f40b3 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -798,15 +798,18 @@ def raises( def raises( expected_exception: Union[Type[E], Tuple[Type[E], ...]], *args: Any, **kwargs: Any ) -> Union["RaisesContext[E]", _pytest._code.ExceptionInfo[E]]: - r"""Assert that a code block/function call raises ``expected_exception`` - or raise a failure exception otherwise. + r"""Assert that a code block/function call raises an exception. - :kwparam match: + :param typing.Type[E] | typing.Tuple[typing.Type[E], ...] expected_exception: + The excpected exception type, or a tuple if one of multiple possible + exception types are excepted. + :kwparam str | typing.Pattern[str] | None match: If specified, a string containing a regular expression, or a regular expression object, that is tested against the string - representation of the exception using :py:func:`re.search`. To match a literal - string that may contain :std:ref:`special characters `, the pattern can - first be escaped with :py:func:`re.escape`. + representation of the exception using :func:`re.search`. + + To match a literal string that may contain :ref:`special characters + `, the pattern can first be escaped with :func:`re.escape`. (This is only used when :py:func:`pytest.raises` is used as a context manager, and passed through to the function otherwise. diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 20862d60388..c35f7087e41 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -276,7 +276,7 @@ def __init__( #: A name -> value dictionary containing all keywords and #: markers associated with a test invocation. - self.keywords = keywords + self.keywords: Mapping[str, Any] = keywords #: Test outcome, always one of "passed", "failed", "skipped". self.outcome = outcome @@ -298,7 +298,7 @@ def __init__( self.sections = list(sections) #: Time it took to run just the test. - self.duration = duration + self.duration: float = duration self.__dict__.update(extra) @@ -309,7 +309,11 @@ def __repr__(self) -> str: @classmethod def from_item_and_call(cls, item: Item, call: "CallInfo[None]") -> "TestReport": - """Create and fill a TestReport with standard item and call info.""" + """Create and fill a TestReport with standard item and call info. + + :param item: The item. + :param call: The call info. + """ when = call.when # Remove "collect" from the Literal type -- only for collection calls. assert when != "collect" diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 12dc463a2a2..9497a0d49da 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -100,7 +100,11 @@ def mktemp(self, basename: str, numbered: bool = True) -> Path: return p def getbasetemp(self) -> Path: - """Return the base temporary directory, creating it if needed.""" + """Return the base temporary directory, creating it if needed. + + :returns: + The base temporary directory. + """ if self._basetemp is not None: return self._basetemp From beae7fd0ba063dd8ef980e15d66286a584aebc97 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 13 Aug 2022 21:04:59 +0300 Subject: [PATCH 153/255] doc: workaround for ugly API docs for overloaded functions with new Sphinx New Sphinx added support for overloads and always displays them all with full type annotations etc. This regresses the API reference for overloaded functions like `fixture()`, `warns()`, `raises()` and friends to become impossible to read. I tried various workarounds but none worked except this one. --- src/_pytest/compat.py | 11 ++++++++++- src/_pytest/fixtures.py | 6 +++--- src/_pytest/main.py | 6 +++--- src/_pytest/python_api.py | 6 +++--- src/_pytest/recwarn.py | 12 +++++++----- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index d0cb07b2291..fab4c31107f 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -20,6 +20,16 @@ import attr import py +# fmt: off +# Workaround for https://github.com/sphinx-doc/sphinx/issues/10351. +# If `overload` is imported from `compat` instead of from `typing`, +# Sphinx doesn't recognize it as `overload` and the API docs for +# overloaded functions look good again. But type checkers handle +# it fine. +# fmt: on +if True: + from typing import overload as overload + if TYPE_CHECKING: from typing_extensions import Final @@ -345,7 +355,6 @@ def final(f): if sys.version_info >= (3, 8): from functools import cached_property as cached_property else: - from typing import overload from typing import Type class cached_property(Generic[_S, _T]): diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 30b6054d05e..d79895c262b 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -20,7 +20,6 @@ from typing import MutableMapping from typing import NoReturn from typing import Optional -from typing import overload from typing import Sequence from typing import Set from typing import Tuple @@ -48,6 +47,7 @@ from _pytest.compat import getlocation from _pytest.compat import is_generator from _pytest.compat import NOTSET +from _pytest.compat import overload from _pytest.compat import safe_getattr from _pytest.config import _PluggyPlugin from _pytest.config import Config @@ -1231,7 +1231,7 @@ def fixture( @overload -def fixture( +def fixture( # noqa: F811 fixture_function: None = ..., *, scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" = ..., @@ -1245,7 +1245,7 @@ def fixture( ... -def fixture( +def fixture( # noqa: F811 fixture_function: Optional[FixtureFunction] = None, *, scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" = "function", diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 4a117fc2ea1..61fb7eaa4e3 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -12,7 +12,6 @@ from typing import Iterator from typing import List from typing import Optional -from typing import overload from typing import Sequence from typing import Set from typing import Tuple @@ -25,6 +24,7 @@ import _pytest._code from _pytest import nodes from _pytest.compat import final +from _pytest.compat import overload from _pytest.config import Config from _pytest.config import directory_arg from _pytest.config import ExitCode @@ -597,12 +597,12 @@ def perform_collect( ... @overload - def perform_collect( + def perform_collect( # noqa: F811 self, args: Optional[Sequence[str]] = ..., genitems: bool = ... ) -> Sequence[Union[nodes.Item, nodes.Collector]]: ... - def perform_collect( + def perform_collect( # noqa: F811 self, args: Optional[Sequence[str]] = None, genitems: bool = True ) -> Sequence[Union[nodes.Item, nodes.Collector]]: """Perform the collection phase for this session. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 00e377f40b3..515d437f0d8 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -12,7 +12,6 @@ from typing import List from typing import Mapping from typing import Optional -from typing import overload from typing import Pattern from typing import Sequence from typing import Tuple @@ -28,6 +27,7 @@ import _pytest._code from _pytest.compat import final from _pytest.compat import STRING_TYPES +from _pytest.compat import overload from _pytest.outcomes import fail @@ -786,7 +786,7 @@ def raises( @overload -def raises( +def raises( # noqa: F811 expected_exception: Union[Type[E], Tuple[Type[E], ...]], func: Callable[..., Any], *args: Any, @@ -795,7 +795,7 @@ def raises( ... -def raises( +def raises( # noqa: F811 expected_exception: Union[Type[E], Tuple[Type[E], ...]], *args: Any, **kwargs: Any ) -> Union["RaisesContext[E]", _pytest._code.ExceptionInfo[E]]: r"""Assert that a code block/function call raises an exception. diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 9c6e7e91daf..9971bb52fb6 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -9,7 +9,6 @@ from typing import Iterator from typing import List from typing import Optional -from typing import overload from typing import Pattern from typing import Tuple from typing import Type @@ -17,6 +16,7 @@ from typing import Union from _pytest.compat import final +from _pytest.compat import overload from _pytest.deprecated import check_ispytest from _pytest.deprecated import WARNS_NONE_ARG from _pytest.fixtures import fixture @@ -47,11 +47,13 @@ def deprecated_call( @overload -def deprecated_call(func: Callable[..., T], *args: Any, **kwargs: Any) -> T: +def deprecated_call( # noqa: F811 + func: Callable[..., T], *args: Any, **kwargs: Any +) -> T: ... -def deprecated_call( +def deprecated_call( # noqa: F811 func: Optional[Callable[..., Any]] = None, *args: Any, **kwargs: Any ) -> Union["WarningsRecorder", Any]: """Assert that code produces a ``DeprecationWarning`` or ``PendingDeprecationWarning``. @@ -93,7 +95,7 @@ def warns( @overload -def warns( +def warns( # noqa: F811 expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], func: Callable[..., T], *args: Any, @@ -102,7 +104,7 @@ def warns( ... -def warns( +def warns( # noqa: F811 expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = Warning, *args: Any, match: Optional[Union[str, Pattern[str]]] = None, From 739322af037459a8bb9b32e32690b67850573bb6 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 13 Aug 2022 21:07:27 +0200 Subject: [PATCH 154/255] Mention `monkeypatch.context()` in the docs (#10192) In addition: * Improve the docs a bit with links. * Recommend `context()` instead of `undo()`. --- src/_pytest/monkeypatch.py | 43 ++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 91d590fb3df..f29c4f2ef55 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -29,21 +29,25 @@ def monkeypatch() -> Generator["MonkeyPatch", None, None]: """A convenient fixture for monkey-patching. - The fixture provides these methods to modify objects, dictionaries or - os.environ:: - - monkeypatch.setattr(obj, name, value, raising=True) - monkeypatch.delattr(obj, name, raising=True) - monkeypatch.setitem(mapping, name, value) - monkeypatch.delitem(obj, name, raising=True) - monkeypatch.setenv(name, value, prepend=None) - monkeypatch.delenv(name, raising=True) - monkeypatch.syspath_prepend(path) - monkeypatch.chdir(path) + The fixture provides these methods to modify objects, dictionaries, or + :data:`os.environ`: + + * :meth:`monkeypatch.setattr(obj, name, value, raising=True) ` + * :meth:`monkeypatch.delattr(obj, name, raising=True) ` + * :meth:`monkeypatch.setitem(mapping, name, value) ` + * :meth:`monkeypatch.delitem(obj, name, raising=True) ` + * :meth:`monkeypatch.setenv(name, value, prepend=None) ` + * :meth:`monkeypatch.delenv(name, raising=True) ` + * :meth:`monkeypatch.syspath_prepend(path) ` + * :meth:`monkeypatch.chdir(path) ` All modifications will be undone after the requesting test function or - fixture has finished. The ``raising`` parameter determines if a KeyError - or AttributeError will be raised if the set/deletion operation has no target. + fixture has finished. The ``raising`` parameter determines if a :class:`KeyError` + or :class:`AttributeError` will be raised if the set/deletion operation does not have the + specified target. + + To undo modifications done by the fixture in a contained scope, + use :meth:`context() `. """ mpatch = MonkeyPatch() yield mpatch @@ -353,11 +357,14 @@ def undo(self) -> None: There is generally no need to call `undo()`, since it is called automatically during tear-down. - Note that the same `monkeypatch` fixture is used across a - single test function invocation. If `monkeypatch` is used both by - the test function itself and one of the test fixtures, - calling `undo()` will undo all of the changes made in - both functions. + .. note:: + The same `monkeypatch` fixture is used across a + single test function invocation. If `monkeypatch` is used both by + the test function itself and one of the test fixtures, + calling `undo()` will undo all of the changes made in + both functions. + + Prefer to use :meth:`context() ` instead. """ for obj, name, value in reversed(self._setattr): if value is not notset: From f425dfc15881dc853a8143e1d346fd969dff95f0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Aug 2022 05:07:01 -0300 Subject: [PATCH 155/255] [automated] Update plugin list (#10214) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 120 +++++++++++++++++++++---------- 1 file changed, 84 insertions(+), 36 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 235628055ef..20d5e4c2605 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1094 plugins. +This list contains 1100 plugins. .. only:: not latex @@ -201,7 +201,7 @@ This list contains 1094 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jun 08, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 13, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -372,7 +372,7 @@ This list contains 1094 plugins. :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) - :pypi:`pytest-fail-slow` Fail tests that take too long to run Apr 25, 2022 4 - Beta pytest (>=6.0) + :pypi:`pytest-fail-slow` Fail tests that take too long to run Aug 13, 2022 4 - Beta pytest (>=6.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-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A @@ -407,6 +407,7 @@ This list contains 1094 plugins. :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :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. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) + :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Aug 09, 2022 4 - Beta pytest (~=7.1) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest @@ -456,7 +457,7 @@ This list contains 1094 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 05, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 13, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -480,7 +481,7 @@ This list contains 1094 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-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A - :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A + :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A :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 Jun 29, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A @@ -493,7 +494,7 @@ This list contains 1094 plugins. :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-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Aug 10, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jul 14, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A @@ -504,7 +505,7 @@ This list contains 1094 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :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-invenio` Pytest fixtures for Invenio. May 05, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` "Pytest fixtures for Invenio." Aug 09, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -520,13 +521,13 @@ This list contains 1094 plugins. :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) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A - :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 03, 2022 4 - Beta pytest (>=7.1.0) + :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 09, 2022 4 - Beta pytest (>=7.1.0) :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-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Aug 11, 2022 5 - Production/Stable N/A :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A @@ -547,6 +548,7 @@ This list contains 1094 plugins. :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 :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Aug 13, 2022 4 - Beta N/A :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) @@ -603,7 +605,7 @@ This list contains 1094 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. Jul 20, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Aug 12, 2022 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-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -642,7 +644,7 @@ This list contains 1094 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 Jul 21, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 10, 2022 N/A pytest (==6.2.5) :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 Jul 07, 2021 N/A N/A @@ -751,7 +753,7 @@ This list contains 1094 plugins. :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 Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Aug 04, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Aug 10, 2022 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) @@ -823,18 +825,20 @@ This list contains 1094 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :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-resilient-circuits` Resilient Circuits fixtures for PyTest. Jul 07, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Aug 12, 2022 N/A N/A :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 01, 2021 5 - Production/Stable pytest (>=3.5.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 Apr 26, 2021 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 May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 05, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 11, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) :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-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 Jul 29, 2021 5 - Production/Stable pytest :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A @@ -928,6 +932,7 @@ This list contains 1094 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 Mar 13, 2018 3 - Alpha N/A + :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Aug 10, 2022 3 - Alpha pytest (>=2.0) :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest :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 N/A @@ -988,7 +993,7 @@ This list contains 1094 plugins. :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Aug 01, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Jul 26, 2022 N/A pytest (>=3.6) + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Aug 12, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) @@ -1014,7 +1019,7 @@ This list contains 1094 plugins. :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest - :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A N/A + :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A 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 @@ -1036,7 +1041,7 @@ This list contains 1094 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :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) for Pytest, automatically launched after your test run is finished Aug 03, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Aug 13, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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) @@ -1106,6 +1111,7 @@ This list contains 1094 plugins. :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :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. Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :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 @@ -2399,7 +2405,7 @@ This list contains 1094 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Jun 08, 2022, + *last release*: Aug 13, 2022, *status*: N/A, *requires*: N/A @@ -3596,7 +3602,7 @@ This list contains 1094 plugins. A pytest plugin that helps better distinguishing real test failures from setup flakiness. :pypi:`pytest-fail-slow` - *last release*: Apr 25, 2022, + *last release*: Aug 13, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0) @@ -3840,6 +3846,13 @@ This list contains 1094 plugins. A set of py.test fixtures to test Flask applications. + :pypi:`pytest-flask-ligand` + *last release*: Aug 09, 2022, + *status*: 4 - Beta, + *requires*: pytest (~=7.1) + + Pytest fixtures and helper functions to use for testing flask-ligand microservices. + :pypi:`pytest-flask-sqlalchemy` *last release*: Apr 30, 2022, *status*: 4 - Beta, @@ -4184,7 +4197,7 @@ This list contains 1094 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 05, 2022, + *last release*: Aug 13, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4352,7 +4365,7 @@ This list contains 1094 plugins. A plugin to sent pytest results to an Ibutsu server :pypi:`pytest-icdiff` - *last release*: Apr 08, 2020, + *last release*: Aug 09, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4443,7 +4456,7 @@ This list contains 1094 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: Apr 12, 2022, + *last release*: Aug 10, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4520,11 +4533,11 @@ This list contains 1094 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: May 05, 2022, + *last release*: Aug 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) - Pytest fixtures for Invenio. + "Pytest fixtures for Invenio." :pypi:`pytest-involve` *last release*: Feb 02, 2020, @@ -4632,7 +4645,7 @@ This list contains 1094 plugins. Generate JSON test reports :pypi:`pytest-json-fixtures` - *last release*: Aug 03, 2022, + *last release*: Aug 09, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.0) @@ -4674,7 +4687,7 @@ This list contains 1094 plugins. :pypi:`pytest-kind` - *last release*: Jan 24, 2021, + *last release*: Aug 11, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4820,6 +4833,13 @@ This list contains 1094 plugins. Profile code executed by pytest + :pypi:`pytest-line-profiler-apn` + *last release*: Aug 13, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Profile code executed by pytest + :pypi:`pytest-lisa` *last release*: Jan 21, 2021, *status*: 3 - Alpha, @@ -5213,7 +5233,7 @@ This list contains 1094 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*: Jul 20, 2022, + *last release*: Aug 12, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5486,7 +5506,7 @@ This list contains 1094 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Jul 21, 2022, + *last release*: Aug 10, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6249,7 +6269,7 @@ This list contains 1094 plugins. pytest plugin to check source code with pylint :pypi:`pytest-pyodide` - *last release*: Aug 04, 2022, + *last release*: Aug 10, 2022, *status*: N/A, *requires*: pytest @@ -6753,7 +6773,7 @@ This list contains 1094 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: Jul 07, 2022, + *last release*: Aug 12, 2022, *status*: N/A, *requires*: N/A @@ -6787,6 +6807,13 @@ This list contains 1094 plugins. py.test integration for responses + :pypi:`pytest-rest-api` + *last release*: Aug 08, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + + :pypi:`pytest-restrict` *last release*: May 11, 2022, *status*: 5 - Production/Stable, @@ -6802,7 +6829,7 @@ This list contains 1094 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-retry` - *last release*: Aug 05, 2022, + *last release*: Aug 11, 2022, *status*: N/A, *requires*: pytest (>=7.0.0) @@ -6836,6 +6863,13 @@ This list contains 1094 plugins. pytest plugin to test webapplications using the Ringo webframework + :pypi:`pytest-rmsis` + *last release*: Aug 10, 2022, + *status*: N/A, + *requires*: pytest (>=5.3.5) + + Sycronise pytest results to Jira RMsis + :pypi:`pytest-rng` *last release*: Aug 08, 2019, *status*: 5 - Production/Stable, @@ -7487,6 +7521,13 @@ This list contains 1094 plugins. pytest plugin with sqlalchemy related fixtures + :pypi:`pytest-sqlalchemy-mock` + *last release*: Aug 10, 2022, + *status*: 3 - Alpha, + *requires*: pytest (>=2.0) + + pytest sqlalchemy plugin for mock + :pypi:`pytest-sql-bigquery` *last release*: Dec 19, 2019, *status*: N/A, @@ -7908,9 +7949,9 @@ This list contains 1094 plugins. Pytest plugin for sending report to testrail system. :pypi:`pytest-testrail-ns` - *last release*: Jul 26, 2022, + *last release*: Aug 12, 2022, *status*: N/A, - *requires*: pytest (>=3.6) + *requires*: N/A pytest plugin for creating TestRail runs and adding results @@ -8090,7 +8131,7 @@ This list contains 1094 plugins. Utilities to create temporary file hierarchies in pytest. :pypi:`pytest-tmreport` - *last release*: Nov 17, 2021, + *last release*: Aug 12, 2022, *status*: N/A, *requires*: N/A @@ -8244,11 +8285,11 @@ This list contains 1094 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Aug 03, 2022, + *last release*: Aug 13, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) - Text User Interface (TUI) for Pytest, automatically launched after your test run is finished + Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export :pypi:`pytest-twilio-conversations-client-mock` *last release*: Aug 02, 2022, @@ -8733,6 +8774,13 @@ This list contains 1094 plugins. PyTest plugin to run tests concurrently, each \`yield\` switch context to other one + :pypi:`pytest-yls` + *last release*: Aug 08, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + Pytest plugin to test the YLS as a whole. + :pypi:`pytest-yuk` *last release*: Mar 26, 2021, *status*: N/A, From cb65f64572557e08e4eba6b84b855652acde1c34 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 15 Aug 2022 19:07:36 +0300 Subject: [PATCH 156/255] changelog: add missing entry for PR #9248 --- changelog/9248.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9248.doc.rst diff --git a/changelog/9248.doc.rst b/changelog/9248.doc.rst new file mode 100644 index 00000000000..755e7b0f1af --- /dev/null +++ b/changelog/9248.doc.rst @@ -0,0 +1 @@ +The documentation is now built using Sphinx 5.x (up from 3.x previously). From 67e29d2548839ecc6ab91802f746c5fba704ffc2 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 15 Aug 2022 19:12:12 +0300 Subject: [PATCH 157/255] mark: allow any Sequence[str] for parametrize(argnames), not just list/tuple The main motivation for this change is to simplify the type shown in code editors -- `Sequence[str]` is easier to follow than `Union[list[str], tuple[str, ...]]`. It also permits using other types if desired. It might lead to problems if someone uses some oddball sequence type, but hopefully they won't do that. --- changelog/10218.improvement.rst | 5 +++++ src/_pytest/mark/structures.py | 12 ++++++------ src/_pytest/python.py | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 changelog/10218.improvement.rst diff --git a/changelog/10218.improvement.rst b/changelog/10218.improvement.rst new file mode 100644 index 00000000000..e00325e2567 --- /dev/null +++ b/changelog/10218.improvement.rst @@ -0,0 +1,5 @@ +``@pytest.mark.parametrize()`` (and similar functions) now accepts any ``Sequence[str]`` for the argument names, +instead of just ``list[str]`` and ``tuple[str, ...]``. + +(Note that ``str``, which is itself a ``Sequence[str]``, is still treated as a +comma-delimited name list, as before). diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index b8cbf0d1875..800a25c9243 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -126,12 +126,12 @@ def extract_from( @staticmethod def _parse_parametrize_args( - argnames: Union[str, List[str], Tuple[str, ...]], + argnames: Union[str, Sequence[str]], argvalues: Iterable[Union["ParameterSet", Sequence[object], object]], *args, **kwargs, - ) -> Tuple[Union[List[str], Tuple[str, ...]], bool]: - if not isinstance(argnames, (tuple, list)): + ) -> Tuple[Sequence[str], bool]: + if isinstance(argnames, str): argnames = [x.strip() for x in argnames.split(",") if x.strip()] force_tuple = len(argnames) == 1 else: @@ -150,12 +150,12 @@ def _parse_parametrize_parameters( @classmethod def _for_parametrize( cls, - argnames: Union[str, List[str], Tuple[str, ...]], + argnames: Union[str, Sequence[str]], argvalues: Iterable[Union["ParameterSet", Sequence[object], object]], func, config: Config, nodeid: str, - ) -> Tuple[Union[List[str], Tuple[str, ...]], List["ParameterSet"]]: + ) -> Tuple[Sequence[str], List["ParameterSet"]]: argnames, force_tuple = cls._parse_parametrize_args(argnames, argvalues) parameters = cls._parse_parametrize_parameters(argvalues, force_tuple) del argvalues @@ -434,7 +434,7 @@ def __call__( class _ParametrizeMarkDecorator(MarkDecorator): def __call__( # type: ignore[override] self, - argnames: Union[str, List[str], Tuple[str, ...]], + argnames: Union[str, Sequence[str]], argvalues: Iterable[Union[ParameterSet, Sequence[object], object]], *, indirect: Union[bool, Sequence[str]] = ..., diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 91054f370d3..3db8775061b 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1207,7 +1207,7 @@ def __init__( def parametrize( self, - argnames: Union[str, List[str], Tuple[str, ...]], + argnames: Union[str, Sequence[str]], argvalues: Iterable[Union[ParameterSet, Sequence[object], object]], indirect: Union[bool, Sequence[str]] = False, ids: Optional[ From 56862c03cbb3f9cae3464c33390fbbaf8a91823a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 15 Aug 2022 19:41:57 +0300 Subject: [PATCH 158/255] pyproject.toml: remove `wheel` from `build-system.requires` It's not required -- see https://github.com/pypa/packaging.python.org/pull/1050 --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d683aebea7..a66f90017ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,6 @@ requires = [ # sync with setup.py until we discard non-pep-517/518 "setuptools>=45.0", "setuptools-scm[toml]>=6.2.3", - "wheel", ] build-backend = "setuptools.build_meta" From 2e7c718373f2ddd1cfa25686abd5166f602af297 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 15 Aug 2022 13:55:19 -0300 Subject: [PATCH 159/255] Add reference to the Where to patch docs in monkeypatch.setattr (#10217) This should help users with the common issue of patching the wrong place. Also took the opportunity of using proper links in the monkeypatch introduction. Related to #10216 Co-authored-by: Ran Benita --- doc/en/how-to/monkeypatch.rst | 24 +++++++++++------------ src/_pytest/monkeypatch.py | 37 +++++++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/doc/en/how-to/monkeypatch.rst b/doc/en/how-to/monkeypatch.rst index 9214de77edb..81edd00bda5 100644 --- a/doc/en/how-to/monkeypatch.rst +++ b/doc/en/how-to/monkeypatch.rst @@ -14,18 +14,16 @@ environment variable, or to modify ``sys.path`` for importing. The ``monkeypatch`` fixture provides these helper methods for safely patching and mocking functionality in tests: -.. code-block:: python +* :meth:`monkeypatch.setattr(obj, name, value, raising=True) ` +* :meth:`monkeypatch.delattr(obj, name, raising=True) ` +* :meth:`monkeypatch.setitem(mapping, name, value) ` +* :meth:`monkeypatch.delitem(obj, name, raising=True) ` +* :meth:`monkeypatch.setenv(name, value, prepend=None) ` +* :meth:`monkeypatch.delenv(name, raising=True) ` +* :meth:`monkeypatch.syspath_prepend(path) ` +* :meth:`monkeypatch.chdir(path) ` +* :meth:`monkeypatch.context() ` - monkeypatch.setattr(obj, name, value, raising=True) - monkeypatch.setattr("somemodule.obj.name", value, raising=True) - monkeypatch.delattr(obj, name, raising=True) - monkeypatch.setitem(mapping, name, value) - monkeypatch.delitem(obj, name, raising=True) - monkeypatch.setenv(name, value, prepend=None) - monkeypatch.delenv(name, raising=True) - monkeypatch.syspath_prepend(path) - monkeypatch.chdir(path) - monkeypatch.context() All modifications will be undone after the requesting test function or fixture has finished. The ``raising`` @@ -64,8 +62,8 @@ and a discussion of its motivation. .. _`monkeypatch blog post`: https://tetamap.wordpress.com//2009/03/03/monkeypatching-in-unit-tests-done-right/ -Simple example: monkeypatching functions ----------------------------------------- +Monkeypatching functions +------------------------ Consider a scenario where you are working with user directories. In the context of testing, you do not want your test to depend on the running user. ``monkeypatch`` diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index abf67690710..c6e29ac7642 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -40,6 +40,7 @@ def monkeypatch() -> Generator["MonkeyPatch", None, None]: * :meth:`monkeypatch.delenv(name, raising=True) ` * :meth:`monkeypatch.syspath_prepend(path) ` * :meth:`monkeypatch.chdir(path) ` + * :meth:`monkeypatch.context() ` All modifications will be undone after the requesting test function or fixture has finished. The ``raising`` parameter determines if a :class:`KeyError` @@ -186,16 +187,40 @@ def setattr( value: object = notset, raising: bool = True, ) -> None: - """Set attribute value on target, memorizing the old value. + """ + Set attribute value on target, memorizing the old value. + + For example: + + .. code-block:: python + + import os + + monkeypatch.setattr(os, "getcwd", lambda: "/") + + The code above replaces the :func:`os.getcwd` function by a ``lambda`` which + always returns ``"/"``. - For convenience you can specify a string as ``target`` which + For convenience, you can specify a string as ``target`` which will be interpreted as a dotted import path, with the last part - being the attribute name. For example, - ``monkeypatch.setattr("os.getcwd", lambda: "/")`` - would set the ``getcwd`` function of the ``os`` module. + being the attribute name: - Raises AttributeError if the attribute does not exist, unless + .. code-block:: python + + monkeypatch.setattr("os.getcwd", lambda: "/") + + Raises :class:`AttributeError` if the attribute does not exist, unless ``raising`` is set to False. + + **Where to patch** + + ``monkeypatch.setattr`` works by (temporarily) changing the object that a name points to with another one. + There can be many names pointing to any individual object, so for patching to work you must ensure + that you patch the name used by the system under test. + + See the section :ref:`Where to patch ` in the :mod:`unittest.mock` + docs for a complete explanation, which is meant for :func:`unittest.mock.patch` but + applies to ``monkeypatch.setattr`` as well. """ __tracebackhide__ = True import inspect From 7378f35b035a75472330cc9ed65d90d127941309 Mon Sep 17 00:00:00 2001 From: aizpurua23a <57321880+aizpurua23a@users.noreply.github.com> Date: Mon, 15 Aug 2022 19:00:03 +0200 Subject: [PATCH 160/255] Update fixtures.rst w/ finalizer order Co-authored-by: Bruno Oliveira --- doc/en/how-to/fixtures.rst | 77 +++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index b90b40619f5..8ab498bd7d4 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -735,8 +735,81 @@ does offer some nuances for when you're in a pinch. .. code-block:: pytest $ pytest -q test_emaillib.py - . [100%] - 1 passed in 0.12s + . [100%] + 1 passed in 0.12s + +Note on finalizer order +"""""""""""""""""""""""" + +Finalizers are executed in a first-in-last-out order. +For yield fixtures, the first teardown code to run is from the right-most fixture, i.e. the last test parameter. + +.. regendoc:wipe + +.. code-block:: python + + import pytest + + + def test_bar(fix_w_yield1, fix_w_yield2): + print("test_bar") + + + @pytest.fixture + def fix_w_yield1(): + yield + print("after_yield_1") + + + @pytest.fixture + def fix_w_yield2(): + yield + print("after_yield_2") + + +.. code-block:: pytest + + $ pytest test_module.py + =========================== test session starts ============================ + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + collected 1 item + + test_module.py test_bar + .after_yield_2 + after_yield_1 + + + +For finalizers, the first fixture to run is last call to `request.addfinalizer`. + +.. code-block:: python + + import pytest + + + @pytest.fixture + def fix_w_finalizers(request): + request.addfinalizer(partial(print, "finalizer_2")) + request.addfinalizer(partial(print, "finalizer_1")) + + + def test_bar(fix_w_finalizers): + print("test_bar") + + +.. code-block:: pytest + + $ pytest test_module.py + =========================== test session starts ============================ + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + collected 1 item + + test_module.py test_bar + .finalizer_1 + finalizer_2 + +This is so because yield fixtures use `addfinalizer` behind the scenes: when the fixture executes, `addfinalizer` registers a function that resumes the generator, which in turn calls the teardown code. + .. _`safe teardowns`: From 832100955a4607b46b31f5d343e6b75ed87a2257 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 17 Aug 2022 11:40:03 -0300 Subject: [PATCH 161/255] Sort fixtures in reference.rst alphabetically While taking a look at the docs I noticed they were not properly sorted. This just moves the sections around so they are sorted alphabetically, without any other changes. --- doc/en/reference/reference.rst | 182 +++++++++++++++++---------------- 1 file changed, 92 insertions(+), 90 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 97afdef377c..c4402ff41a0 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -333,50 +333,6 @@ For more details, consult the full :ref:`fixtures docs `. :decorator: -.. fixture:: cache - -config.cache -~~~~~~~~~~~~ - -**Tutorial**: :ref:`cache` - -The ``config.cache`` object allows other plugins and fixtures -to store and retrieve values across test runs. To access it from fixtures -request ``pytestconfig`` into your fixture and get it with ``pytestconfig.cache``. - -Under the hood, the cache plugin uses the simple -``dumps``/``loads`` API of the :py:mod:`json` stdlib module. - -``config.cache`` is an instance of :class:`pytest.Cache`: - -.. autoclass:: pytest.Cache() - :members: - - -.. fixture:: capsys - -capsys -~~~~~~ - -**Tutorial**: :ref:`captures` - -.. autofunction:: _pytest.capture.capsys() - :no-auto-options: - -.. autoclass:: pytest.CaptureFixture() - :members: - - -.. fixture:: capsysbinary - -capsysbinary -~~~~~~~~~~~~ - -**Tutorial**: :ref:`captures` - -.. autofunction:: _pytest.capture.capsysbinary() - :no-auto-options: - .. fixture:: capfd capfd @@ -387,6 +343,7 @@ capfd .. autofunction:: _pytest.capture.capfd() :no-auto-options: + .. fixture:: capfdbinary capfdbinary @@ -398,71 +355,74 @@ capfdbinary :no-auto-options: -.. fixture:: doctest_namespace - -doctest_namespace -~~~~~~~~~~~~~~~~~ - -**Tutorial**: :ref:`doctest` +.. fixture:: caplog -.. autofunction:: _pytest.doctest.doctest_namespace() +caplog +~~~~~~ +**Tutorial**: :ref:`logging` -.. fixture:: request +.. autofunction:: _pytest.logging.caplog() + :no-auto-options: -request -~~~~~~~ + Returns a :class:`pytest.LogCaptureFixture` instance. -**Example**: :ref:`request example` +.. autoclass:: pytest.LogCaptureFixture() + :members: -The ``request`` fixture is a special fixture providing information of the requesting test function. -.. autoclass:: pytest.FixtureRequest() - :members: +.. fixture:: capsys +capsys +~~~~~~ -.. fixture:: pytestconfig +**Tutorial**: :ref:`captures` -pytestconfig -~~~~~~~~~~~~ +.. autofunction:: _pytest.capture.capsys() + :no-auto-options: -.. autofunction:: _pytest.fixtures.pytestconfig() +.. autoclass:: pytest.CaptureFixture() + :members: +.. fixture:: capsysbinary -.. fixture:: record_property +capsysbinary +~~~~~~~~~~~~ -record_property -~~~~~~~~~~~~~~~~~~~ +**Tutorial**: :ref:`captures` -**Tutorial**: :ref:`record_property example` +.. autofunction:: _pytest.capture.capsysbinary() + :no-auto-options: -.. autofunction:: _pytest.junitxml.record_property() +.. fixture:: cache -.. fixture:: record_testsuite_property +config.cache +~~~~~~~~~~~~ -record_testsuite_property -~~~~~~~~~~~~~~~~~~~~~~~~~ +**Tutorial**: :ref:`cache` -**Tutorial**: :ref:`record_testsuite_property example` +The ``config.cache`` object allows other plugins and fixtures +to store and retrieve values across test runs. To access it from fixtures +request ``pytestconfig`` into your fixture and get it with ``pytestconfig.cache``. -.. autofunction:: _pytest.junitxml.record_testsuite_property() +Under the hood, the cache plugin uses the simple +``dumps``/``loads`` API of the :py:mod:`json` stdlib module. +``config.cache`` is an instance of :class:`pytest.Cache`: -.. fixture:: caplog +.. autoclass:: pytest.Cache() + :members: -caplog -~~~~~~ -**Tutorial**: :ref:`logging` +.. fixture:: doctest_namespace -.. autofunction:: _pytest.logging.caplog() - :no-auto-options: +doctest_namespace +~~~~~~~~~~~~~~~~~ - Returns a :class:`pytest.LogCaptureFixture` instance. +**Tutorial**: :ref:`doctest` -.. autoclass:: pytest.LogCaptureFixture() - :members: +.. autofunction:: _pytest.doctest.doctest_namespace() .. fixture:: monkeypatch @@ -481,6 +441,14 @@ monkeypatch :members: +.. fixture:: pytestconfig + +pytestconfig +~~~~~~~~~~~~ + +.. autofunction:: _pytest.fixtures.pytestconfig() + + .. fixture:: pytester pytester @@ -517,19 +485,25 @@ To use it, include in your topmost ``conftest.py`` file: .. autoclass:: pytest.RecordedHookCall() :members: -.. fixture:: testdir -testdir -~~~~~~~ +.. fixture:: record_property -Identical to :fixture:`pytester`, but provides an instance whose methods return -legacy ``py.path.local`` objects instead when applicable. +record_property +~~~~~~~~~~~~~~~~~~~ -New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`. +**Tutorial**: :ref:`record_property example` -.. autoclass:: pytest.Testdir() - :members: - :noindex: TimeoutExpired +.. autofunction:: _pytest.junitxml.record_property() + + +.. fixture:: record_testsuite_property + +record_testsuite_property +~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Tutorial**: :ref:`record_testsuite_property example` + +.. autofunction:: _pytest.junitxml.record_testsuite_property() .. fixture:: recwarn @@ -546,6 +520,34 @@ recwarn :members: +.. fixture:: request + +request +~~~~~~~ + +**Example**: :ref:`request example` + +The ``request`` fixture is a special fixture providing information of the requesting test function. + +.. autoclass:: pytest.FixtureRequest() + :members: + + +.. fixture:: testdir + +testdir +~~~~~~~ + +Identical to :fixture:`pytester`, but provides an instance whose methods return +legacy ``py.path.local`` objects instead when applicable. + +New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`. + +.. autoclass:: pytest.Testdir() + :members: + :noindex: TimeoutExpired + + .. fixture:: tmp_path tmp_path From 3039391b8342ffcb98b33562d00223ea27c39cfe Mon Sep 17 00:00:00 2001 From: Tatiana Ovary <109212969+toclarity@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:44:58 +0200 Subject: [PATCH 162/255] Update documentation on how pytest.warns affects DeprecationWarning #9291 (#10141) Co-authored-by: Dani Sancas On-behalf-of: @clarityai-eng Signed-off-by: Tatiana Ovary --- changelog/9291.doc.rst | 1 + doc/en/how-to/capture-warnings.rst | 42 ++++++++++++++++++++++-------- src/_pytest/recwarn.py | 22 +++++++++++----- 3 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 changelog/9291.doc.rst diff --git a/changelog/9291.doc.rst b/changelog/9291.doc.rst new file mode 100644 index 00000000000..fad8467dc90 --- /dev/null +++ b/changelog/9291.doc.rst @@ -0,0 +1 @@ +Update documentation on how :func:`pytest.warns` affects :class:`DeprecationWarning`. diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index ad5c1f3c3df..91565002ccc 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -42,6 +42,8 @@ Running pytest now produces this output: -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================= 1 passed, 1 warning in 0.12s ======================= +.. _`controlling-warnings`: + Controlling warnings -------------------- @@ -176,11 +178,14 @@ using an external system. DeprecationWarning and PendingDeprecationWarning ------------------------------------------------ - By default pytest will display ``DeprecationWarning`` and ``PendingDeprecationWarning`` warnings from user code and third-party libraries, as recommended by :pep:`565`. This helps users keep their code modern and avoid breakages when deprecated warnings are effectively removed. +However, in the specific case where users capture any type of warnings in their test, either with +:func:`pytest.warns`, :func:`pytest.deprecated_call` or using the :ref:`recwarn ` fixture, +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 those warnings. @@ -197,6 +202,9 @@ For example: This will ignore all warnings of type ``DeprecationWarning`` where the start of the message matches the regular expression ``".*U.*mode is deprecated"``. +See :ref:`@pytest.mark.filterwarnings ` and +:ref:`Controlling warnings ` for more examples. + .. note:: If warnings are configured at the interpreter level, using @@ -245,10 +253,10 @@ when called with a ``17`` argument. Asserting warnings with the warns function ------------------------------------------ - - You can check that code raises a particular warning using :func:`pytest.warns`, -which works in a similar manner to :ref:`raises `: +which works in a similar manner to :ref:`raises ` (except that +:ref:`raises ` does not capture all exceptions, only the +``expected_exception``): .. code-block:: python @@ -261,8 +269,8 @@ which works in a similar manner to :ref:`raises `: with pytest.warns(UserWarning): warnings.warn("my warning", UserWarning) -The test will fail if the warning in question is not raised. The keyword -argument ``match`` to assert that the exception matches a text or regex:: +The test will fail if the warning in question is not raised. Use the keyword +argument ``match`` to assert that the warning matches a text or regex:: >>> with warns(UserWarning, match='must be 0 or None'): ... warnings.warn("value must be 0 or None", UserWarning) @@ -359,20 +367,32 @@ Additional use cases of warnings in tests Here are some use cases involving warnings that often come up in tests, and suggestions on how to deal with them: -- To ensure that **at least one** warning is emitted, use: +- To ensure that **at least one** of the indicated warnings is issued, use: .. code-block:: python - with pytest.warns(): + def test_warning(): + with pytest.warns((RuntimeWarning, UserWarning)): + ... + +- To ensure that **only** certain warnings are issued, use: + +.. code-block:: python + + def test_warning(recwarn): ... + assert len(recwarn) == 1 + user_warning = recwarn.pop(UserWarning) + assert issubclass(user_warning.category, UserWarning) - To ensure that **no** warnings are emitted, use: .. code-block:: python - with warnings.catch_warnings(): - warnings.simplefilter("error") - ... + def test_warning(): + with warnings.catch_warnings(): + warnings.simplefilter("error") + ... - To suppress warnings, use: diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 9971bb52fb6..06eb82d7191 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -112,15 +112,15 @@ def warns( # noqa: F811 ) -> Union["WarningsChecker", Any]: r"""Assert that code raises a particular class of warning. - Specifically, the parameter ``expected_warning`` can be a warning class or - sequence of warning classes, and the code inside the ``with`` block must issue a warning of that class or - classes. + Specifically, the parameter ``expected_warning`` can be a warning class or sequence + of warning classes, and the code inside the ``with`` block must issue at least one + warning of that class or classes. - This helper produces a list of :class:`warnings.WarningMessage` objects, - one for each warning raised. + This helper produces a list of :class:`warnings.WarningMessage` objects, one for + each warning raised (regardless of whether it is an ``expected_warning`` or not). - This function can be used as a context manager, or any of the other ways - :func:`pytest.raises` can be used:: + This function can be used as a context manager, which will capture all the raised + warnings inside it:: >>> import pytest >>> with pytest.warns(RuntimeWarning): @@ -141,6 +141,14 @@ def warns( # noqa: F811 ... Failed: DID NOT WARN. No warnings of type ...UserWarning... were emitted... + **Using with** ``pytest.mark.parametrize`` + + When using :ref:`pytest.mark.parametrize ref` it is possible to parametrize tests + such that some runs raise a warning and others do not. + + This could be achieved in the same way as with exceptions, see + :ref:`parametrizing_conditional_raising` for an example. + """ __tracebackhide__ = True if not args: From 69f2855cc8896c67c499a250c2f08fcfd408f827 Mon Sep 17 00:00:00 2001 From: John Litborn <11260241+jakkdl@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:16:32 +0000 Subject: [PATCH 163/255] fallback to native traceback when handling ExceptionGroup (take 2) [SQUASH] (#10209) * Squashed commit of the following: commit 41d339c46763bbe26123e1e6504b6e32290e33e1 Author: Cheukting Date: Thu Jun 23 17:01:04 2022 +0800 test in all py versions commit b3572a5a12672228c3276fc8c8e05980dfb7888a Author: Cheukting Date: Thu Jun 23 16:41:06 2022 +0800 add test commit 7166a2a51e4f99046b028b663c193d8b558c7fd4 Author: Cheukting Date: Thu Jun 23 16:00:07 2022 +0800 update changelog commit b958c73d489157f0c0d4e46425083a5e2e2bc851 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu Jun 23 07:50:52 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit ea7f376c6ca37c40c83df0e4a1cfaaedb34bae91 Author: Cheukting Date: Thu Jun 23 15:48:21 2022 +0800 Fix MyPy commit 97469beb1da40257e9a061a5e19548546c9312c4 Author: Cheukting Date: Thu Jun 23 15:03:48 2022 +0800 fix if ExceptionGroup not exist commit 84e553642cd69b4d499231d733df91ebfa84c7ad Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu Jun 23 03:43:27 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 76bbef449b88bbd74fb5cca3b5293337a624ef03 Author: Cheukting Date: Thu Jun 23 11:40:41 2022 +0800 adding changelog commit db82bebc5a4969e2083adcd97bdfd2a63bb17d98 Author: Cheukting Date: Thu Jun 23 11:33:10 2022 +0800 fall back to native when handeling to exception groups * Typed ExceptionGroupTypes and changed to BaseExceptionGroup, fixed exceptionchain (excinfo->excinfo_, set reprcrash. Extended tests, though they're wip. * added exceptiongroup to pre-commit-config, moved away from tuple to directly defining BaseExceptionGroup, added block comment, added match line for inner exception, changked mark.skipif to importorskip to not need top-level import, changed tox.ini a bit - only uncovered should now be py37 without exceptiongroup, due to hypothesis * added py311-exceptiongroup to github CI, exceptiongroup is now a hard dependency on py<3.11, renamed bad variable names * added use_coverage to ubuntu-py311 * import BaseExceptionGroup with explicit version check instead of try/catch * removed from CI, added comments to tox and pre-commit --- .github/workflows/test.yml | 1 + .pre-commit-config.yaml | 3 ++ AUTHORS | 1 + changelog/9159.bugfix.rst | 1 + setup.cfg | 1 + src/_pytest/_code/code.py | 19 +++++++- testing/code/test_excinfo.py | 87 ++++++++++++++++++++++++++++++++++++ tox.ini | 5 +++ 8 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 changelog/9159.bugfix.rst diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c5fda16e4a..33b32a1abaa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -114,6 +114,7 @@ jobs: python: "3.11-dev" os: ubuntu-latest tox_env: "py311" + use_coverage: true - name: "ubuntu-pypy3" python: "pypy-3.7" os: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 694498b0850..72e1d8d62b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -68,6 +68,9 @@ repos: - packaging - tomli - types-pkg_resources + # for mypy running on python>=3.11 since exceptiongroup is only a dependency + # on <3.11 + - exceptiongroup>=1.0.0rc8 - repo: local hooks: - id: rst diff --git a/AUTHORS b/AUTHORS index e797f21461a..ca2872f32a4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -168,6 +168,7 @@ Jeff Rackauckas Jeff Widman Jenni Rinker John Eddie Ayson +John Litborn John Towler Jon Parise Jon Sonesen diff --git a/changelog/9159.bugfix.rst b/changelog/9159.bugfix.rst new file mode 100644 index 00000000000..5e7f0a3014d --- /dev/null +++ b/changelog/9159.bugfix.rst @@ -0,0 +1 @@ +Showing inner exceptions by forcing native display in ``ExceptionGroups`` even when using display options other than ``--tb=native``. A temporary step before full implementation of pytest-native display for inner exceptions in ``ExceptionGroups``. diff --git a/setup.cfg b/setup.cfg index 3545a9503a8..38f50556c93 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,6 +47,7 @@ install_requires = pluggy>=0.12,<2.0 py>=1.8.2 colorama;sys_platform=="win32" + exceptiongroup>=1.0.0rc8;python_version<"3.11" importlib-metadata>=0.12;python_version<"3.8" tomli>=1.0.0;python_version<"3.11" python_requires = >=3.7 diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 304a5cbd751..97985def1c3 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -56,6 +56,9 @@ _TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"] +if sys.version_info[:2] < (3, 11): + from exceptiongroup import BaseExceptionGroup + class Code: """Wrapper around Python code objects.""" @@ -924,7 +927,21 @@ def repr_excinfo( while e is not None and id(e) not in seen: seen.add(id(e)) if excinfo_: - reprtraceback = self.repr_traceback(excinfo_) + # Fall back to native traceback as a temporary workaround until + # full support for exception groups added to ExceptionInfo. + # See https://github.com/pytest-dev/pytest/issues/9159 + if isinstance(e, BaseExceptionGroup): + reprtraceback: Union[ + ReprTracebackNative, ReprTraceback + ] = ReprTracebackNative( + traceback.format_exception( + type(excinfo_.value), + excinfo_.value, + excinfo_.traceback[0]._rawentry, + ) + ) + else: + reprtraceback = self.repr_traceback(excinfo_) reprcrash: Optional[ReprFileLocation] = ( excinfo_._getreprcrash() if self.style != "value" else None ) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index af72857f3e7..e428b9c5ca9 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -1470,3 +1470,90 @@ def __getattr__(self, attr): with pytest.raises(RuntimeError) as excinfo: RecursionDepthError().trigger assert "maximum recursion" in str(excinfo.getrepr()) + + +def _exceptiongroup_common( + pytester: Pytester, + outer_chain: str, + inner_chain: str, + native: bool, +) -> None: + pre_raise = "exceptiongroup." if not native else "" + pre_catch = pre_raise if sys.version_info < (3, 11) else "" + filestr = f""" + {"import exceptiongroup" if not native else ""} + import pytest + + def f(): raise ValueError("From f()") + def g(): raise BaseException("From g()") + + def inner(inner_chain): + excs = [] + for callback in [f, g]: + try: + callback() + except BaseException as err: + excs.append(err) + if excs: + if inner_chain == "none": + raise {pre_raise}BaseExceptionGroup("Oops", excs) + try: + raise SyntaxError() + except SyntaxError as e: + if inner_chain == "from": + raise {pre_raise}BaseExceptionGroup("Oops", excs) from e + else: + raise {pre_raise}BaseExceptionGroup("Oops", excs) + + def outer(outer_chain, inner_chain): + try: + inner(inner_chain) + except {pre_catch}BaseExceptionGroup as e: + if outer_chain == "none": + raise + if outer_chain == "from": + raise IndexError() from e + else: + raise IndexError() + + + def test(): + outer("{outer_chain}", "{inner_chain}") + """ + pytester.makepyfile(test_excgroup=filestr) + result = pytester.runpytest() + match_lines = [] + if inner_chain in ("another", "from"): + match_lines.append(r"SyntaxError: ") + + match_lines += [ + r" + Exception Group Traceback (most recent call last):", + rf" \| {pre_catch}BaseExceptionGroup: Oops \(2 sub-exceptions\)", + r" \| ValueError: From f\(\)", + r" \| BaseException: From g\(\)", + r"=* short test summary info =*", + ] + if outer_chain in ("another", "from"): + match_lines.append(r"FAILED test_excgroup.py::test - IndexError") + else: + match_lines.append( + rf"FAILED test_excgroup.py::test - {pre_catch}BaseExceptionGroup: Oops \(2.*" + ) + result.stdout.re_match_lines(match_lines) + + +@pytest.mark.skipif( + sys.version_info < (3, 11), reason="Native ExceptionGroup not implemented" +) +@pytest.mark.parametrize("outer_chain", ["none", "from", "another"]) +@pytest.mark.parametrize("inner_chain", ["none", "from", "another"]) +def test_native_exceptiongroup(pytester: Pytester, outer_chain, inner_chain) -> None: + _exceptiongroup_common(pytester, outer_chain, inner_chain, native=True) + + +@pytest.mark.parametrize("outer_chain", ["none", "from", "another"]) +@pytest.mark.parametrize("inner_chain", ["none", "from", "another"]) +def test_exceptiongroup(pytester: Pytester, outer_chain, inner_chain) -> None: + # with py>=3.11 does not depend on exceptiongroup, though there is a toxenv for it + pytest.importorskip("exceptiongroup") + _exceptiongroup_common(pytester, outer_chain, inner_chain, native=False) diff --git a/tox.ini b/tox.ini index 93c390ffc57..f1ab4b815a5 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,10 @@ envlist = docs docs-checklinks + # checks that 3.11 native ExceptionGroup works with exceptiongroup + # not included in CI. + py311-exceptiongroup + [testenv] @@ -46,6 +50,7 @@ setenv = extras = testing deps = doctesting: PyYAML + exceptiongroup: exceptiongroup>=1.0.0rc8 numpy: numpy>=1.19.4 pexpect: pexpect>=4.8.0 pluggymain: pluggy @ git+https://github.com/pytest-dev/pluggy.git From 71aa1388e0d7dd2a1c073874a25c88a98ed914f8 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 19 Aug 2022 19:01:40 +0200 Subject: [PATCH 164/255] Drop `wheel` from `pyproject.toml` example It is unnecessary and has been deleted from the setuptools' docs too. The setuptools' PEP 517 build backend implementation has been auto-adding the `wheel` dependency since it's first been implemented. --- doc/en/explanation/goodpractices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 0b812ba5857..8deef9abe9c 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -17,7 +17,7 @@ Next, place a ``pyproject.toml`` file in the root of your package: .. code-block:: toml [build-system] - requires = ["setuptools>=42", "wheel"] + requires = ["setuptools >= 42"] build-backend = "setuptools.build_meta" and a ``setup.cfg`` file containing your package's metadata with the following minimum content: From 932264d8fdedc5fbdd676169078dd1acb795903a Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 21 Aug 2022 00:21:46 +0000 Subject: [PATCH 165/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 144 ++++++++++++++++++++++--------- 1 file changed, 104 insertions(+), 40 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 20d5e4c2605..5a02cc58ad8 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1100 plugins. +This list contains 1108 plugins. .. only:: not latex @@ -71,6 +71,7 @@ This list contains 1100 plugins. :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) :pypi:`pytest-assurka` A pytest plugin for Assurka Studio Aug 04, 2022 N/A N/A :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A + :pypi:`pytest-asteroid` PyTest plugin for docker-based testing on database images Aug 15, 2022 N/A pytest (>=6.2.5,<8.0.0) :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest @@ -153,6 +154,7 @@ This list contains 1100 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. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -201,12 +203,13 @@ This list contains 1100 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 13, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 17, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :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 :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) + :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 17, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A @@ -221,7 +224,7 @@ This list contains 1100 plugins. :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A :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 Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) - :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Aug 16, 2022 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-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A @@ -319,6 +322,7 @@ This list contains 1100 plugins. :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A :pypi:`pytest-easyread` pytest plugin that makes terminal printouts of the reports easier to read Nov 17, 2017 N/A N/A :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" + :pypi:`pytest-ebics-sandbox` A pytest plugin for testing against an EBICS sandbox server. Requires docker. Aug 15, 2022 N/A N/A :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -363,6 +367,7 @@ This list contains 1100 plugins. :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) :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) + :pypi:`pytest-extensions` A collection of helpers for pytest to ease testing Aug 17, 2022 4 - Beta pytest ; extra == 'testing' :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest :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-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A @@ -407,7 +412,7 @@ This list contains 1100 plugins. :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :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. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Aug 09, 2022 4 - Beta pytest (~=7.1) + :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Aug 18, 2022 4 - Beta pytest (~=7.1) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest @@ -423,6 +428,7 @@ This list contains 1100 plugins. :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A + :pypi:`pytest-fzf` fzf-based test selector for pytest Aug 17, 2022 1 - Planning pytest (>=7.1.2) :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) :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 @@ -457,7 +463,7 @@ This list contains 1100 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 13, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 19, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -510,7 +516,7 @@ This list contains 1100 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-isort` py.test plugin to check import ordering using isort Feb 08, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A :pypi:`pytest-iters` A contextmanager pytest fixture for handling multiple mock iters May 24, 2022 N/A N/A @@ -533,7 +539,7 @@ This list contains 1100 plugins. :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :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. Jul 17, 2022 3 - Alpha pytest (>=3.6,<8) + :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A @@ -548,7 +554,7 @@ This list contains 1100 plugins. :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 :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Aug 13, 2022 4 - Beta N/A + :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Aug 14, 2022 4 - Beta N/A :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) @@ -631,7 +637,7 @@ This list contains 1100 plugins. :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" - :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) + :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Aug 15, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. May 30, 2022 N/A N/A :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) @@ -668,7 +674,7 @@ This list contains 1100 plugins. :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators May 25, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Aug 17, 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) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -728,7 +734,7 @@ This list contains 1100 plugins. :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 - :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Apr 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 18, 2022 5 - Production/Stable pytest :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -819,6 +825,7 @@ This list contains 1100 plugins. :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 24, 2022 N/A pytest (>=3.8.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 :pypi:`pytest-requests-futures` Pytest Plugin to Mock Requests Futures Jul 06, 2022 5 - Production/Stable 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-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) @@ -833,7 +840,7 @@ This list contains 1100 plugins. :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 May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 11, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 16, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) @@ -861,20 +868,20 @@ This list contains 1100 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 19, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 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 25, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Aug 18, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :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 @@ -908,6 +915,7 @@ This list contains 1100 plugins. :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) + :pypi:`pytest-sofaepione` Test the installation of SOFA and the SofaEpione plugin. Aug 17, 2022 N/A N/A :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) @@ -927,7 +935,7 @@ This list contains 1100 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 26, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 19, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -980,14 +988,14 @@ This list contains 1100 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Jul 16, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Aug 17, 2022 4 - Beta N/A :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 Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Mar 11, 2022 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Aug 19, 2022 N/A pytest (>=5.5) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -997,7 +1005,7 @@ This list contains 1100 plugins. :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport-new` Aug 15, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) :pypi:`pytest-test-utils` Jul 14, 2022 N/A pytest (>=5) @@ -1494,6 +1502,13 @@ This list contains 1100 plugins. A plugin for pytest devs to view how assertion rewriting recodes the AST + :pypi:`pytest-asteroid` + *last release*: Aug 15, 2022, + *status*: N/A, + *requires*: pytest (>=6.2.5,<8.0.0) + + PyTest plugin for docker-based testing on database images + :pypi:`pytest-astropy` *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, @@ -2068,6 +2083,13 @@ This list contains 1100 plugins. A pytest fixture for changing current working directory + :pypi:`pytest-check` + *last release*: Aug 19, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + A pytest plugin that allows multiple failures per test. + :pypi:`pytest-checkdocs` *last release*: Jul 31, 2021, *status*: 5 - Production/Stable, @@ -2405,7 +2427,7 @@ This list contains 1100 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Aug 13, 2022, + *last release*: Aug 17, 2022, *status*: N/A, *requires*: N/A @@ -2446,6 +2468,13 @@ This list contains 1100 plugins. CSV output for pytest. + :pypi:`pytest-csv-params` + *last release*: Aug 17, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.2,<8.0.0) + + Pytest plugin for Test Case Parametrization with CSV files + :pypi:`pytest-curio` *last release*: Oct 07, 2020, *status*: N/A, @@ -2545,9 +2574,9 @@ This list contains 1100 plugins. pytest plugin for test data directories and files :pypi:`pytest-datadir-mgr` - *last release*: Jan 20, 2022, + *last release*: Aug 16, 2022, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: pytest (>=7.1) Manager for test data: downloads, artifact caching, and a tmpdir context. @@ -3230,6 +3259,13 @@ This list contains 1100 plugins. Pytest plugin for easy testing against servers + :pypi:`pytest-ebics-sandbox` + *last release*: Aug 15, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin for testing against an EBICS sandbox server. Requires docker. + :pypi:`pytest-ec2` *last release*: Oct 22, 2019, *status*: 3 - Alpha, @@ -3538,6 +3574,13 @@ This list contains 1100 plugins. Interactive console for pytest. + :pypi:`pytest-extensions` + *last release*: Aug 17, 2022, + *status*: 4 - Beta, + *requires*: pytest ; extra == 'testing' + + A collection of helpers for pytest to ease testing + :pypi:`pytest-external-blockers` *last release*: Oct 05, 2021, *status*: N/A, @@ -3847,7 +3890,7 @@ This list contains 1100 plugins. A set of py.test fixtures to test Flask applications. :pypi:`pytest-flask-ligand` - *last release*: Aug 09, 2022, + *last release*: Aug 18, 2022, *status*: 4 - Beta, *requires*: pytest (~=7.1) @@ -3958,6 +4001,13 @@ This list contains 1100 plugins. + :pypi:`pytest-fzf` + *last release*: Aug 17, 2022, + *status*: 1 - Planning, + *requires*: pytest (>=7.1.2) + + fzf-based test selector for pytest + :pypi:`pytest-gather-fixtures` *last release*: Apr 12, 2022, *status*: N/A, @@ -4197,7 +4247,7 @@ This list contains 1100 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 13, 2022, + *last release*: Aug 19, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4568,9 +4618,9 @@ This list contains 1100 plugins. py.test plugin to check import ordering using isort :pypi:`pytest-is-running` - *last release*: May 11, 2022, + *last release*: Aug 19, 2022, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: N/A pytest plugin providing a function to check if pytest is running. @@ -4729,7 +4779,7 @@ This list contains 1100 plugins. Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks :pypi:`pytest-lambda` - *last release*: Jul 17, 2022, + *last release*: Aug 20, 2022, *status*: 3 - Alpha, *requires*: pytest (>=3.6,<8) @@ -4834,7 +4884,7 @@ This list contains 1100 plugins. Profile code executed by pytest :pypi:`pytest-line-profiler-apn` - *last release*: Aug 13, 2022, + *last release*: Aug 14, 2022, *status*: 4 - Beta, *requires*: N/A @@ -5415,8 +5465,8 @@ This list contains 1100 plugins. Mypy static type checker plugin for Pytest :pypi:`pytest-mypy-plugins` - *last release*: Jan 11, 2022, - *status*: 3 - Alpha, + *last release*: Aug 15, 2022, + *status*: 4 - Beta, *requires*: pytest (>=6.0.0) pytest plugin for writing tests for mypy plugins @@ -5674,7 +5724,7 @@ This list contains 1100 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: May 25, 2022, + *last release*: Aug 17, 2022, *status*: N/A, *requires*: pytest @@ -6094,7 +6144,7 @@ This list contains 1100 plugins. Visualize your failed tests with poo :pypi:`pytest-pop` - *last release*: Apr 20, 2022, + *last release*: Aug 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6730,6 +6780,13 @@ This list contains 1100 plugins. A simple plugin to use with pytest + :pypi:`pytest-requestselapsed` + *last release*: Aug 14, 2022, + *status*: N/A, + *requires*: N/A + + collect and show http requests elapsed time + :pypi:`pytest-requests-futures` *last release*: Jul 06, 2022, *status*: 5 - Production/Stable, @@ -6829,7 +6886,7 @@ This list contains 1100 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-retry` - *last release*: Aug 11, 2022, + *last release*: Aug 16, 2022, *status*: N/A, *requires*: pytest (>=7.0.0) @@ -7025,7 +7082,7 @@ This list contains 1100 plugins. :pypi:`pytest-sbase` - *last release*: Aug 05, 2022, + *last release*: Aug 19, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7067,7 +7124,7 @@ This list contains 1100 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Aug 05, 2022, + *last release*: Aug 19, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7116,7 +7173,7 @@ This list contains 1100 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 25, 2022, + *last release*: Aug 18, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7353,6 +7410,13 @@ This list contains 1100 plugins. Pytest Plugin to disable socket calls during tests + :pypi:`pytest-sofaepione` + *last release*: Aug 17, 2022, + *status*: N/A, + *requires*: N/A + + Test the installation of SOFA and the SofaEpione plugin. + :pypi:`pytest-soft-assertions` *last release*: May 05, 2020, *status*: 3 - Alpha, @@ -7487,7 +7551,7 @@ This list contains 1100 plugins. :pypi:`pytest-splunk-addon` - *last release*: May 26, 2022, + *last release*: Aug 19, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7858,7 +7922,7 @@ This list contains 1100 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Jul 16, 2022, + *last release*: Aug 17, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7907,7 +7971,7 @@ This list contains 1100 plugins. A small example package :pypi:`pytest-testrail-api` - *last release*: Mar 11, 2022, + *last release*: Aug 19, 2022, *status*: N/A, *requires*: pytest (>=5.5) @@ -7977,7 +8041,7 @@ This list contains 1100 plugins. :pypi:`pytest-testreport-new` - *last release*: May 05, 2022, + *last release*: Aug 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) From 42776c0949b4f6245f1df447108a49b9ec8b1363 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 20:19:44 -0300 Subject: [PATCH 166/255] [pre-commit.ci] pre-commit autoupdate (#10178) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/PyCQA/flake8: 4.0.1 → 5.0.4](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.4) - [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3) - [github.com/asottile/setup-cfg-fmt: v1.20.2 → v2.0.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.2...v2.0.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Configure setup-cfg-fmt to include version specifiers * Update .pre-commit-config.yaml * [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: Bruno Oliveira --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 72e1d8d62b1..db679bdbce2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: language: python files: \.py$ - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 5.0.4 hooks: - id: flake8 language_version: python3 @@ -42,15 +42,15 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.2 + rev: v2.37.3 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.2 + rev: v2.0.0 hooks: - id: setup-cfg-fmt - args: [--max-py-version=3.10] + args: ["--max-py-version=3.10", "--include-version-classifiers"] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 hooks: From adaa463ee31bbdb17a348d680a58d6373dcc4a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Kalm=C3=A1r?= Date: Fri, 26 Aug 2022 14:46:47 +0200 Subject: [PATCH 167/255] Ignore editable installation modules (#10231) Fixes #10230 --- changelog/10230.bugfix.rst | 1 + src/_pytest/config/__init__.py | 3 ++- testing/test_config.py | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelog/10230.bugfix.rst diff --git a/changelog/10230.bugfix.rst b/changelog/10230.bugfix.rst new file mode 100644 index 00000000000..6ca2b00bf89 --- /dev/null +++ b/changelog/10230.bugfix.rst @@ -0,0 +1 @@ +Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 `__. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index b3173d7d736..d753a9054ab 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -836,7 +836,8 @@ def _iter_rewritable_modules(package_files: Iterable[str]) -> Iterator[str]: if is_simple_module: module_name, _ = os.path.splitext(fn) # we ignore "setup.py" at the root of the distribution - if module_name != "setup": + # as well as editable installation finder modules made by setuptools + if module_name != "setup" and not module_name.startswith("__editable__"): seen_some = True yield module_name elif is_package: diff --git a/testing/test_config.py b/testing/test_config.py index c2e3fe5bbcf..f5b6d7f9816 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -842,6 +842,9 @@ def test_confcutdir_check_isdir(self, pytester: Pytester) -> None: (["src/bar/__init__.py"], ["bar"]), (["src/bar/__init__.py", "setup.py"], ["bar"]), (["source/python/bar/__init__.py", "setup.py"], ["bar"]), + # editable installation finder modules + (["__editable___xyz_finder.py"], []), + (["bar/__init__.py", "__editable___xyz_finder.py"], ["bar"]), ], ) def test_iter_rewritable_modules(self, names, expected) -> None: From 0fc3a977a9f60b09aec032f77e16a320dbe1d271 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:49:38 -0300 Subject: [PATCH 168/255] [automated] Update plugin list (#10253) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 124 +++++++++++++++++-------------- 1 file changed, 70 insertions(+), 54 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 5a02cc58ad8..9eafdfe7665 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1108 plugins. +This list contains 1110 plugins. .. only:: not latex @@ -154,7 +154,7 @@ This list contains 1108 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. Aug 19, 2022 5 - Production/Stable N/A + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Aug 25, 2022 5 - Production/Stable N/A :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -202,14 +202,15 @@ This list contains 1108 plugins. :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Aug 22, 2022 5 - Production/Stable pytest (>=7.0) :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 17, 2022 N/A N/A + :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :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 :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) - :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 17, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 25, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A @@ -330,14 +331,14 @@ This list contains 1108 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Aug 04, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Aug 04, 2022 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embedded` pytest embedded plugin Aug 23, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Aug 23, 2022 N/A N/A + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Aug 27, 2022 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 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -436,7 +437,7 @@ This list contains 1108 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 28, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 23, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :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-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -463,7 +464,7 @@ This list contains 1108 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 19, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 26, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -523,7 +524,7 @@ This list contains 1108 plugins. :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 05, 2022 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 25, 2022 4 - Beta pytest :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) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -592,7 +593,7 @@ This list contains 1108 plugins. :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 make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :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 May 27, 2022 N/A N/A + :pypi:`pytest-memray` A simple plugin to use with pytest Aug 21, 2022 N/A N/A :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-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) @@ -611,7 +612,7 @@ This list contains 1108 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. Aug 12, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Aug 24, 2022 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-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -628,7 +629,7 @@ This list contains 1108 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 01, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 26, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -650,7 +651,7 @@ This list contains 1108 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 10, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 23, 2022 N/A pytest (==6.2.5) :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 Jul 07, 2021 N/A N/A @@ -862,26 +863,26 @@ This list contains 1108 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). May 10, 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 Jul 14, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Aug 25, 2022 4 - Beta pytest (>=6.0.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-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 19, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 27, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 19, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 27, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 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 Aug 18, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Aug 22, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :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 @@ -935,7 +936,7 @@ This list contains 1108 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 Aug 19, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 23, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -988,7 +989,7 @@ This list contains 1108 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Aug 17, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Aug 27, 2022 4 - Beta N/A :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 Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1027,6 +1028,7 @@ This list contains 1108 plugins. :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest + :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 26, 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-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 @@ -1049,7 +1051,7 @@ This list contains 1108 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :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) for Pytest, with optional auto-launch and HTML export Aug 13, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Aug 27, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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) @@ -1074,7 +1076,7 @@ This list contains 1108 plugins. :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Jul 20, 2022 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Report Aug 21, 2022 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :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 May 28, 2019 5 - Production/Stable pytest @@ -2084,7 +2086,7 @@ This list contains 1108 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Aug 19, 2022, + *last release*: Aug 25, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2420,9 +2422,9 @@ This list contains 1108 plugins. Pytest plugin for excluding tests based on coverage data :pypi:`pytest-cpp` - *last release*: Mar 18, 2022, + *last release*: Aug 22, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (!=5.4.0,!=5.4.1) + *requires*: pytest (>=7.0) Use pytest's runner to discover and execute C++ tests @@ -2433,6 +2435,13 @@ This list contains 1108 plugins. A pytest plugin that imports CPPython testing types + :pypi:`pytest-cqase` + *last release*: Aug 22, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + Custom qase pytest plugin + :pypi:`pytest-cram` *last release*: Aug 08, 2020, *status*: N/A, @@ -2469,7 +2478,7 @@ This list contains 1108 plugins. CSV output for pytest. :pypi:`pytest-csv-params` - *last release*: Aug 17, 2022, + *last release*: Aug 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.2,<8.0.0) @@ -3316,56 +3325,56 @@ This list contains 1108 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Jul 05, 2022, + *last release*: Aug 27, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -4058,7 +4067,7 @@ This list contains 1108 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Jul 28, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A @@ -4247,7 +4256,7 @@ This list contains 1108 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 19, 2022, + *last release*: Aug 26, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4667,7 +4676,7 @@ This list contains 1108 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Aug 05, 2022, + *last release*: Aug 25, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5150,7 +5159,7 @@ This list contains 1108 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: May 27, 2022, + *last release*: Aug 21, 2022, *status*: N/A, *requires*: N/A @@ -5283,7 +5292,7 @@ This list contains 1108 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*: Aug 12, 2022, + *last release*: Aug 24, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5402,7 +5411,7 @@ This list contains 1108 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Aug 01, 2022, + *last release*: Aug 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5556,7 +5565,7 @@ This list contains 1108 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Aug 10, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -7040,7 +7049,7 @@ This list contains 1108 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Jul 14, 2022, + *last release*: Aug 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7082,7 +7091,7 @@ This list contains 1108 plugins. :pypi:`pytest-sbase` - *last release*: Aug 19, 2022, + *last release*: Aug 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7124,7 +7133,7 @@ This list contains 1108 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Aug 19, 2022, + *last release*: Aug 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7173,7 +7182,7 @@ This list contains 1108 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Aug 18, 2022, + *last release*: Aug 22, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7551,7 +7560,7 @@ This list contains 1108 plugins. :pypi:`pytest-splunk-addon` - *last release*: Aug 19, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7922,7 +7931,7 @@ This list contains 1108 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Aug 17, 2022, + *last release*: Aug 27, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8194,6 +8203,13 @@ This list contains 1108 plugins. Utilities to create temporary file hierarchies in pytest. + :pypi:`pytest-tmpfs` + *last release*: Aug 26, 2022, + *status*: N/A, + *requires*: pytest + + A pytest plugin that helps you on using a temporary filesystem for testing. + :pypi:`pytest-tmreport` *last release*: Aug 12, 2022, *status*: N/A, @@ -8349,7 +8365,7 @@ This list contains 1108 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Aug 13, 2022, + *last release*: Aug 27, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) @@ -8524,7 +8540,7 @@ This list contains 1108 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Jul 20, 2022, + *last release*: Aug 21, 2022, *status*: 2 - Pre-Alpha, *requires*: N/A From 4b77638ba88f6dc7bf1125deeb8e4d4bfd795ad5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 07:11:58 -0300 Subject: [PATCH 169/255] [pre-commit.ci] pre-commit autoupdate (#10256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/myint/autoflake: v1.4 → v1.5.1](https://github.com/myint/autoflake/compare/v1.4...v1.5.1) 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 db679bdbce2..68357b127ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/myint/autoflake - rev: v1.4 + rev: v1.5.1 hooks: - id: autoflake name: autoflake From 1caa099e42739bf96ef007297895dffda8c07e60 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 26 Aug 2022 14:12:08 -0300 Subject: [PATCH 170/255] Fix regendoc The finalizers example was wiping out code needed for the examples below. --- doc/en/how-to/fixtures.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 8ab498bd7d4..9ace480b553 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -744,10 +744,10 @@ Note on finalizer order Finalizers are executed in a first-in-last-out order. For yield fixtures, the first teardown code to run is from the right-most fixture, i.e. the last test parameter. -.. regendoc:wipe .. code-block:: python + # content of test_finalizers.py import pytest @@ -769,12 +769,12 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur .. code-block:: pytest - $ pytest test_module.py + $ pytest -s test_finalizers.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y collected 1 item - test_module.py test_bar + test_finalizers.py test_bar .after_yield_2 after_yield_1 @@ -784,6 +784,8 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`. .. code-block:: python + # content of test_finalizers.py + from functools import partial import pytest @@ -799,12 +801,12 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`. .. code-block:: pytest - $ pytest test_module.py + $ pytest -s test_finalizers.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y collected 1 item - test_module.py test_bar + test_finalizers.py test_bar .finalizer_1 finalizer_2 @@ -1416,6 +1418,8 @@ Running the above tests results in the following test IDs being used: + + From 245a8c23dd0ffeb03710f0fbabd1f5e6a56611ab Mon Sep 17 00:00:00 2001 From: Philipp A Date: Thu, 1 Sep 2022 12:55:41 +0200 Subject: [PATCH 171/255] Revamp good practices (#10206) * Recommend importlib import mode for new projects * Recommend src layout more strongly * Switch to hatchling as the packaging tool in the example (following PyPA) * Add explanation about the different import modes --- doc/en/conf.py | 1 + doc/en/explanation/goodpractices.rst | 168 +++++++++++++-------------- doc/en/how-to/fixtures.rst | 14 +-- 3 files changed, 82 insertions(+), 101 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index b0c158e5a21..5184ee7b1e5 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -393,6 +393,7 @@ "tox": ("https://tox.wiki/en/stable", None), "virtualenv": ("https://virtualenv.pypa.io/en/stable", None), "setuptools": ("https://setuptools.pypa.io/en/stable", None), + "packaging": ("https://packaging.python.org/en/latest", None), } diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 8deef9abe9c..0280f14342f 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -12,41 +12,26 @@ For development, we recommend you use :mod:`venv` for virtual environments and as well as the ``pytest`` package itself. This ensures your code and dependencies are isolated from your system Python installation. -Next, place a ``pyproject.toml`` file in the root of your package: +Create a ``pyproject.toml`` file in the root of your repository as described in +:doc:`packaging:tutorials/packaging-projects`. +The first few lines should look like this: .. code-block:: toml [build-system] - requires = ["setuptools >= 42"] - build-backend = "setuptools.build_meta" - -and a ``setup.cfg`` file containing your package's metadata with the following minimum content: - -.. code-block:: ini + requires = ["hatchling"] + build-backend = "hatchling.build" [metadata] - name = PACKAGENAME - - [options] - packages = find: + name = "PACKAGENAME" where ``PACKAGENAME`` is the name of your package. -.. note:: - - If your pip version is older than ``21.3``, you'll also need a ``setup.py`` file: - - .. code-block:: python - - from setuptools import setup - - setup() - You can then install your package in "editable" mode by running from the same directory: .. code-block:: bash - pip install -e . + pip install -e . which lets you change your source code (both tests and application) and rerun tests at will. @@ -89,11 +74,11 @@ to keep tests separate from actual application code (often a good idea): .. code-block:: text pyproject.toml - setup.cfg - mypkg/ - __init__.py - app.py - view.py + src/ + mypkg/ + __init__.py + app.py + view.py tests/ test_app.py test_view.py @@ -112,72 +97,28 @@ This has the following benefits: See :ref:`pytest vs python -m pytest` for more information about the difference between calling ``pytest`` and ``python -m pytest``. -Note that this scheme has a drawback if you are using ``prepend`` :ref:`import mode ` -(which is the default): your test files must have **unique names**, because -``pytest`` will import them as *top-level* modules since there are no packages -to derive a full package name from. In other words, the test files in the example above will -be imported as ``test_app`` and ``test_view`` top-level modules by adding ``tests/`` to -``sys.path``. +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``: -If you need to have test modules with the same name, you might add ``__init__.py`` files to your -``tests`` folder and subfolders, changing them to packages: - -.. code-block:: text +.. code-block:: toml - pyproject.toml - setup.cfg - mypkg/ - ... - tests/ - __init__.py - foo/ - __init__.py - test_view.py - bar/ - __init__.py - test_view.py + [tool.pytest.ini_options] + addopts = [ + "--import-mode=importlib", + ] -Now pytest will load the modules as ``tests.foo.test_view`` and ``tests.bar.test_view``, allowing -you to have modules with the same name. But now this introduces a subtle problem: in order to load -the test modules from the ``tests`` directory, pytest prepends the root of the repository to -``sys.path``, which adds the side-effect that now ``mypkg`` is also importable. +.. _src-layout: -This is problematic if you are using a tool like `tox`_ to test your package in a virtual environment, -because you want to test the *installed* version of your package, not the local code from the repository. +Generally, but especially if you use the default import mode ``prepend``, +it is **strongly** suggested to use a ``src`` layout. +Here, your application root package resides in a sub-directory of your root, +i.e. ``src/mypkg/`` instead of ``mypkg``. -.. _`src-layout`: +This layout prevents a lot of common pitfalls and has many benefits, +which are better explained in this excellent `blog post`_ by Ionel Cristian Mărieș. -In this situation, it is **strongly** suggested to use a ``src`` layout where application root package resides in a -sub-directory of your root: - -.. code-block:: text - - pyproject.toml - setup.cfg - src/ - mypkg/ - __init__.py - app.py - view.py - tests/ - __init__.py - foo/ - __init__.py - test_view.py - bar/ - __init__.py - test_view.py - - -This layout prevents a lot of common pitfalls and has many benefits, which are better explained in this excellent -`blog post by Ionel Cristian Mărieș `_. - -.. note:: - The ``--import-mode=importlib`` option (see :ref:`import-modes`) does not have - any of the drawbacks above because ``sys.path`` is not changed when importing - test modules, so users that run into this issue are strongly encouraged to try it. - - The ``src`` directory layout is still strongly recommended however. +.. _blog post: https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure> Tests as part of application code @@ -190,8 +131,7 @@ want to distribute them along with your application: .. code-block:: text pyproject.toml - setup.cfg - mypkg/ + [src/]mypkg/ __init__.py app.py view.py @@ -253,6 +193,56 @@ Note that this layout also works in conjunction with the ``src`` layout mentione much less surprising. +.. _which-import-mode: + +Choosing an import mode +^^^^^^^^^^^^^^^^^^^^^^^ + +For historical reasons, pytest defaults to the ``prepend`` :ref:`import mode ` +instead of the ``importlib`` import mode we recommend for new projects. +The reason lies in the way the ``prepend`` mode works: + +Since there are no packages to derive a full package name from, +``pytest`` will import your test files as *top-level* modules. +The test files in the first example (:ref:`src layout `) would be imported as +``test_app`` and ``test_view`` top-level modules by adding ``tests/`` to ``sys.path``. + +This results in a drawback compared to the import mode ``importlib``: +your test files must have **unique names**. + +If you need to have test modules with the same name, +as a workaround you might add ``__init__.py`` files to your ``tests`` folder and subfolders, +changing them to packages: + +.. code-block:: text + + pyproject.toml + mypkg/ + ... + tests/ + __init__.py + foo/ + __init__.py + test_view.py + bar/ + __init__.py + test_view.py + +Now pytest will load the modules as ``tests.foo.test_view`` and ``tests.bar.test_view``, +allowing you to have modules with the same name. +But now this introduces a subtle problem: +in order to load the test modules from the ``tests`` directory, +pytest prepends the root of the repository to ``sys.path``, +which adds the side-effect that now ``mypkg`` is also importable. + +This is problematic if you are using a tool like tox_ to test your package in a virtual environment, +because you want to test the *installed* version of your package, +not the local code from the repository. + +The ``importlib`` import mode does not have any of the drawbacks above, +because ``sys.path`` is not changed when importing test modules. + + .. _`buildout`: http://www.buildout.org/en/latest/ .. _`use tox`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 9ace480b553..c63a1c3c5b1 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -1766,8 +1766,6 @@ Given the tests file structure is: :: tests/ - __init__.py - conftest.py # content of tests/conftest.py import pytest @@ -1782,8 +1780,6 @@ Given the tests file structure is: assert username == 'username' subfolder/ - __init__.py - conftest.py # content of tests/subfolder/conftest.py import pytest @@ -1792,8 +1788,8 @@ Given the tests file structure is: def username(username): return 'overridden-' + username - test_something.py - # content of tests/subfolder/test_something.py + test_something_else.py + # content of tests/subfolder/test_something_else.py def test_username(username): assert username == 'overridden-username' @@ -1809,8 +1805,6 @@ Given the tests file structure is: :: tests/ - __init__.py - conftest.py # content of tests/conftest.py import pytest @@ -1852,8 +1846,6 @@ Given the tests file structure is: :: tests/ - __init__.py - conftest.py # content of tests/conftest.py import pytest @@ -1890,8 +1882,6 @@ Given the tests file structure is: :: tests/ - __init__.py - conftest.py # content of tests/conftest.py import pytest From 7f4b63b143c11a93b3fb276297a4fe078e2607b8 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 2 Sep 2022 08:23:39 -0300 Subject: [PATCH 172/255] Merge pull request #10259 from pytest-dev/release-7.1.3 Prepare release 7.1.3 (cherry picked from commit 3739e6cd4830cf707dff3fb5c5b93d7a2cec3663) --- changelog/10060.bugfix.rst | 1 - changelog/10114.trivial.rst | 1 - changelog/10190.bugfix.rst | 1 - changelog/10230.bugfix.rst | 1 - changelog/3396.bugfix.rst | 1 - changelog/9514.bugfix.rst | 1 - changelog/9791.bugfix.rst | 1 - changelog/9917.bugfix.rst | 1 - changelog/9937.doc.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.1.3.rst | 28 ++++++++ doc/en/builtin.rst | 102 ++++++++++++++++++++++++------ doc/en/changelog.rst | 41 ++++++++++++ doc/en/getting-started.rst | 2 +- doc/en/how-to/fixtures.rst | 14 ++-- 15 files changed, 164 insertions(+), 33 deletions(-) delete mode 100644 changelog/10060.bugfix.rst delete mode 100644 changelog/10114.trivial.rst delete mode 100644 changelog/10190.bugfix.rst delete mode 100644 changelog/10230.bugfix.rst delete mode 100644 changelog/3396.bugfix.rst delete mode 100644 changelog/9514.bugfix.rst delete mode 100644 changelog/9791.bugfix.rst delete mode 100644 changelog/9917.bugfix.rst delete mode 100644 changelog/9937.doc.rst create mode 100644 doc/en/announce/release-7.1.3.rst diff --git a/changelog/10060.bugfix.rst b/changelog/10060.bugfix.rst deleted file mode 100644 index c8941820eca..00000000000 --- a/changelog/10060.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``. diff --git a/changelog/10114.trivial.rst b/changelog/10114.trivial.rst deleted file mode 100644 index 42c43a1d0d6..00000000000 --- a/changelog/10114.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Replace `atomicwrites `__ dependency on windows with `os.replace`. diff --git a/changelog/10190.bugfix.rst b/changelog/10190.bugfix.rst deleted file mode 100644 index 731d0efad9a..00000000000 --- a/changelog/10190.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports. diff --git a/changelog/10230.bugfix.rst b/changelog/10230.bugfix.rst deleted file mode 100644 index 6ca2b00bf89..00000000000 --- a/changelog/10230.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 `__. diff --git a/changelog/3396.bugfix.rst b/changelog/3396.bugfix.rst deleted file mode 100644 index aa3f278c2a6..00000000000 --- a/changelog/3396.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Doctests now respect the ``--import-mode`` flag. diff --git a/changelog/9514.bugfix.rst b/changelog/9514.bugfix.rst deleted file mode 100644 index a940b5c72d5..00000000000 --- a/changelog/9514.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed. diff --git a/changelog/9791.bugfix.rst b/changelog/9791.bugfix.rst deleted file mode 100644 index f81c870165b..00000000000 --- a/changelog/9791.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems. diff --git a/changelog/9917.bugfix.rst b/changelog/9917.bugfix.rst deleted file mode 100644 index ac0616d2ee7..00000000000 --- a/changelog/9917.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed string representation for :func:`pytest.approx` when used to compare tuples. diff --git a/changelog/9937.doc.rst b/changelog/9937.doc.rst deleted file mode 100644 index 326d20ec8f6..00000000000 --- a/changelog/9937.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index bcc0b45664b..142425cdee7 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.1.3 release-7.1.2 release-7.1.1 release-7.1.0 diff --git a/doc/en/announce/release-7.1.3.rst b/doc/en/announce/release-7.1.3.rst new file mode 100644 index 00000000000..4cb1b271704 --- /dev/null +++ b/doc/en/announce/release-7.1.3.rst @@ -0,0 +1,28 @@ +pytest-7.1.3 +======================================= + +pytest 7.1.3 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Anthony Sottile +* Bruno Oliveira +* Gergely Kalmár +* Nipunn Koorapati +* Pax +* Sviatoslav Sydorenko +* Tim Hoffmann +* Tony Narlock +* Wolfremium +* Zach OBrien +* aizpurua23a + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 77ae5a13028..7e22002245d 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -40,32 +40,86 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``text`` objects. - capsysbinary -- .../_pytest/capture.py:895 + 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" + + capsysbinary -- .../_pytest/capture.py:906 Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``bytes`` objects. - capfd -- .../_pytest/capture.py:912 + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_output(capsysbinary): + print("hello") + captured = capsysbinary.readouterr() + assert captured.out == b"hello\n" + + capfd -- .../_pytest/capture.py:934 Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``text`` objects. - capfdbinary -- .../_pytest/capture.py:929 + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfd): + os.system('echo "hello"') + captured = capfd.readouterr() + assert captured.out == "hello\n" + + capfdbinary -- .../_pytest/capture.py:962 Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``byte`` objects. - doctest_namespace [session scope] -- .../_pytest/doctest.py:731 + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfdbinary): + os.system('echo "hello"') + captured = capfdbinary.readouterr() + assert captured.out == b"hello\n" + + doctest_namespace [session scope] -- .../_pytest/doctest.py:735 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. - pytestconfig [session scope] -- .../_pytest/fixtures.py:1334 + Usually this fixture is used in conjunction with another ``autouse`` fixture: + + .. code-block:: python + + @pytest.fixture(autouse=True) + def add_np(doctest_namespace): + doctest_namespace["np"] = numpy + + For more details: :ref:`doctest_namespace`. + + pytestconfig [session scope] -- .../_pytest/fixtures.py:1344 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -117,10 +171,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a `pytest-xdist `__ plugin. See :issue:`7767` for details. - tmpdir_factory [session scope] -- .../_pytest/legacypath.py:295 + tmpdir_factory [session scope] -- .../_pytest/legacypath.py:302 Return a :class:`pytest.TempdirFactory` instance for the test session. - tmpdir -- .../_pytest/legacypath.py:302 + tmpdir -- .../_pytest/legacypath.py:309 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. @@ -132,6 +186,11 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a The returned object is a `legacy_path`_ object. + .. note:: + These days, it is preferred to use ``tmp_path``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + .. _legacy_path: https://py.readthedocs.io/en/latest/path.html caplog -- .../_pytest/logging.py:487 @@ -148,21 +207,26 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a monkeypatch -- .../_pytest/monkeypatch.py:29 A convenient fixture for monkey-patching. - The fixture provides these methods to modify objects, dictionaries or - os.environ:: + The fixture provides these methods to modify objects, dictionaries, or + :data:`os.environ`: - monkeypatch.setattr(obj, name, value, raising=True) - monkeypatch.delattr(obj, name, raising=True) - monkeypatch.setitem(mapping, name, value) - monkeypatch.delitem(obj, name, raising=True) - monkeypatch.setenv(name, value, prepend=None) - monkeypatch.delenv(name, raising=True) - monkeypatch.syspath_prepend(path) - monkeypatch.chdir(path) + * :meth:`monkeypatch.setattr(obj, name, value, raising=True) ` + * :meth:`monkeypatch.delattr(obj, name, raising=True) ` + * :meth:`monkeypatch.setitem(mapping, name, value) ` + * :meth:`monkeypatch.delitem(obj, name, raising=True) ` + * :meth:`monkeypatch.setenv(name, value, prepend=None) ` + * :meth:`monkeypatch.delenv(name, raising=True) ` + * :meth:`monkeypatch.syspath_prepend(path) ` + * :meth:`monkeypatch.chdir(path) ` + * :meth:`monkeypatch.context() ` All modifications will be undone after the requesting test function or - fixture has finished. The ``raising`` parameter determines if a KeyError - or AttributeError will be raised if the set/deletion operation has no target. + fixture has finished. The ``raising`` parameter determines if a :class:`KeyError` + or :class:`AttributeError` will be raised if the set/deletion operation does not have the + specified target. + + To undo modifications done by the fixture in a contained scope, + use :meth:`context() `. recwarn -- .../_pytest/recwarn.py:29 Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 01c6d6983a2..e60b08c555e 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,47 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.1.3 (2022-08-31) +========================= + +Bug Fixes +--------- + +- `#10060 `_: When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``. + + +- `#10190 `_: Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports. + + +- `#10230 `_: Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 `__. + + +- `#3396 `_: Doctests now respect the ``--import-mode`` flag. + + +- `#9514 `_: Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed. + + +- `#9791 `_: Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems. + + +- `#9917 `_: Fixed string representation for :func:`pytest.approx` when used to compare tuples. + + + +Improved Documentation +---------------------- + +- `#9937 `_: Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`. + + + +Trivial/Internal Changes +------------------------ + +- `#10114 `_: Replace `atomicwrites `__ dependency on windows with `os.replace`. + + pytest 7.1.2 (2022-04-23) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index f7e03cc8b67..ce8ce815260 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 7.1.2 + pytest 7.1.3 .. _`simpletest`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index c63a1c3c5b1..3acf39d0fa0 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -735,8 +735,8 @@ does offer some nuances for when you're in a pinch. .. code-block:: pytest $ pytest -q test_emaillib.py - . [100%] - 1 passed in 0.12s + . [100%] + 1 passed in 0.12s Note on finalizer order """""""""""""""""""""""" @@ -772,6 +772,7 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur $ pytest -s test_finalizers.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + rootdir: /home/sweet/project collected 1 item test_finalizers.py test_bar @@ -779,6 +780,7 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur after_yield_1 + ============================ 1 passed in 0.12s ============================= For finalizers, the first fixture to run is last call to `request.addfinalizer`. @@ -804,12 +806,16 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`. $ pytest -s test_finalizers.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + rootdir: /home/sweet/project collected 1 item test_finalizers.py test_bar .finalizer_1 finalizer_2 + + ============================ 1 passed in 0.12s ============================= + This is so because yield fixtures use `addfinalizer` behind the scenes: when the fixture executes, `addfinalizer` registers a function that resumes the generator, which in turn calls the teardown code. @@ -1411,7 +1417,7 @@ Running the above tests results in the following test IDs being used: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project - collected 11 items + collected 12 items @@ -1431,7 +1437,7 @@ Running the above tests results in the following test IDs being used: - ======================= 11 tests collected in 0.12s ======================== + ======================= 12 tests collected in 0.12s ======================== .. _`fixture-parametrize-marks`: From 50f390f015fce3ad2622b81e323f3c6f14ca872f Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 4 Sep 2022 00:23:26 +0000 Subject: [PATCH 173/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 116 ++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 42 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 9eafdfe7665..33a80b3a8bd 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1110 plugins. +This list contains 1114 plugins. .. only:: not latex @@ -56,6 +56,7 @@ This list contains 1110 plugins. :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A 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-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-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 @@ -173,6 +174,7 @@ This list contains 1110 plugins. :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) :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-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) :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 @@ -210,7 +212,7 @@ This list contains 1110 plugins. :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 :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) - :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 25, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 28, 2022 5 - Production/Stable pytest (>=7.1.2,<8.0.0) :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A @@ -328,7 +330,7 @@ This list contains 1110 plugins. :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) :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. Apr 05, 2022 1 - Planning pytest (>=5.4.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 Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest :pypi:`pytest-embedded` pytest embedded plugin Aug 23, 2022 N/A pytest (>=7.0) @@ -464,7 +466,7 @@ This list contains 1110 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 26, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 03, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -476,6 +478,7 @@ This list contains 1110 plugins. :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 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 + :pypi:`pytest-html-report-merger` Aug 31, 2022 N/A N/A :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 Dec 05, 2019 N/A N/A :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' @@ -490,7 +493,7 @@ This list contains 1110 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A :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 Jun 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Aug 31, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest @@ -561,7 +564,7 @@ This list contains 1110 plugins. :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest - :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A + :pypi:`pytest-localserver` pytest plugin to test server connections locally. Aug 30, 2022 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 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 Oct 29, 2021 N/A pytest (>=5.4) @@ -578,7 +581,7 @@ This list contains 1110 plugins. :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha N/A :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-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A + :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Sep 02, 2022 N/A N/A :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A @@ -629,7 +632,7 @@ This list contains 1110 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 26, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 30, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -748,7 +751,7 @@ This list contains 1110 plugins. :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A :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 May 05, 2022 5 - Production/Stable pytest + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Sep 01, 2022 5 - Production/Stable pytest :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) @@ -760,7 +763,8 @@ This list contains 1110 plugins. :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 Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Aug 10, 2022 N/A pytest + :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" Sep 02, 2022 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) @@ -793,7 +797,7 @@ This list contains 1110 plugins. :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 Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable 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. May 16, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 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 @@ -869,13 +873,13 @@ This list contains 1110 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 02, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -936,7 +940,7 @@ This list contains 1110 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 Aug 23, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 31, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -978,8 +982,8 @@ This list contains 1110 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terra-fixt` Terraform fixtures for pytest Jun 18, 2022 N/A pytest (==6.2.5) - :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 N/A pytest (>=6.0) + :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 02, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 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-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) @@ -996,7 +1000,7 @@ This list contains 1110 plugins. :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Aug 19, 2022 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Aug 29, 2022 N/A pytest (>=5.5) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -1028,7 +1032,7 @@ This list contains 1110 plugins. :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest - :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 26, 2022 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-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 @@ -1087,7 +1091,7 @@ This list contains 1110 plugins. :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-wake` Jul 22, 2022 N/A pytest + :pypi:`pytest-wake` Aug 30, 2022 N/A pytest :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A @@ -1109,7 +1113,7 @@ This list contains 1110 plugins. :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 04, 2022 N/A N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. May 24, 2022 4 - Beta pytest (>=2.8) + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Aug 29, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) @@ -1399,6 +1403,13 @@ This list contains 1110 plugins. An ASGI middleware to populate OpenAPI Specification examples from pytest functions + :pypi:`pytest-api-soup` + *last release*: Aug 27, 2022, + *status*: N/A, + *requires*: N/A + + Validate multiple endpoints with unit testing using a single source of truth. + :pypi:`pytest-apistellar` *last release*: Jun 18, 2019, *status*: N/A, @@ -2218,6 +2229,13 @@ This list contains 1110 plugins. pytest plugin for testing cloudflare workers + :pypi:`pytest-cloudist` + *last release*: Sep 02, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.2,<8.0.0) + + Distribute tests to cloud machines without fuss + :pypi:`pytest-cobra` *last release*: Jun 29, 2019, *status*: 3 - Alpha, @@ -2478,8 +2496,8 @@ This list contains 1110 plugins. CSV output for pytest. :pypi:`pytest-csv-params` - *last release*: Aug 25, 2022, - *status*: 4 - Beta, + *last release*: Aug 28, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=7.1.2,<8.0.0) Pytest plugin for Test Case Parametrization with CSV files @@ -3304,7 +3322,7 @@ This list contains 1110 plugins. Tool to help automate user interfaces :pypi:`pytest-eliot` - *last release*: Apr 05, 2022, + *last release*: Aug 31, 2022, *status*: 1 - Planning, *requires*: pytest (>=5.4.0) @@ -4256,7 +4274,7 @@ This list contains 1110 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 26, 2022, + *last release*: Sep 03, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4339,6 +4357,13 @@ This list contains 1110 plugins. Generates a static html report based on pytest framework + :pypi:`pytest-html-report-merger` + *last release*: Aug 31, 2022, + *status*: N/A, + *requires*: N/A + + + :pypi:`pytest-html-thread` *last release*: Dec 29, 2020, *status*: 5 - Production/Stable, @@ -4438,7 +4463,7 @@ This list contains 1110 plugins. 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 :pypi:`pytest-idem` - *last release*: Jun 29, 2022, + *last release*: Aug 31, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4935,11 +4960,11 @@ This list contains 1110 plugins. A PyTest plugin which provides an FTP fixture for your tests :pypi:`pytest-localserver` - *last release*: May 05, 2022, + *last release*: Aug 30, 2022, *status*: 4 - Beta, *requires*: N/A - py.test plugin to test server connections locally. + pytest plugin to test server connections locally. :pypi:`pytest-localstack` *last release*: Aug 22, 2019, @@ -5054,7 +5079,7 @@ This list contains 1110 plugins. Test your markdown docs with pytest :pypi:`pytest-markdown-docs` - *last release*: May 12, 2022, + *last release*: Sep 02, 2022, *status*: N/A, *requires*: N/A @@ -5411,7 +5436,7 @@ This list contains 1110 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Aug 26, 2022, + *last release*: Aug 30, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -6244,7 +6269,7 @@ This list contains 1110 plugins. Report test pass / failures to a Prometheus PushGateway :pypi:`pytest-prometheus-pushgateway` - *last release*: May 05, 2022, + *last release*: Sep 01, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6327,8 +6352,15 @@ This list contains 1110 plugins. pytest plugin to check source code with pylint + :pypi:`pytest-pymysql-autorecord` + *last release*: Sep 02, 2022, + *status*: N/A, + *requires*: N/A + + Record PyMySQL queries and mock with the stored data. + :pypi:`pytest-pyodide` - *last release*: Aug 10, 2022, + *last release*: Sep 02, 2022, *status*: N/A, *requires*: pytest @@ -6559,7 +6591,7 @@ This list contains 1110 plugins. Randomise the order in which pytest tests are run with some control over the randomness :pypi:`pytest-readme` - *last release*: Dec 28, 2014, + *last release*: Sep 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7091,7 +7123,7 @@ This list contains 1110 plugins. :pypi:`pytest-sbase` - *last release*: Aug 27, 2022, + *last release*: Sep 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7133,7 +7165,7 @@ This list contains 1110 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Aug 27, 2022, + *last release*: Sep 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7560,7 +7592,7 @@ This list contains 1110 plugins. :pypi:`pytest-splunk-addon` - *last release*: Aug 23, 2022, + *last release*: Aug 31, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7854,14 +7886,14 @@ This list contains 1110 plugins. Predictable and repeatable tempdir support. :pypi:`pytest-terra-fixt` - *last release*: Jun 18, 2022, + *last release*: Sep 02, 2022, *status*: N/A, *requires*: pytest (==6.2.5) - Terraform fixtures for pytest + Terraform and Terragrunt fixtures for pytest :pypi:`pytest-terraform` - *last release*: Jan 17, 2022, + *last release*: Sep 01, 2022, *status*: N/A, *requires*: pytest (>=6.0) @@ -7980,7 +8012,7 @@ This list contains 1110 plugins. A small example package :pypi:`pytest-testrail-api` - *last release*: Aug 19, 2022, + *last release*: Aug 29, 2022, *status*: N/A, *requires*: pytest (>=5.5) @@ -8204,7 +8236,7 @@ This list contains 1110 plugins. Utilities to create temporary file hierarchies in pytest. :pypi:`pytest-tmpfs` - *last release*: Aug 26, 2022, + *last release*: Aug 29, 2022, *status*: N/A, *requires*: pytest @@ -8617,7 +8649,7 @@ This list contains 1110 plugins. Pytest plugin for testing whatsapp bots with end to end tests :pypi:`pytest-wake` - *last release*: Jul 22, 2022, + *last release*: Aug 30, 2022, *status*: N/A, *requires*: pytest @@ -8771,7 +8803,7 @@ This list contains 1110 plugins. An extended parametrizing plugin of pytest. :pypi:`pytest-xprocess` - *last release*: May 24, 2022, + *last release*: Aug 29, 2022, *status*: 4 - Beta, *requires*: pytest (>=2.8) From 649b2e7f305259d0c64f3059b9f6c1c86be02639 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 13:09:31 +0000 Subject: [PATCH 174/255] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.1 to 4.1.1. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/commits) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... 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 0853db6299b..77309ef46f9 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.1 +django==4.1.1 pytest-asyncio==0.19.0 pytest-bdd==6.0.1 pytest-cov==3.0.0 From b4ae5e4a351119d2a679bf46c8ef0356a6734342 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 23:33:43 +0000 Subject: [PATCH 175/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.6.0 → 22.8.0](https://github.com/psf/black/compare/22.6.0...22.8.0) - [github.com/myint/autoflake: v1.5.1 → v1.5.3](https://github.com/myint/autoflake/compare/v1.5.1...v1.5.3) --- .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 68357b127ac..fe9c54ac169 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 22.8.0 hooks: - id: black args: [--safe, --quiet] @@ -21,7 +21,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/myint/autoflake - rev: v1.5.1 + rev: v1.5.3 hooks: - id: autoflake name: autoflake From 1e0aa16908bd0a0f7da1dfd9a8398271d75528dd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 7 Sep 2022 14:48:49 +0200 Subject: [PATCH 176/255] Update open 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 870fd5a2b15..2757e6415a0 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,7 @@ .. sidebar:: Next Open Trainings - - `CH Open Workshop-Tage `__ (German), September 8th 2022, Bern, Switzerland + - `enterPy `__ (German), October 28th (separate workshop day), online - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. From c326bd5669fdfd21ea902e248ba5e4f3a16bd13f Mon Sep 17 00:00:00 2001 From: skhomuti Date: Thu, 8 Sep 2022 22:12:44 +0500 Subject: [PATCH 177/255] Add allure-pytest to the popular plugins list --- doc/en/how-to/plugins.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/en/how-to/plugins.rst b/doc/en/how-to/plugins.rst index 7a1948410e4..7d5bcd85a31 100644 --- a/doc/en/how-to/plugins.rst +++ b/doc/en/how-to/plugins.rst @@ -51,6 +51,9 @@ Here is a little annotated list for some popular plugins: * :pypi:`pytest-flakes`: check source code with pyflakes. +* :pypi:`allure-pytest`: + report test results via `allure-framework `_. + To see a complete list of all plugins with their latest testing status against different pytest and Python versions, please visit :ref:`plugin-list`. From f53b49c8c4218756ff6db6bee18b1abdf3fef31c Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 11 Sep 2022 00:22:18 +0000 Subject: [PATCH 178/255] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 116 ++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 42 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 33a80b3a8bd..3dff88e5913 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1114 plugins. +This list contains 1118 plugins. .. only:: not latex @@ -39,7 +39,7 @@ This list contains 1114 plugins. :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Jun 28, 2022 N/A pytest + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Sep 08, 2022 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-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) @@ -74,7 +74,7 @@ This list contains 1114 plugins. :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A :pypi:`pytest-asteroid` PyTest plugin for docker-based testing on database images Aug 15, 2022 N/A pytest (>=6.2.5,<8.0.0) :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Jul 15, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jul 11, 2022 N/A N/A @@ -118,6 +118,7 @@ This list contains 1114 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-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-bootstrap` Mar 04, 2022 N/A N/A :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A @@ -205,7 +206,7 @@ This list contains 1114 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Aug 22, 2022 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 17, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Sep 10, 2022 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) @@ -236,6 +237,7 @@ This list contains 1114 plugins. :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :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. Apr 20, 2020 5 - Production/Stable pytest + :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Sep 05, 2022 5 - Production/Stable N/A :pypi:`pytest-data-suites` Class-based pytest parametrization Jul 24, 2022 N/A pytest (>=6.0,<8.0) :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A @@ -255,6 +257,7 @@ This list contains 1114 plugins. :pypi:`pytest-describe` Describe-style plugin for pytest Nov 13, 2021 4 - Beta pytest (>=4.0.0) :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest :pypi:`pytest-devpi-server` DevPI server fixture for py.test May 28, 2019 5 - Production/Stable 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 :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A @@ -466,7 +469,7 @@ This list contains 1114 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A 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 03, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 09, 2022 3 - Alpha pytest (==7.1.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-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -493,7 +496,7 @@ This list contains 1114 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A :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 Aug 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Sep 07, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest @@ -503,9 +506,9 @@ This list contains 1114 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :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-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Sep 07, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Aug 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jul 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Sep 07, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -537,7 +540,7 @@ This list contains 1114 plugins. :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Aug 11, 2022 5 - Production/Stable N/A + :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Sep 08, 2022 5 - Production/Stable N/A :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A @@ -632,7 +635,7 @@ This list contains 1114 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 30, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Sep 04, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :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 Jun 10, 2021 N/A N/A @@ -676,7 +679,7 @@ This list contains 1114 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Sep 07, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators Aug 17, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A @@ -762,9 +765,9 @@ This list contains 1114 plugins. :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Mar 13, 2022 3 - Alpha N/A :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 Mar 13, 2022 3 - Alpha N/A - :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-pylint` pytest plugin to check source code with pylint Sep 10, 2022 5 - Production/Stable pytest (>=5.4) :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" Sep 02, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Sep 08, 2022 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) @@ -873,13 +876,13 @@ This list contains 1114 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 09, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :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 Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 09, 2022 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-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -932,15 +935,15 @@ This list contains 1114 plugins. :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jul 06, 2022 3 - Alpha pytest (>=7) - :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Sep 06, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A - :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A + :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Sep 09, 2022 6 - Mature pytest (>=3.0.0) :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Jun 11, 2022 6 - Mature pytest (<8.0,>=7.1.2) :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) :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 Aug 31, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Sep 08, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 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 @@ -955,6 +958,7 @@ This list contains 1114 plugins. :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-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 09, 2022 N/A pytest (>=5.0) :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A :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 Sep 21, 2021 N/A pytest @@ -982,7 +986,7 @@ This list contains 1114 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 02, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 09, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 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-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A @@ -993,7 +997,7 @@ This list contains 1114 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Aug 27, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Sep 09, 2022 4 - Beta N/A :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 Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1055,7 +1059,7 @@ This list contains 1114 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :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) for Pytest, with optional auto-launch and HTML export Aug 27, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Sep 07, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 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) @@ -1285,7 +1289,7 @@ This list contains 1114 plugins. Plugin for py.test to generate allure xml reports :pypi:`pytest-allure-collection` - *last release*: Jun 28, 2022, + *last release*: Sep 08, 2022, *status*: N/A, *requires*: pytest @@ -1530,7 +1534,7 @@ This list contains 1114 plugins. Meta-package containing dependencies for testing :pypi:`pytest-astropy-header` - *last release*: Mar 10, 2022, + *last release*: Sep 06, 2022, *status*: 3 - Alpha, *requires*: pytest (>=4.6) @@ -1837,6 +1841,13 @@ This list contains 1114 plugins. pytest plugin to mark a test as blocker and skip all other tests + :pypi:`pytest-blue` + *last release*: Sep 05, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. + :pypi:`pytest-board` *last release*: Jan 20, 2019, *status*: N/A, @@ -2447,7 +2458,7 @@ This list contains 1114 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Aug 17, 2022, + *last release*: Sep 10, 2022, *status*: N/A, *requires*: N/A @@ -2663,6 +2674,13 @@ This list contains 1114 plugins. A py.test plugin recording and comparing test output. + :pypi:`pytest-dataset` + *last release*: Sep 05, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + Plugin for loading different datasets for pytest by prefix from json or yaml files + :pypi:`pytest-data-suites` *last release*: Jul 24, 2022, *status*: N/A, @@ -2796,6 +2814,13 @@ This list contains 1114 plugins. DevPI server fixture for py.test + :pypi:`pytest-dhos` + *last release*: Sep 07, 2022, + *status*: N/A, + *requires*: N/A + + Common fixtures for pytest in DHOS services and libraries + :pypi:`pytest-diamond` *last release*: Aug 31, 2015, *status*: 4 - Beta, @@ -4274,7 +4299,7 @@ This list contains 1114 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Sep 03, 2022, + *last release*: Sep 09, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4463,7 +4488,7 @@ This list contains 1114 plugins. 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 :pypi:`pytest-idem` - *last release*: Aug 31, 2022, + *last release*: Sep 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4533,7 +4558,7 @@ This list contains 1114 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: May 18, 2022, + *last release*: Sep 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4547,7 +4572,7 @@ This list contains 1114 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Jul 14, 2022, + *last release*: Sep 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4771,7 +4796,7 @@ This list contains 1114 plugins. :pypi:`pytest-kind` - *last release*: Aug 11, 2022, + *last release*: Sep 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -5436,7 +5461,7 @@ This list contains 1114 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Aug 30, 2022, + *last release*: Sep 04, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5744,7 +5769,7 @@ This list contains 1114 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentelemetry` - *last release*: May 03, 2022, + *last release*: Sep 07, 2022, *status*: N/A, *requires*: pytest @@ -6346,7 +6371,7 @@ This list contains 1114 plugins. pytest plugin to run pydocstyle :pypi:`pytest-pylint` - *last release*: Nov 09, 2020, + *last release*: Sep 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.4) @@ -6360,7 +6385,7 @@ This list contains 1114 plugins. Record PyMySQL queries and mock with the stored data. :pypi:`pytest-pyodide` - *last release*: Sep 02, 2022, + *last release*: Sep 08, 2022, *status*: N/A, *requires*: pytest @@ -7123,7 +7148,7 @@ This list contains 1114 plugins. :pypi:`pytest-sbase` - *last release*: Sep 02, 2022, + *last release*: Sep 09, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7165,7 +7190,7 @@ This list contains 1114 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Sep 02, 2022, + *last release*: Sep 09, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7536,7 +7561,7 @@ This list contains 1114 plugins. Modern benchmarking library for python with pytest integration. :pypi:`pytest-sphinx` - *last release*: Mar 30, 2022, + *last release*: Sep 06, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.0.0) @@ -7550,9 +7575,9 @@ This list contains 1114 plugins. Exports unit tests as test runs in SpiraTest/Team/Plan :pypi:`pytest-splinter` - *last release*: Dec 25, 2020, + *last release*: Sep 09, 2022, *status*: 6 - Mature, - *requires*: N/A + *requires*: pytest (>=3.0.0) Splinter plugin for pytest testing framework @@ -7592,7 +7617,7 @@ This list contains 1114 plugins. :pypi:`pytest-splunk-addon` - *last release*: Aug 31, 2022, + *last release*: Sep 08, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7696,6 +7721,13 @@ This list contains 1114 plugins. Run a test suite one failing test at a time. + :pypi:`pytest-stf` + *last release*: Sep 09, 2022, + *status*: N/A, + *requires*: pytest (>=5.0) + + pytest plugin for openSTF + :pypi:`pytest-stoq` *last release*: Feb 09, 2021, *status*: 4 - Beta, @@ -7886,7 +7918,7 @@ This list contains 1114 plugins. Predictable and repeatable tempdir support. :pypi:`pytest-terra-fixt` - *last release*: Sep 02, 2022, + *last release*: Sep 09, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -7963,7 +7995,7 @@ This list contains 1114 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Aug 27, 2022, + *last release*: Sep 09, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8397,7 +8429,7 @@ This list contains 1114 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Aug 27, 2022, + *last release*: Sep 07, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) From d416fbab914996b8d3b294a747b33e75be6bfe3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 03:01:53 +0000 Subject: [PATCH 179/255] build(deps): Bump twisted in /testing/plugins_integration Bumps [twisted](https://github.com/twisted/twisted) from 22.4.0 to 22.8.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-22.4.0...twisted-22.8.0) --- updated-dependencies: - dependency-name: twisted 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 77309ef46f9..7d66be96c7c 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -11,5 +11,5 @@ pytest-rerunfailures==10.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.13.4 -twisted==22.4.0 +twisted==22.8.0 pytest-xvfb==2.0.0 From 34765f6b2e8a98b231baa33e4f356646259ab556 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 15 Sep 2022 08:07:02 -0700 Subject: [PATCH 180/255] doc: Add link for enterPy training (#10299) --- 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 2757e6415a0..a443e081bb3 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,7 @@ .. sidebar:: Next Open Trainings - - `enterPy `__ (German), October 28th (separate workshop day), online + - `Professionelles Testen für Python mit pytest `_, part of `enterPy `__ (German), October 28th (separate workshop day), online - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. From 246129089c7442eca563c6d98d6b260f8a55f517 Mon Sep 17 00:00:00 2001 From: Fredrik Berndtsson Date: Thu, 15 Sep 2022 23:34:10 +0200 Subject: [PATCH 181/255] doc: Fix 404 'identify flaky test' link (#10244) --- doc/en/explanation/flaky.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/flaky.rst b/doc/en/explanation/flaky.rst index 50121c7a761..ccf3fbb2b0c 100644 --- a/doc/en/explanation/flaky.rst +++ b/doc/en/explanation/flaky.rst @@ -94,7 +94,7 @@ Mark Lapierre discusses the `Pros and Cons of Quarantined Tests `_ and rerun failed tests. +Azure Pipelines (the Azure cloud CI/CD tool, formerly Visual Studio Team Services or VSTS) has a feature to `identify flaky tests `_ and rerun failed tests. From 256ab097a274c3e4057a70849ae86aced52b4b27 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 23:24:54 +0000 Subject: [PATCH 182/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - https://github.com/myint/autoflake → https://github.com/PyCQA/autoflake - [github.com/PyCQA/autoflake: v1.5.3 → v1.6.0](https://github.com/PyCQA/autoflake/compare/v1.5.3...v1.6.0) - [github.com/asottile/pyupgrade: v2.37.3 → v2.38.0](https://github.com/asottile/pyupgrade/compare/v2.37.3...v2.38.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 fe9c54ac169..a8dc8b5b610 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,8 +20,8 @@ repos: - id: debug-statements exclude: _pytest/(debugging|hookspec).py language_version: python3 -- repo: https://github.com/myint/autoflake - rev: v1.5.3 +- repo: https://github.com/PyCQA/autoflake + rev: v1.6.0 hooks: - id: autoflake name: autoflake @@ -42,7 +42,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.3 + rev: v2.38.0 hooks: - id: pyupgrade args: [--py37-plus] From 0fdacb6db5806dcc2c01d80e6dfe0e5fcd24034e Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sun, 3 Oct 2021 16:01:40 +0200 Subject: [PATCH 183/255] deprecate hook configuration via marks/attributes fixes #4562 --- changelog/4562.deprecation.rst | 4 +++ doc/en/deprecations.rst | 44 ++++++++++++++++++++++++ pyproject.toml | 3 ++ src/_pytest/config/__init__.py | 61 ++++++++++++++++++++++------------ src/_pytest/deprecated.py | 8 +++++ src/_pytest/warning_types.py | 19 +++++++++++ testing/deprecated_test.py | 48 ++++++++++++++++++++++++++ 7 files changed, 165 insertions(+), 22 deletions(-) create mode 100644 changelog/4562.deprecation.rst diff --git a/changelog/4562.deprecation.rst b/changelog/4562.deprecation.rst new file mode 100644 index 00000000000..d459801d4a6 --- /dev/null +++ b/changelog/4562.deprecation.rst @@ -0,0 +1,4 @@ +Deprecate configuring hook specs/impls using attributes/marks. + +Instead use :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec`. +For more details, see the :ref:`docs `. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 3bbd29bb509..a18d9d713b0 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -78,6 +78,50 @@ no matter what argument was used in the constructor. We expect to deprecate the .. _legacy-path-hooks-deprecated: +Configuring hook specs/impls using markers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Before pluggy, pytest's plugin library, was its own package and had a clear API, +pytest just used ``pytest.mark`` to configure hooks. + +The :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec` decorators +have been available since years and should be used instead. + +.. code-block:: python + + @pytest.mark.tryfirst + def pytest_runtest_call(): + ... + + + # or + def pytest_runtest_call(): + ... + + + pytest_runtest_call.tryfirst = True + +should be changed to: + +.. code-block:: python + + @pytest.hookimpl(tryfirst=True) + def pytest_runtest_call(): + ... + +Changed ``hookimpl`` attributes: + +* ``tryfirst`` +* ``trylast`` +* ``optionalhook`` +* ``hookwrapper`` + +Changed ``hookwrapper`` attributes: + +* ``firstresult`` +* ``historic`` + + ``py.path.local`` arguments for hooks replaced with ``pathlib.Path`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/pyproject.toml b/pyproject.toml index a66f90017ce..fc9a119f6f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,9 @@ filterwarnings = [ # Those are caught/handled by pyupgrade, and not easy to filter with the # module being the filename (with .py removed). "default:invalid escape sequence:DeprecationWarning", + # ignore not yet fixed warnings for hook markers + "default:.*not marked using pytest.hook.*", + "ignore:.*not marked using pytest.hook.*::xdist.*", # ignore use of unregistered marks, because we use many to test the implementation "ignore::_pytest.warning_types.PytestUnknownMarkWarning", # https://github.com/benjaminp/six/issues/341 diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index d753a9054ab..e1ceb7737cd 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -14,6 +14,7 @@ from functools import lru_cache from pathlib import Path from textwrap import dedent +from types import FunctionType from types import TracebackType from typing import Any from typing import Callable @@ -58,6 +59,7 @@ from _pytest.pathlib import resolve_package_path from _pytest.stash import Stash from _pytest.warning_types import PytestConfigWarning +from _pytest.warning_types import warn_explicit_for if TYPE_CHECKING: @@ -341,6 +343,32 @@ def _get_directory(path: Path) -> Path: return path +def _get_legacy_hook_marks( + method: object, # using object to avoid function type excess + hook_type: str, + opt_names: Tuple[str, ...], +) -> Dict[str, bool]: + known_marks = {m.name for m in getattr(method, "pytestmark", [])} + must_warn = False + opts = {} + for opt_name in opt_names: + if hasattr(method, opt_name) or opt_name in known_marks: + opts[opt_name] = True + must_warn = True + else: + opts[opt_name] = False + if must_warn: + + hook_opts = ", ".join(f"{name}=True" for name, val in opts.items() if val) + message = _pytest.deprecated.HOOK_LEGACY_MARKING.format( + type=hook_type, + fullname=method.__qualname__, # type: ignore + hook_opts=hook_opts, + ) + warn_explicit_for(cast(FunctionType, method), message) + return opts + + @final class PytestPluginManager(PluginManager): """A :py:class:`pluggy.PluginManager ` with @@ -414,40 +442,29 @@ def parse_hookimpl_opts(self, plugin: _PluggyPlugin, name: str): if name == "pytest_plugins": return - method = getattr(plugin, name) opts = super().parse_hookimpl_opts(plugin, name) + if opts is not None: + return opts + method = getattr(plugin, name) # Consider only actual functions for hooks (#3775). if not inspect.isroutine(method): return - # Collect unmarked hooks as long as they have the `pytest_' prefix. - if opts is None and name.startswith("pytest_"): - opts = {} - if opts is not None: - # TODO: DeprecationWarning, people should use hookimpl - # https://github.com/pytest-dev/pytest/issues/4562 - known_marks = {m.name for m in getattr(method, "pytestmark", [])} - - for name in ("tryfirst", "trylast", "optionalhook", "hookwrapper"): - opts.setdefault(name, hasattr(method, name) or name in known_marks) - return opts + return _get_legacy_hook_marks( + method, "impl", ("tryfirst", "trylast", "optionalhook", "hookwrapper") + ) def parse_hookspec_opts(self, module_or_class, name: str): opts = super().parse_hookspec_opts(module_or_class, name) if opts is None: method = getattr(module_or_class, name) - if name.startswith("pytest_"): - # todo: deprecate hookspec hacks - # https://github.com/pytest-dev/pytest/issues/4562 - known_marks = {m.name for m in getattr(method, "pytestmark", [])} - opts = { - "firstresult": hasattr(method, "firstresult") - or "firstresult" in known_marks, - "historic": hasattr(method, "historic") - or "historic" in known_marks, - } + opts = _get_legacy_hook_marks( + method, + "spec", + ("firstresult", "historic"), + ) return opts def register( diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index f2d79760ae7..623bb02365f 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -98,6 +98,14 @@ "The pytest.Instance collector type is deprecated and is no longer used. " "See https://docs.pytest.org/en/latest/deprecations.html#the-pytest-instance-collector", ) +HOOK_LEGACY_MARKING = UnformattedWarning( + PytestDeprecationWarning, + "The hook{type} {fullname} uses old-style configuration options (marks or attributes).\n" + "Please use the pytest.hook{type}({hook_opts}) decorator instead\n" + " to configure the hooks.\n" + " See https://docs.pytest.org/en/latest/deprecations.html" + "#configuring-hook-specs-impls-using-markers", +) # You want to make some `__init__` or function "private". # diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index c32ce80ccb1..fd4b68e187c 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -1,3 +1,6 @@ +import inspect +import warnings +from types import FunctionType from typing import Any from typing import Generic from typing import Type @@ -142,3 +145,19 @@ class UnformattedWarning(Generic[_W]): def format(self, **kwargs: Any) -> _W: """Return an instance of the warning category, formatted with given kwargs.""" return self.category(self.template.format(**kwargs)) + + +def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: + lineno = method.__code__.co_firstlineno + filename = inspect.getfile(method) + module = method.__module__ + mod_globals = method.__globals__ + + warnings.warn_explicit( + message, + type(message), + filename=filename, + module=module, + registry=mod_globals.setdefault("__warningregistry__", {}), + lineno=lineno, + ) diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index db649841abe..8847695a776 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -20,6 +20,54 @@ def test_external_plugins_integrated(pytester: Pytester, plugin) -> None: pytester.parseconfig("-p", plugin) +def test_hookspec_via_function_attributes_are_deprecated(): + from _pytest.config import PytestPluginManager + + pm = PytestPluginManager() + + class DeprecatedHookMarkerSpec: + def pytest_bad_hook(self): + pass + + pytest_bad_hook.historic = True # type: ignore[attr-defined] + + with pytest.warns( + PytestDeprecationWarning, + match=r"Please use the pytest\.hookspec\(historic=True\) decorator", + ) as recorder: + pm.add_hookspecs(DeprecatedHookMarkerSpec) + (record,) = recorder + assert ( + record.lineno + == DeprecatedHookMarkerSpec.pytest_bad_hook.__code__.co_firstlineno + ) + assert record.filename == __file__ + + +def test_hookimpl_via_function_attributes_are_deprecated(): + from _pytest.config import PytestPluginManager + + pm = PytestPluginManager() + + class DeprecatedMarkImplPlugin: + def pytest_runtest_call(self): + pass + + pytest_runtest_call.tryfirst = True # type: ignore[attr-defined] + + with pytest.warns( + PytestDeprecationWarning, + match=r"Please use the pytest.hookimpl\(tryfirst=True\)", + ) as recorder: + pm.register(DeprecatedMarkImplPlugin()) + (record,) = recorder + assert ( + record.lineno + == DeprecatedMarkImplPlugin.pytest_runtest_call.__code__.co_firstlineno + ) + assert record.filename == __file__ + + def test_fscollector_gethookproxy_isinitpath(pytester: Pytester) -> None: module = pytester.getmodulecol( """ From 8c52dc5b7e566e6112185105ce897015adf6607c Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 8 Mar 2022 10:13:27 +0100 Subject: [PATCH 184/255] remove the setup.py for the py.test project which for deprecation has been deployed since 2014 --- extra/setup-py.test/setup.py | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 extra/setup-py.test/setup.py diff --git a/extra/setup-py.test/setup.py b/extra/setup-py.test/setup.py deleted file mode 100644 index 97883852e2e..00000000000 --- a/extra/setup-py.test/setup.py +++ /dev/null @@ -1,12 +0,0 @@ -import sys - -from distutils.core import setup - -if __name__ == "__main__": - if "sdist" not in sys.argv[1:]: - raise ValueError("please use 'pytest' pypi package instead of 'py.test'") - setup( - name="py.test", - version="0.0", - description="please use 'pytest' for installation", - ) From b1fb9a9c8d8b8af0fa795b4bf2bc5a58e792c390 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sun, 31 Jul 2022 17:11:34 +0200 Subject: [PATCH 185/255] handle non-true options in hookspec warning --- src/_pytest/config/__init__.py | 15 +++++++++------ testing/deprecated_test.py | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index e1ceb7737cd..2d6693808ce 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -348,18 +348,21 @@ def _get_legacy_hook_marks( hook_type: str, opt_names: Tuple[str, ...], ) -> Dict[str, bool]: - known_marks = {m.name for m in getattr(method, "pytestmark", [])} - must_warn = False - opts = {} + known_marks: set[str] = {m.name for m in getattr(method, "pytestmark", [])} + must_warn: list[str] = [] + opts: dict[str, bool] = {} for opt_name in opt_names: + opt_attr = getattr(method, opt_name, AttributeError) + if opt_attr is not AttributeError: + must_warn.append(f"{opt_name}={opt_attr}") + elif opt_name in known_marks: + must_warn.append(f"{opt_name}=True") if hasattr(method, opt_name) or opt_name in known_marks: opts[opt_name] = True - must_warn = True else: opts[opt_name] = False if must_warn: - - hook_opts = ", ".join(f"{name}=True" for name, val in opts.items() if val) + hook_opts = ", ".join(must_warn) message = _pytest.deprecated.HOOK_LEGACY_MARKING.format( type=hook_type, fullname=method.__qualname__, # type: ignore diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 8847695a776..d468b443541 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -29,11 +29,11 @@ class DeprecatedHookMarkerSpec: def pytest_bad_hook(self): pass - pytest_bad_hook.historic = True # type: ignore[attr-defined] + pytest_bad_hook.historic = False # type: ignore[attr-defined] with pytest.warns( PytestDeprecationWarning, - match=r"Please use the pytest\.hookspec\(historic=True\) decorator", + match=r"Please use the pytest\.hookspec\(historic=False\) decorator", ) as recorder: pm.add_hookspecs(DeprecatedHookMarkerSpec) (record,) = recorder From e3294398d6912a4c3d28dadb6087c3ab8974582a Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Sep 2022 15:53:53 +0200 Subject: [PATCH 186/255] simplify typing for legacy hook mark support --- src/_pytest/config/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 2d6693808ce..51d79deba4a 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -344,10 +344,13 @@ def _get_directory(path: Path) -> Path: def _get_legacy_hook_marks( - method: object, # using object to avoid function type excess + method: Any, hook_type: str, opt_names: Tuple[str, ...], ) -> Dict[str, bool]: + if TYPE_CHECKING: + # abuse typeguard from importlib to avoid massive method type union thats lacking a alias + assert inspect.isroutine(method) known_marks: set[str] = {m.name for m in getattr(method, "pytestmark", [])} must_warn: list[str] = [] opts: dict[str, bool] = {} @@ -365,7 +368,7 @@ def _get_legacy_hook_marks( hook_opts = ", ".join(must_warn) message = _pytest.deprecated.HOOK_LEGACY_MARKING.format( type=hook_type, - fullname=method.__qualname__, # type: ignore + fullname=method.__qualname__, hook_opts=hook_opts, ) warn_explicit_for(cast(FunctionType, method), message) From 7e8a4849d819e53248bb0eb2e08f4183d9c7e4d6 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Sep 2022 15:55:13 +0200 Subject: [PATCH 187/255] unify option extraction for legacy hook marks --- src/_pytest/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 51d79deba4a..cffbb6dc45b 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -358,9 +358,9 @@ def _get_legacy_hook_marks( opt_attr = getattr(method, opt_name, AttributeError) if opt_attr is not AttributeError: must_warn.append(f"{opt_name}={opt_attr}") + opts[opt_name] = True elif opt_name in known_marks: must_warn.append(f"{opt_name}=True") - if hasattr(method, opt_name) or opt_name in known_marks: opts[opt_name] = True else: opts[opt_name] = False From ae9dbf5006286018440c0dead9b140f42c427286 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Sep 2022 16:04:35 +0200 Subject: [PATCH 188/255] add docstring to warn_explicit_for --- src/_pytest/warning_types.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index fd4b68e187c..88a51399182 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -148,6 +148,12 @@ def format(self, **kwargs: Any) -> _W: def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: + """ + Issue the warning :param:`message` for the definition of the given :param:`method` + + this helps to log warnigns for functions defined prior to finding an issue with them + (like hook wrappers being marked in a legacy mechanism) + """ lineno = method.__code__.co_firstlineno filename = inspect.getfile(method) module = method.__module__ From ce3e2e922bb40acdf3109b0832e95270bed0803a Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 28 Sep 2022 22:28:03 +0200 Subject: [PATCH 189/255] bump plugin test pytest cov pin --- 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 7d66be96c7c..3b4b291cc4f 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -2,7 +2,7 @@ anyio[curio,trio]==3.6.1 django==4.1.1 pytest-asyncio==0.19.0 pytest-bdd==6.0.1 -pytest-cov==3.0.0 +pytest-cov==4.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 From 594413e8f05268bc0d448d37022c502af28e1244 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 30 Sep 2022 23:43:27 +0100 Subject: [PATCH 190/255] Use an explicit encoding when opening `os.devnul` Although slightly pointless, this avoids an `EncodingWarning` in Python 3.10 or greater when running under the `-X warn_default_encoding` flag. --- src/_pytest/capture.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index bcfd3449f29..6131a46df47 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -381,7 +381,7 @@ def __init__(self, targetfd: int) -> None: self.targetfd_save = os.dup(targetfd) if targetfd == 0: - self.tmpfile = open(os.devnull) + self.tmpfile = open(os.devnull, encoding="utf-8") self.syscapture = SysCapture(targetfd) else: self.tmpfile = EncodedFile( From eab875509d9337dcc70af60ae9c42c761ccdc8e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 03:01:46 +0000 Subject: [PATCH 191/255] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.8.2 to 3.9.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.8.2...v3.9.0) --- updated-dependencies: - dependency-name: pytest-mock 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 3b4b291cc4f..82929c87a73 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==4.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.8.2 +pytest-mock==3.9.0 pytest-rerunfailures==10.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 From 4ee6e900a0809c8ad19bba6c705280d65be26905 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 23:32:26 +0000 Subject: [PATCH 192/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/autoflake: v1.6.0 → v1.6.1](https://github.com/PyCQA/autoflake/compare/v1.6.0...v1.6.1) - [github.com/asottile/reorder_python_imports: v3.8.2 → v3.8.3](https://github.com/asottile/reorder_python_imports/compare/v3.8.2...v3.8.3) - [github.com/asottile/pyupgrade: v2.38.0 → v2.38.2](https://github.com/asottile/pyupgrade/compare/v2.38.0...v2.38.2) - [github.com/pre-commit/mirrors-mypy: v0.971 → v0.981](https://github.com/pre-commit/mirrors-mypy/compare/v0.971...v0.981) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8dc8b5b610..663bc64c206 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.6.0 + rev: v1.6.1 hooks: - id: autoflake name: autoflake @@ -37,12 +37,12 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.2 + rev: v3.8.3 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.38.0 + rev: v2.38.2 hooks: - id: pyupgrade args: [--py37-plus] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.971 + rev: v0.981 hooks: - id: mypy files: ^(src/|testing/) From 06007de7bad903018420612e6df42eb8bdfb8329 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Wed, 5 Oct 2022 10:24:55 -0400 Subject: [PATCH 193/255] Fix a few broken links in the documentation --- CONTRIBUTING.rst | 2 +- doc/en/changelog.rst | 4 ++-- doc/en/example/nonpython.rst | 2 +- src/_pytest/recwarn.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 262396728b8..22c3ecefb6c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -223,7 +223,7 @@ changes you want to review and merge. Pull requests are stored on Once you send a pull request, we can discuss its potential modifications and even add more commits to it later on. There's an excellent tutorial on how Pull Requests work in the -`GitHub Help Center `_. +`GitHub Help Center `_. Here is a simple overview, with pytest-specific bits: diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index e60b08c555e..ef3a241cdb1 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -6229,7 +6229,7 @@ Bug Fixes Thanks :user:`adborden` for the report and :user:`nicoddemus` for the PR. * Clean up unittest TestCase objects after tests are complete (:issue:`1649`). - Thanks :user:`d_b_w` for the report and PR. + Thanks :user:`d-b-w` for the report and PR. 3.0.3 (2016-09-28) @@ -6244,7 +6244,7 @@ Bug Fixes Thanks :user:`nicoddemus` for the PR. * Fix pkg_resources import error in Jython projects (:issue:`1853`). - Thanks :user:`raquel-ucl` for the PR. + Thanks :user:`raquelalegre` for the PR. * Got rid of ``AttributeError: 'Module' object has no attribute '_obj'`` exception in Python 3 (:issue:`1944`). diff --git a/doc/en/example/nonpython.rst b/doc/en/example/nonpython.rst index f79f15b4f79..efb701b1f16 100644 --- a/doc/en/example/nonpython.rst +++ b/doc/en/example/nonpython.rst @@ -9,7 +9,7 @@ Working with non-python tests A basic example for specifying tests in Yaml files -------------------------------------------------------------- -.. _`pytest-yamlwsgi`: http://bitbucket.org/aafshar/pytest-yamlwsgi/src/tip/pytest_yamlwsgi.py +.. _`pytest-yamlwsgi`: https://pypi.org/project/pytest-yamlwsgi/ Here is an example ``conftest.py`` (extracted from Ali Afshar's special purpose `pytest-yamlwsgi`_ plugin). This ``conftest.py`` will collect ``test*.yaml`` files and will execute the yaml-formatted content as custom tests: diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 06eb82d7191..edb419981ba 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -30,7 +30,7 @@ def recwarn() -> Generator["WarningsRecorder", None, None]: """Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. - See https://docs.python.org/library/how-to/capture-warnings.html for information + See https://docs.pytest.org/en/latest/how-to/capture-warnings.html for information on warning categories. """ wrec = WarningsRecorder(_ispytest=True) From 14919c4bbbeca42a1822858ee31f928c0b2e35dd Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Thu, 6 Oct 2022 11:44:05 +0200 Subject: [PATCH 194/255] fix #10342: put location into warning exceptions as the warning systems own warn_explicit looses the information we add them explicitly to the warning exceptions --- src/_pytest/warning_types.py | 20 +++++++++++--------- testing/test_warning_types.py | 8 ++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 88a51399182..388949bed53 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -158,12 +158,14 @@ def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: filename = inspect.getfile(method) module = method.__module__ mod_globals = method.__globals__ - - warnings.warn_explicit( - message, - type(message), - filename=filename, - module=module, - registry=mod_globals.setdefault("__warningregistry__", {}), - lineno=lineno, - ) + try: + warnings.warn_explicit( + message, + type(message), + filename=filename, + module=module, + registry=mod_globals.setdefault("__warningregistry__", {}), + lineno=lineno, + ) + except Warning as w: + raise type(w)(f"{w}\n at {filename}:{lineno}") from None diff --git a/testing/test_warning_types.py b/testing/test_warning_types.py index b49cc68f9c6..5f69439ef3e 100644 --- a/testing/test_warning_types.py +++ b/testing/test_warning_types.py @@ -36,3 +36,11 @@ def test(): ) result = pytester.runpytest() result.stdout.fnmatch_lines(["E pytest.PytestWarning: some warning"]) + + +@pytest.mark.filterwarnings("error") +def test_warn_explicit_for_annotates_errors_with_location(): + with pytest.raises(Warning, match="(?m)test\n at .*python_api.py:\\d+"): + warning_types.warn_explicit_for( + pytest.raises, warning_types.PytestWarning("test") # type: ignore + ) From 2df0d9656ca906e15754483bcd833b0e7b09387e Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 6 Oct 2022 21:12:03 +0300 Subject: [PATCH 195/255] ci: fix PR not triggering workflows by switching back to pytestbot access token The builtin actions token is not allowed to trigger further workflows. So when we create a PR using that token, the PR checks don't run, and a maintainer must close & open the PR to make them run. This is quite annoying, so switch back to the "machine user" approach. Fixes #9554. --- .github/workflows/backport.yml | 2 +- .github/workflows/prepare-release-pr.yml | 4 ++-- .github/workflows/update-plugin-list.yml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f7840d537cf..d007d323dd1 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -48,4 +48,4 @@ jobs: --title "${subject}" \ --body "Backport of PR #${{ github.event.number }} to $target_branch branch. PR created by backport workflow." env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CHATOPS }} diff --git a/.github/workflows/prepare-release-pr.yml b/.github/workflows/prepare-release-pr.yml index 429834b3f21..4f90662e0ca 100644 --- a/.github/workflows/prepare-release-pr.yml +++ b/.github/workflows/prepare-release-pr.yml @@ -44,9 +44,9 @@ jobs: - name: Prepare release PR (minor/patch release) if: github.event.inputs.major == 'no' run: | - tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --prerelease='${{ github.event.inputs.prerelease }}' + tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.CHATOPS }} --prerelease='${{ github.event.inputs.prerelease }}' - name: Prepare release PR (major release) if: github.event.inputs.major == 'yes' run: | - tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --major --prerelease='${{ github.event.inputs.prerelease }}' + tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.CHATOPS }} --major --prerelease='${{ github.event.inputs.prerelease }}' diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index 193469072ff..f4fb81fdaa9 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -38,7 +38,7 @@ jobs: run: python scripts/update-plugin-list.py - name: Create Pull Request - uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6 + uses: peter-evans/create-pull-request@671dc9c9e0c2d73f07fa45a3eb0220e1622f0c5f with: commit-message: '[automated] Update plugin list' author: 'pytest bot ' @@ -47,3 +47,4 @@ jobs: branch-suffix: short-commit-hash title: '[automated] Update plugin list' body: '[automated] Update plugin list' + token: ${{ secrets.CHATOPS }} From 72cac9b1af32a3edeb48f15d78bf8d006373c9e6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 7 Oct 2022 12:16:53 +0200 Subject: [PATCH 196/255] Mark tryfirst/trylast as deprecated in their docs. Follow-up to #9118 --- src/_pytest/config/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index cffbb6dc45b..25f156f8b20 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -512,12 +512,14 @@ def pytest_configure(self, config: "Config") -> None: config.addinivalue_line( "markers", "tryfirst: mark a hook implementation function such that the " - "plugin machinery will try to call it first/as early as possible.", + "plugin machinery will try to call it first/as early as possible. " + "DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead.", ) config.addinivalue_line( "markers", "trylast: mark a hook implementation function such that the " - "plugin machinery will try to call it last/as late as possible.", + "plugin machinery will try to call it last/as late as possible. " + "DEPRECATED, use @pytest.hookimpl(trylast=True) instead.", ) self._configured = True From 7a15bad89b2a11923f06a5ac416303d77f48d05b Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Fri, 7 Oct 2022 12:46:40 +0200 Subject: [PATCH 197/255] Update src/_pytest/warning_types.py Co-authored-by: Florian Bruhin --- src/_pytest/warning_types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 388949bed53..3be1648fe61 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -168,4 +168,5 @@ def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: lineno=lineno, ) except Warning as w: + # If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message. raise type(w)(f"{w}\n at {filename}:{lineno}") from None From 0c21d60349e9e91e6c369709d7a47236d5effbb5 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 7 Oct 2022 11:10:28 -0300 Subject: [PATCH 198/255] Improve documentation for setup() and teardown() nose support Fix #9549 --- doc/en/how-to/nose.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/how-to/nose.rst b/doc/en/how-to/nose.rst index 4bf8b06c324..621c243b283 100644 --- a/doc/en/how-to/nose.rst +++ b/doc/en/how-to/nose.rst @@ -23,8 +23,8 @@ make use of pytest's capabilities. Supported nose Idioms ---------------------- -* setup and teardown at module/class/method level -* SkipTest exceptions and markers +* ``setup()`` and ``teardown()`` at module/class/method level: any function or method called ``setup`` will be called during the setup phase for each test, same for ``teardown``. +* ``SkipTest`` exceptions and markers * setup/teardown decorators * ``__test__`` attribute on modules/classes/functions * general usage of nose utilities From 9be1e3fac8e75d9b48ac27b212f45d9f43293e46 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 7 Oct 2022 16:13:05 +0200 Subject: [PATCH 199/255] doc: Add second day for enterPy training (#10348) --- 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 a443e081bb3..60fbf99aed6 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,7 @@ .. sidebar:: Next Open Trainings - - `Professionelles Testen für Python mit pytest `_, part of `enterPy `__ (German), October 28th (separate workshop day), online + - Professionelles Testen für Python mit pytest, part of `enterPy `__ (German), `October 28th `__ (sold out) and `November 4th `__, online - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. From 4da06896532809a216bfa7a53b0ff490c5193fe9 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 7 Oct 2022 11:30:24 -0300 Subject: [PATCH 200/255] Ignore mypy error about missing generic arg for catch_warnings mypy stubs recently changed warnings.catch_warnings to a Generic, in order to have proper overloads depending on the parameters passed to it, whihc triggers this mypy error now when we subclass it: src/_pytest/recwarn.py:170: error: Missing type parameters for generic type "catch_warnings" [type-arg] For our porpuses the parameter is not relevant (we always use record=True), so decided to just ignore the type error. --- .pre-commit-config.yaml | 2 ++ src/_pytest/recwarn.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 663bc64c206..19329cb21b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,5 @@ +default_language_version: + python: "3.10" repos: - repo: https://github.com/psf/black rev: 22.8.0 diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 06eb82d7191..0ab7ab2de4f 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -167,7 +167,7 @@ def warns( # noqa: F811 return func(*args[1:], **kwargs) -class WarningsRecorder(warnings.catch_warnings): +class WarningsRecorder(warnings.catch_warnings): # type:ignore[type-arg] """A context manager to record raised warnings. Each recorded warning is an instance of :class:`warnings.WarningMessage`. From 2bc036e50ab0af2955bfe1c91b3f1b55d6a31765 Mon Sep 17 00:00:00 2001 From: wodny Date: Fri, 7 Oct 2022 18:03:13 +0200 Subject: [PATCH 201/255] Mention pythonpath confval in Good Integration Practices (#10314) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- doc/en/explanation/goodpractices.rst | 34 +++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 0280f14342f..5277c2ac54a 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -88,14 +88,6 @@ This has the following benefits: * Your tests can run against an installed version after executing ``pip install .``. * Your tests can run against the local copy with an editable install after executing ``pip install --editable .``. -* If you don't use an editable install and are relying on the fact that Python by default puts the current - directory in ``sys.path`` to import your package, you can execute ``python -m pytest`` to execute the tests against the - local copy directly, without using ``pip``. - -.. note:: - - See :ref:`pytest vs python -m pytest` for more information about the difference between calling ``pytest`` and - ``python -m pytest``. For new projects, we recommend to use ``importlib`` :ref:`import mode ` (see which-import-mode_ for a detailed explanation). @@ -120,6 +112,32 @@ which are better explained in this excellent `blog post`_ by Ionel Cristian Măr .. _blog post: https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure> +.. note:: + + If you do not use an editable install and use the ``src`` layout as above you need to extend the Python's + search path for module files to execute the tests against the local copy directly. You can do it in an + ad-hoc manner by setting the ``PYTHONPATH`` environment variable: + + .. code-block:: bash + + PYTHONPATH=src pytest + + or in a permanent manner by using the :confval:`pythonpath` configuration variable and adding the + following to your ``pyproject.toml``: + + .. code-block:: toml + + [tool.pytest.ini_options] + pythonpath = "src" + +.. note:: + + If you do not use an editable install and not use the ``src`` layout (``mypkg`` directly in the root + directory) you can rely on the fact that Python by default puts the current directory in ``sys.path`` to + import your package and run ``python -m pytest`` to execute the tests against the local copy directly. + + See :ref:`pytest vs python -m pytest` for more information about the difference between calling ``pytest`` and + ``python -m pytest``. Tests as part of application code ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 8e7ce60c7d8d6c595e8357e040fbdac25bfee696 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 7 Oct 2022 11:03:42 -0500 Subject: [PATCH 202/255] Export `pytest.DoctestItem` for typing / runtime purposes (#10313) Fixes #10312 --- changelog/10313.trivial.rst | 3 +++ src/_pytest/doctest.py | 17 ++++++++++------- src/pytest/__init__.py | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 changelog/10313.trivial.rst diff --git a/changelog/10313.trivial.rst b/changelog/10313.trivial.rst new file mode 100644 index 00000000000..8203b580211 --- /dev/null +++ b/changelog/10313.trivial.rst @@ -0,0 +1,3 @@ +Made ``_pytest.doctest.DoctestItem`` export ``pytest.DoctestItem`` for +type check and runtime purposes. Made `_pytest.doctest` use internal APIs +to avoid circular imports. diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index ed072fcd628..771f0890d88 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -23,7 +23,6 @@ from typing import TYPE_CHECKING from typing import Union -import pytest from _pytest import outcomes from _pytest._code.code import ExceptionInfo from _pytest._code.code import ReprFileLocation @@ -32,11 +31,15 @@ from _pytest.compat import safe_getattr from _pytest.config import Config from _pytest.config.argparsing import Parser +from _pytest.fixtures import fixture from _pytest.fixtures import FixtureRequest from _pytest.nodes import Collector +from _pytest.nodes import Item from _pytest.outcomes import OutcomeException +from _pytest.outcomes import skip from _pytest.pathlib import fnmatch_ex from _pytest.pathlib import import_path +from _pytest.python import Module from _pytest.python_api import approx from _pytest.warning_types import PytestWarning @@ -246,7 +249,7 @@ def _get_runner( ) -class DoctestItem(pytest.Item): +class DoctestItem(Item): def __init__( self, name: str, @@ -411,7 +414,7 @@ def _get_continue_on_failure(config): return continue_on_failure -class DoctestTextfile(pytest.Module): +class DoctestTextfile(Module): obj = None def collect(self) -> Iterable[DoctestItem]: @@ -449,7 +452,7 @@ def _check_all_skipped(test: "doctest.DocTest") -> None: all_skipped = all(x.options.get(doctest.SKIP, False) for x in test.examples) if all_skipped: - pytest.skip("all tests skipped by +SKIP option") + skip("all tests skipped by +SKIP option") def _is_mocked(obj: object) -> bool: @@ -491,7 +494,7 @@ def _mock_aware_unwrap( inspect.unwrap = real_unwrap -class DoctestModule(pytest.Module): +class DoctestModule(Module): def collect(self) -> Iterable[DoctestItem]: import doctest @@ -549,7 +552,7 @@ def _find( ) except ImportError: if self.config.getvalue("doctest_ignore_import_errors"): - pytest.skip("unable to import module %r" % self.path) + skip("unable to import module %r" % self.path) else: raise # Uses internal doctest module parsing mechanism. @@ -731,7 +734,7 @@ def _get_report_choice(key: str) -> int: }[key] -@pytest.fixture(scope="session") +@fixture(scope="session") def doctest_namespace() -> Dict[str, Any]: """Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index c1634e296bc..f25ecde9c47 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -18,6 +18,7 @@ from _pytest.config.argparsing import OptionGroup from _pytest.config.argparsing import Parser from _pytest.debugging import pytestPDB as __pytestPDB +from _pytest.doctest import DoctestItem from _pytest.fixtures import fixture from _pytest.fixtures import FixtureLookupError from _pytest.fixtures import FixtureRequest @@ -92,6 +93,7 @@ "Config", "console_main", "deprecated_call", + "DoctestItem", "exit", "ExceptionInfo", "ExitCode", From a501518a26fa854e62615b2f22285407266ceaaf Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 8 Oct 2022 00:58:51 +0300 Subject: [PATCH 203/255] Revert "ci: fix PR not triggering workflows by switching back to pytestbot access token" --- .github/workflows/backport.yml | 2 +- .github/workflows/prepare-release-pr.yml | 4 ++-- .github/workflows/update-plugin-list.yml | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index d007d323dd1..f7840d537cf 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -48,4 +48,4 @@ jobs: --title "${subject}" \ --body "Backport of PR #${{ github.event.number }} to $target_branch branch. PR created by backport workflow." env: - GITHUB_TOKEN: ${{ secrets.CHATOPS }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/prepare-release-pr.yml b/.github/workflows/prepare-release-pr.yml index 4f90662e0ca..429834b3f21 100644 --- a/.github/workflows/prepare-release-pr.yml +++ b/.github/workflows/prepare-release-pr.yml @@ -44,9 +44,9 @@ jobs: - name: Prepare release PR (minor/patch release) if: github.event.inputs.major == 'no' run: | - tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.CHATOPS }} --prerelease='${{ github.event.inputs.prerelease }}' + tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --prerelease='${{ github.event.inputs.prerelease }}' - name: Prepare release PR (major release) if: github.event.inputs.major == 'yes' run: | - tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.CHATOPS }} --major --prerelease='${{ github.event.inputs.prerelease }}' + tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --major --prerelease='${{ github.event.inputs.prerelease }}' diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index f4fb81fdaa9..193469072ff 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -38,7 +38,7 @@ jobs: run: python scripts/update-plugin-list.py - name: Create Pull Request - uses: peter-evans/create-pull-request@671dc9c9e0c2d73f07fa45a3eb0220e1622f0c5f + uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6 with: commit-message: '[automated] Update plugin list' author: 'pytest bot ' @@ -47,4 +47,3 @@ jobs: branch-suffix: short-commit-hash title: '[automated] Update plugin list' body: '[automated] Update plugin list' - token: ${{ secrets.CHATOPS }} From d8c783268c6876379f5a3a0251b72d0d6d22d0cf Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:18:26 +0200 Subject: [PATCH 204/255] fix #7792: consider marks from the mro closes #9105 as superseeded --- changelog/7792.bugfix.rst | 1 + src/_pytest/mark/structures.py | 29 +++++++++++++++++++++++------ testing/test_mark.py | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 changelog/7792.bugfix.rst diff --git a/changelog/7792.bugfix.rst b/changelog/7792.bugfix.rst new file mode 100644 index 00000000000..00e09ebe849 --- /dev/null +++ b/changelog/7792.bugfix.rst @@ -0,0 +1 @@ +Consider the full mro when getting marks from classes. diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 800a25c9243..e9e00612529 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -355,12 +355,29 @@ def __call__(self, *args: object, **kwargs: object): return self.with_args(*args, **kwargs) -def get_unpacked_marks(obj: object) -> Iterable[Mark]: +def get_unpacked_marks( + obj: object | type, + consider_mro: bool = True, +) -> List[Mark]: """Obtain the unpacked marks that are stored on an object.""" - mark_list = getattr(obj, "pytestmark", []) - if not isinstance(mark_list, list): - mark_list = [mark_list] - return normalize_mark_list(mark_list) + if isinstance(obj, type): + if not consider_mro: + mark_lists = [obj.__dict__.get("pytestmark", [])] + else: + mark_lists = [x.__dict__.get("pytestmark", []) for x in obj.__mro__] + mark_list = [] + for item in mark_lists: + if isinstance(item, list): + mark_list.extend(item) + else: + mark_list.append(item) + else: + mark_attribute = getattr(obj, "pytestmark", []) + if isinstance(mark_attribute, list): + mark_list = mark_attribute + else: + mark_list = [mark_attribute] + return list(normalize_mark_list(mark_list)) def normalize_mark_list( @@ -388,7 +405,7 @@ def store_mark(obj, mark: Mark) -> None: assert isinstance(mark, Mark), mark # Always reassign name to avoid updating pytestmark in a reference that # was only borrowed. - obj.pytestmark = [*get_unpacked_marks(obj), mark] + obj.pytestmark = [*get_unpacked_marks(obj, consider_mro=False), mark] # Typing for builtin pytest marks. This is cheating; it gives builtin marks diff --git a/testing/test_mark.py b/testing/test_mark.py index 65f2581bd63..8c20fe8b17d 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1109,3 +1109,26 @@ def test_foo(): result = pytester.runpytest(foo, "-m", expr) result.stderr.fnmatch_lines([expected]) assert result.ret == ExitCode.USAGE_ERROR + + +def test_mark_mro(): + @pytest.mark.xfail("a") + class A: + pass + + @pytest.mark.xfail("b") + class B: + pass + + @pytest.mark.xfail("c") + class C(A, B): + pass + + from _pytest.mark.structures import get_unpacked_marks + + all_marks = list(get_unpacked_marks(C)) + + nk = [(x.name, x.args[0]) for x in all_marks] + assert nk == [("xfail", "c"), ("xfail", "a"), ("xfail", "b")] + + assert list(get_unpacked_marks(C, consider_mro=False)) == [] From 4e7486d3fb95f97422283fc7f21b24e8aa6ef2c8 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:28:03 +0200 Subject: [PATCH 205/255] fixup: annotations --- src/_pytest/mark/structures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index e9e00612529..0b1daefd639 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -356,7 +356,7 @@ def __call__(self, *args: object, **kwargs: object): def get_unpacked_marks( - obj: object | type, + obj: Union[object, type], consider_mro: bool = True, ) -> List[Mark]: """Obtain the unpacked marks that are stored on an object.""" From 13e594a31474136fb185eff7084760f724897d6b Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:35:26 +0200 Subject: [PATCH 206/255] fixup: mark mro test reformatt --- testing/test_mark.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/testing/test_mark.py b/testing/test_mark.py index 8c20fe8b17d..6199dc0b374 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1112,23 +1112,24 @@ def test_foo(): def test_mark_mro(): - @pytest.mark.xfail("a") + xfail = pytest.mark.xfail + + @xfail("a") class A: pass - @pytest.mark.xfail("b") + @xfail("b") class B: pass - @pytest.mark.xfail("c") + @xfail("c") class C(A, B): pass from _pytest.mark.structures import get_unpacked_marks - all_marks = list(get_unpacked_marks(C)) + all_marks = get_unpacked_marks(C) - nk = [(x.name, x.args[0]) for x in all_marks] - assert nk == [("xfail", "c"), ("xfail", "a"), ("xfail", "b")] + assert all_marks == [xfail("c").mark, xfail("a").mark, xfail("b").mark] - assert list(get_unpacked_marks(C, consider_mro=False)) == [] + assert get_unpacked_marks(C, consider_mro=False) == [pytest.mark.xfail("c").mark] From c42bb36009445e0cf1915dd5d1b762639a710675 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:35:53 +0200 Subject: [PATCH 207/255] fixup: mark mro test reformatt --- testing/test_mark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_mark.py b/testing/test_mark.py index 6199dc0b374..ebb70e2470b 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1132,4 +1132,4 @@ class C(A, B): assert all_marks == [xfail("c").mark, xfail("a").mark, xfail("b").mark] - assert get_unpacked_marks(C, consider_mro=False) == [pytest.mark.xfail("c").mark] + assert get_unpacked_marks(C, consider_mro=False) == [xfail("c").mark] From a28d595b4686b074101ba5d9b5cf7498361f75c6 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sat, 1 Oct 2022 11:44:06 +0200 Subject: [PATCH 208/255] doc: add note to help modernize code bases to use pathlib Fixes #10199 --- doc/en/how-to/tmp_path.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/en/how-to/tmp_path.rst b/doc/en/how-to/tmp_path.rst index 99e9e55367a..a2f936d3352 100644 --- a/doc/en/how-to/tmp_path.rst +++ b/doc/en/how-to/tmp_path.rst @@ -109,6 +109,17 @@ rather than standard :class:`pathlib.Path` objects. .. note:: These days, it is preferred to use ``tmp_path`` and ``tmp_path_factory``. + In order to help modernize old code bases, one can run pytest with the legacypath + plugin disabled: + + .. code-block:: bash + + pytest -p no:legacypath + + This will trigger errors on tests using the legacy paths. + It can also be permanently set as part of the :confval:`addopts` parameter in the + config file. + See :fixture:`tmpdir ` :fixture:`tmpdir_factory ` API for details. From d0abfb1c2a2642df68634c6d79ffd06d5855a7dd Mon Sep 17 00:00:00 2001 From: Anton Yakutovich Date: Sun, 9 Oct 2022 16:27:35 +0400 Subject: [PATCH 209/255] Bump actions in test.yml --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33b32a1abaa..3f3e7e535eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -154,13 +154,13 @@ jobs: use_coverage: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 persist-credentials: false - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -183,7 +183,7 @@ jobs: - name: Upload coverage to Codecov if: "matrix.use_coverage" - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: fail_ci_if_error: true files: ./coverage.xml From 3bf2bc55b12e8540b4bb5311db2463845be12fbd Mon Sep 17 00:00:00 2001 From: Simon K Date: Sun, 9 Oct 2022 21:16:33 +0100 Subject: [PATCH 210/255] Add deprecations for tests written for `nose` (#9907) Fixes #9886 --- .gitignore | 1 + changelog/9886.deprecation.rst | 10 +++ doc/en/deprecations.rst | 107 +++++++++++++++++++++++++++++++++ doc/en/how-to/nose.rst | 3 + doc/en/how-to/xunit_setup.rst | 2 + src/_pytest/deprecated.py | 15 +++++ src/_pytest/nose.py | 14 ++++- src/_pytest/python.py | 21 ++++++- testing/deprecated_test.py | 59 ++++++++++++++++++ testing/test_nose.py | 4 +- 10 files changed, 230 insertions(+), 6 deletions(-) create mode 100644 changelog/9886.deprecation.rst diff --git a/.gitignore b/.gitignore index 935da3b9a2e..3cac2474a59 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ coverage.xml .project .settings .vscode +__pycache__/ # generated by pip pip-wheel-metadata/ diff --git a/changelog/9886.deprecation.rst b/changelog/9886.deprecation.rst new file mode 100644 index 00000000000..94f51decfda --- /dev/null +++ b/changelog/9886.deprecation.rst @@ -0,0 +1,10 @@ +The functionality for running tests written for ``nose`` has been officially deprecated. + +This includes: + +* Plain ``setup`` and ``teardown`` functions and methods: this might catch users by surprise, as ``setup()`` and ``teardown()`` are not pytest idioms, but part of the ``nose`` support. +* Setup/teardown using the `@with_setup `_ decorator. + +For more details, consult the :ref:`deprecation docs `. + +.. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index a18d9d713b0..a73c11fb846 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -18,6 +18,113 @@ Deprecated Features Below is a complete list of all pytest features which are considered deprecated. Using those features will issue :class:`~pytest.PytestWarning` or subclasses, which can be filtered using :ref:`standard warning filters `. + +.. _nose-deprecation: + +Support for tests written for nose +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 7.2 + +Support for running tests written for `nose `__ is now deprecated. + +``nose`` has been in maintenance mode-only for years, and maintaining the plugin is not trivial as it spills +over the code base (see :issue:`9886` for more details). + +setup/teardown +^^^^^^^^^^^^^^ + +One thing that might catch users by surprise is that plain ``setup`` and ``teardown`` methods are not pytest native, +they are in fact part of the ``nose`` support. + + +.. code-block:: python + + class Test: + def setup(self): + self.resource = make_resource() + + def teardown(self): + self.resource.close() + + def test_foo(self): + ... + + def test_bar(self): + ... + + + +Native pytest support uses ``setup_method`` and ``teardown_method`` (see :ref:`xunit-method-setup`), so the above should be changed to: + +.. code-block:: python + + class Test: + def setup_method(self): + self.resource = make_resource() + + def teardown_method(self): + self.resource.close() + + def test_foo(self): + ... + + def test_bar(self): + ... + + +This is easy to do in an entire code base by doing a simple find/replace. + +@with_setup +^^^^^^^^^^^ + +Code using `@with_setup `_ such as this: + +.. code-block:: python + + from nose.tools import with_setup + + + def setup_some_resource(): + ... + + + def teardown_some_resource(): + ... + + + @with_setup(setup_some_resource, teardown_some_resource) + def test_foo(): + ... + +Will also need to be ported to a supported pytest style. One way to do it is using a fixture: + +.. code-block:: python + + import pytest + + + def setup_some_resource(): + ... + + + def teardown_some_resource(): + ... + + + @pytest.fixture + def some_resource(): + setup_some_resource() + yield + teardown_some_resource() + + + def test_foo(some_resource): + ... + + +.. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup + .. _instance-collector-deprecation: The ``pytest.Instance`` collector diff --git a/doc/en/how-to/nose.rst b/doc/en/how-to/nose.rst index 621c243b283..a736dfa55a7 100644 --- a/doc/en/how-to/nose.rst +++ b/doc/en/how-to/nose.rst @@ -5,6 +5,9 @@ How to run tests written for nose ``pytest`` has basic support for running tests written for nose_. +.. warning:: + This functionality has been deprecated and is likely to be removed in ``pytest 8.x``. + .. _nosestyle: Usage diff --git a/doc/en/how-to/xunit_setup.rst b/doc/en/how-to/xunit_setup.rst index eb432a4053d..3de6681ff8f 100644 --- a/doc/en/how-to/xunit_setup.rst +++ b/doc/en/how-to/xunit_setup.rst @@ -63,6 +63,8 @@ and after all test methods of the class are called: setup_class. """ +.. _xunit-method-setup: + Method and function level setup/teardown ----------------------------------------------- diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 623bb02365f..b9c10df7a00 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -22,6 +22,21 @@ "pytest_faulthandler", } +NOSE_SUPPORT = UnformattedWarning( + PytestRemovedIn8Warning, + "Support for nose tests is deprecated and will be removed in a future release.\n" + "{nodeid} is using nose method: `{method}` ({stage})\n" + "See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose", +) + +NOSE_SUPPORT_METHOD = UnformattedWarning( + PytestRemovedIn8Warning, + "Support for nose tests is deprecated and will be removed in a future release.\n" + "{nodeid} is using nose-specific method: `{method}(self)`\n" + "To remove this warning, rename it to `{method}_method(self)`\n" + "See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose", +) + # 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". diff --git a/src/_pytest/nose.py b/src/_pytest/nose.py index b0699d22bd8..273bd045fb6 100644 --- a/src/_pytest/nose.py +++ b/src/_pytest/nose.py @@ -1,5 +1,8 @@ """Run testsuites written for nose.""" +import warnings + from _pytest.config import hookimpl +from _pytest.deprecated import NOSE_SUPPORT from _pytest.fixtures import getfixturemarker from _pytest.nodes import Item from _pytest.python import Function @@ -18,8 +21,8 @@ def pytest_runtest_setup(item: Item) -> None: # see https://github.com/python/mypy/issues/2608 func = item - call_optional(func.obj, "setup") - func.addfinalizer(lambda: call_optional(func.obj, "teardown")) + call_optional(func.obj, "setup", func.nodeid) + func.addfinalizer(lambda: call_optional(func.obj, "teardown", func.nodeid)) # NOTE: Module- and class-level fixtures are handled in python.py # with `pluginmanager.has_plugin("nose")` checks. @@ -27,7 +30,7 @@ def pytest_runtest_setup(item: Item) -> None: # it's not straightforward. -def call_optional(obj: object, name: str) -> bool: +def call_optional(obj: object, name: str, nodeid: str) -> bool: method = getattr(obj, name, None) if method is None: return False @@ -36,6 +39,11 @@ def call_optional(obj: object, name: str) -> bool: return False if not callable(method): return False + # Warn about deprecation of this plugin. + method_name = getattr(method, "__name__", str(method)) + warnings.warn( + NOSE_SUPPORT.format(nodeid=nodeid, method=method_name, stage=name), stacklevel=2 + ) # If there are any problems allow the exception to raise rather than # silently ignoring it. method() diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 3db8775061b..1e30d42ce9c 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -59,6 +59,7 @@ from _pytest.deprecated import check_ispytest from _pytest.deprecated import FSCOLLECTOR_GETHOOKPROXY_ISINITPATH from _pytest.deprecated import INSTANCE_COLLECTOR +from _pytest.deprecated import NOSE_SUPPORT_METHOD from _pytest.fixtures import FuncFixtureInfo from _pytest.main import Session from _pytest.mark import MARK_GEN @@ -872,19 +873,23 @@ def _inject_setup_method_fixture(self) -> None: """Inject a hidden autouse, function scoped fixture into the collected class object that invokes setup_method/teardown_method if either or both are available. - Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with + Using a fixture to invoke these methods ensures we play nicely and unsurprisingly with other fixtures (#517). """ has_nose = self.config.pluginmanager.has_plugin("nose") setup_name = "setup_method" setup_method = _get_first_non_fixture_func(self.obj, (setup_name,)) + emit_nose_setup_warning = False if setup_method is None and has_nose: setup_name = "setup" + emit_nose_setup_warning = True setup_method = _get_first_non_fixture_func(self.obj, (setup_name,)) teardown_name = "teardown_method" teardown_method = getattr(self.obj, teardown_name, None) + emit_nose_teardown_warning = False if teardown_method is None and has_nose: teardown_name = "teardown" + emit_nose_teardown_warning = True teardown_method = getattr(self.obj, teardown_name, None) if setup_method is None and teardown_method is None: return @@ -900,10 +905,24 @@ def xunit_setup_method_fixture(self, request) -> Generator[None, None, None]: if setup_method is not None: func = getattr(self, setup_name) _call_with_optional_argument(func, method) + if emit_nose_setup_warning: + warnings.warn( + NOSE_SUPPORT_METHOD.format( + nodeid=request.node.nodeid, method="setup" + ), + stacklevel=2, + ) yield if teardown_method is not None: func = getattr(self, teardown_name) _call_with_optional_argument(func, method) + if emit_nose_teardown_warning: + warnings.warn( + NOSE_SUPPORT_METHOD.format( + nodeid=request.node.nodeid, method="teardown" + ), + stacklevel=2, + ) self.obj.__pytest_setup_method = xunit_setup_method_fixture diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index d468b443541..3ceed7f5a2c 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -279,3 +279,62 @@ def test_importing_instance_is_deprecated(pytester: Pytester) -> None: match=re.escape("The pytest.Instance collector type is deprecated"), ): from _pytest.python import Instance # noqa: F401 + + +@pytest.mark.filterwarnings("default") +def test_nose_deprecated_with_setup(pytester: Pytester) -> None: + pytest.importorskip("nose") + pytester.makepyfile( + """ + from nose.tools import with_setup + + def setup_fn_no_op(): + ... + + def teardown_fn_no_op(): + ... + + @with_setup(setup_fn_no_op, teardown_fn_no_op) + def test_omits_warnings(): + ... + """ + ) + output = pytester.runpytest() + message = [ + "*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.", + "*test_nose_deprecated_with_setup.py::test_omits_warnings is using nose method: `setup_fn_no_op` (setup)", + "*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.", + "*test_nose_deprecated_with_setup.py::test_omits_warnings is using nose method: `teardown_fn_no_op` (teardown)", + ] + output.stdout.fnmatch_lines(message) + output.assert_outcomes(passed=1) + + +@pytest.mark.filterwarnings("default") +def test_nose_deprecated_setup_teardown(pytester: Pytester) -> None: + pytest.importorskip("nose") + pytester.makepyfile( + """ + class Test: + + def setup(self): + ... + + def teardown(self): + ... + + def test(self): + ... + """ + ) + output = pytester.runpytest() + message = [ + "*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.", + "*test_nose_deprecated_setup_teardown.py::Test::test is using nose-specific method: `setup(self)`", + "*To remove this warning, rename it to `setup_method(self)`", + "*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.", + "*test_nose_deprecated_setup_teardown.py::Test::test is using nose-specific method: `teardown(self)`", + "*To remove this warning, rename it to `teardown_method(self)`", + ] + output.stdout.fnmatch_lines(message) + output.assert_outcomes(passed=1) diff --git a/testing/test_nose.py b/testing/test_nose.py index cab5a81a2b9..92d6b95fd87 100644 --- a/testing/test_nose.py +++ b/testing/test_nose.py @@ -37,7 +37,7 @@ class A: def f(self): values.append(1) - call_optional(A(), "f") + call_optional(A(), "f", "A.f") assert not values @@ -47,7 +47,7 @@ def test_setup_func_not_callable() -> None: class A: f = 1 - call_optional(A(), "f") + call_optional(A(), "f", "A.f") def test_nose_setup_func(pytester: Pytester) -> None: From 196f01965ed264e1fd917db236c872f85403753d Mon Sep 17 00:00:00 2001 From: Vivaan Verma Date: Sun, 9 Oct 2022 21:42:42 +0100 Subject: [PATCH 211/255] Replace entrypoint example with `pyproject.toml` in docs (#10359) Fixes #10344 --- AUTHORS | 1 + changelog/10344.doc.rst | 1 + doc/en/how-to/writing_plugins.rst | 40 ++++++++++++++++++------------- 3 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 changelog/10344.doc.rst diff --git a/AUTHORS b/AUTHORS index ca2872f32a4..4e15caf8e90 100644 --- a/AUTHORS +++ b/AUTHORS @@ -356,6 +356,7 @@ Victor Uriarte Vidar T. Fauske Virgil Dupras Vitaly Lashmanov +Vivaan Verma Vlad Dragos Vlad Radziuk Vladyslav Rachek diff --git a/changelog/10344.doc.rst b/changelog/10344.doc.rst new file mode 100644 index 00000000000..1c7885edc20 --- /dev/null +++ b/changelog/10344.doc.rst @@ -0,0 +1 @@ +Update information on writing plugins to use ``pyproject.toml`` instead of ``setup.py``. diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 2fbf49718ce..f15b69c2317 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -147,27 +147,33 @@ Making your plugin installable by others If you want to make your plugin externally available, you may define a so-called entry point for your distribution so -that ``pytest`` finds your plugin module. Entry points are -a feature that is provided by :std:doc:`setuptools:index`. pytest looks up -the ``pytest11`` entrypoint to discover its -plugins and you can thus make your plugin available by defining -it in your setuptools-invocation: +that ``pytest`` finds your plugin module. Entry points are +a feature that is provided by :std:doc:`setuptools `. -.. sourcecode:: python +pytest looks up the ``pytest11`` entrypoint to discover its +plugins, thus you can make your plugin available by defining +it in your ``pyproject.toml`` file. + +.. sourcecode:: toml + + # sample ./pyproject.toml file + [build-system] + requires = ["hatchling"] + build-backend = "hatchling.build" - # sample ./setup.py file - from setuptools import setup + [project] + name = "myproject" + classifiers = [ + "Framework :: Pytest", + ] + [tool.setuptools] + packages = ["myproject"] - name_of_plugin = "myproject" # register plugin with this name - setup( - name="myproject", - packages=["myproject"], - # the following makes a plugin available to pytest - entry_points={"pytest11": [f"{name_of_plugin} = myproject.pluginmodule"]}, - # custom PyPI classifier for pytest plugins - classifiers=["Framework :: Pytest"], - ) + [project.entry_points] + pytest11 = [ + "myproject = myproject.pluginmodule", + ] If a package is installed this way, ``pytest`` will load ``myproject.pluginmodule`` as a plugin which can define From 8a40fc53152e9430f66f4a7eb62e30eb21d0b311 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 10 Oct 2022 00:10:45 +0100 Subject: [PATCH 212/255] PytestReturnNotNoneWarning now subclasses PytestRemovedIn8Warning (#10196) As discussed in https://github.com/pytest-dev/pytest/pull/9956#issuecomment-1132710934. Also added PytestRemovedIn8Warning to the reference docs. --- changelog/10196.trivial.rst | 1 + doc/en/reference/reference.rst | 3 +++ src/_pytest/warning_types.py | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog/10196.trivial.rst diff --git a/changelog/10196.trivial.rst b/changelog/10196.trivial.rst new file mode 100644 index 00000000000..edf458f84c5 --- /dev/null +++ b/changelog/10196.trivial.rst @@ -0,0 +1 @@ +:class:`~pytest.PytestReturnNotNoneWarning` is now a subclass of :class:`~pytest.PytestRemovedIn8Warning`: the plan is to make returning non-``None`` from tests an error in the future. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index c4402ff41a0..6edb88b92c8 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1136,6 +1136,9 @@ Custom warnings generated in some situations such as improper usage or deprecate .. autoclass:: pytest.PytestReturnNotNoneWarning :show-inheritance: +.. autoclass:: pytest.PytestRemovedIn8Warning + :show-inheritance: + .. autoclass:: pytest.PytestUnhandledCoroutineWarning :show-inheritance: diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 3be1648fe61..620860c1bc4 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -51,14 +51,13 @@ class PytestDeprecationWarning(PytestWarning, DeprecationWarning): __module__ = "pytest" -@final class PytestRemovedIn8Warning(PytestDeprecationWarning): """Warning class for features that will be removed in pytest 8.""" __module__ = "pytest" -class PytestReturnNotNoneWarning(PytestDeprecationWarning): +class PytestReturnNotNoneWarning(PytestRemovedIn8Warning): """Warning emitted when a test function is returning value other than None.""" __module__ = "pytest" From 78c2c48c67f594235f63c927fd1fc0760ac79ade Mon Sep 17 00:00:00 2001 From: itxasos23 <115184221+itxasos23@users.noreply.github.com> Date: Mon, 10 Oct 2022 02:09:33 +0200 Subject: [PATCH 213/255] Handle NFC/NFD strings that normalize to the same string. (#10355) Co-authored-by: Zac Hatfield-Dodds --- AUTHORS | 1 + changelog/3426.improvement.rst | 1 + src/_pytest/_io/saferepr.py | 20 +++++++++++++++----- src/_pytest/assertion/util.py | 23 ++++++++++++++++++----- testing/test_assertion.py | 18 ++++++++++++++++++ 5 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 changelog/3426.improvement.rst diff --git a/AUTHORS b/AUTHORS index 4e15caf8e90..55b0237ea08 100644 --- a/AUTHORS +++ b/AUTHORS @@ -154,6 +154,7 @@ Ian Bicking Ian Lesperance Ilya Konstantinov Ionuț Turturică +Itxaso Aizpurua Iwan Briquemont Jaap Broekhuizen Jakob van Santen diff --git a/changelog/3426.improvement.rst b/changelog/3426.improvement.rst new file mode 100644 index 00000000000..e232d56aa6a --- /dev/null +++ b/changelog/3426.improvement.rst @@ -0,0 +1 @@ +Assertion failures with strings in NFC and NFD forms that normalize to the same string now have a dedicated error message detailing the issue, and their utf-8 representation is expresed instead. diff --git a/src/_pytest/_io/saferepr.py b/src/_pytest/_io/saferepr.py index a27e8c2a6a5..c701872238c 100644 --- a/src/_pytest/_io/saferepr.py +++ b/src/_pytest/_io/saferepr.py @@ -41,7 +41,7 @@ class SafeRepr(reprlib.Repr): information on exceptions raised during the call. """ - def __init__(self, maxsize: Optional[int]) -> None: + def __init__(self, maxsize: Optional[int], use_ascii: bool = False) -> None: """ :param maxsize: If not None, will truncate the resulting repr to that specific size, using ellipsis @@ -54,10 +54,15 @@ def __init__(self, maxsize: Optional[int]) -> None: # truncation. self.maxstring = maxsize if maxsize is not None else 1_000_000_000 self.maxsize = maxsize + self.use_ascii = use_ascii def repr(self, x: object) -> str: try: - s = super().repr(x) + if self.use_ascii: + s = ascii(x) + else: + s = super().repr(x) + except (KeyboardInterrupt, SystemExit): raise except BaseException as exc: @@ -94,7 +99,9 @@ def safeformat(obj: object) -> str: DEFAULT_REPR_MAX_SIZE = 240 -def saferepr(obj: object, maxsize: Optional[int] = DEFAULT_REPR_MAX_SIZE) -> str: +def saferepr( + obj: object, maxsize: Optional[int] = DEFAULT_REPR_MAX_SIZE, use_ascii: bool = False +) -> str: """Return a size-limited safe repr-string for the given object. Failing __repr__ functions of user instances will be represented @@ -104,10 +111,11 @@ def saferepr(obj: object, maxsize: Optional[int] = DEFAULT_REPR_MAX_SIZE) -> str This function is a wrapper around the Repr/reprlib functionality of the stdlib. """ - return SafeRepr(maxsize).repr(obj) + + return SafeRepr(maxsize, use_ascii).repr(obj) -def saferepr_unlimited(obj: object) -> str: +def saferepr_unlimited(obj: object, use_ascii: bool = True) -> str: """Return an unlimited-size safe repr-string for the given object. As with saferepr, failing __repr__ functions of user instances @@ -119,6 +127,8 @@ def saferepr_unlimited(obj: object) -> str: when maxsize=None, but that might affect some other code. """ try: + if use_ascii: + return ascii(obj) return repr(obj) except Exception as exc: return _format_repr_exception(exc, obj) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 0c34b83ea01..fc5dfdbd5ba 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -10,6 +10,7 @@ from typing import Mapping from typing import Optional from typing import Sequence +from unicodedata import normalize import _pytest._code from _pytest import outcomes @@ -156,20 +157,32 @@ def has_default_eq( return True -def assertrepr_compare(config, op: str, left: Any, right: Any) -> Optional[List[str]]: +def assertrepr_compare( + config, op: str, left: Any, right: Any, use_ascii: bool = False +) -> Optional[List[str]]: """Return specialised explanations for some operators/operands.""" verbose = config.getoption("verbose") + + # Strings which normalize equal are often hard to distinguish when printed; use ascii() to make this easier. + # See issue #3246. + use_ascii = ( + isinstance(left, str) + and isinstance(right, str) + and normalize("NFD", left) == normalize("NFD", right) + ) + if verbose > 1: - left_repr = saferepr_unlimited(left) - right_repr = saferepr_unlimited(right) + left_repr = saferepr_unlimited(left, use_ascii=use_ascii) + right_repr = saferepr_unlimited(right, use_ascii=use_ascii) else: # XXX: "15 chars indentation" is wrong # ("E AssertionError: assert "); should use term width. maxsize = ( 80 - 15 - len(op) - 2 ) // 2 # 15 chars indentation, 1 space around op - left_repr = saferepr(left, maxsize=maxsize) - right_repr = saferepr(right, maxsize=maxsize) + + left_repr = saferepr(left, maxsize=maxsize, use_ascii=use_ascii) + right_repr = saferepr(right, maxsize=maxsize, use_ascii=use_ascii) summary = f"{left_repr} {op} {right_repr}" diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 2bc06d65a2b..d8844f2e41d 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -776,6 +776,24 @@ def test_mojibake(self) -> None: msg = "\n".join(expl) assert msg + def test_nfc_nfd_same_string(self) -> None: + # issue 3426 + left = "hyv\xe4" + right = "hyva\u0308" + expl = callequal(left, right) + assert expl == [ + r"'hyv\xe4' == 'hyva\u0308'", + f"- {str(right)}", + f"+ {str(left)}", + ] + + expl = callequal(left, right, verbose=2) + assert expl == [ + r"'hyv\xe4' == 'hyva\u0308'", + f"- {str(right)}", + f"+ {str(left)}", + ] + class TestAssert_reprcompare_dataclass: def test_dataclasses(self, pytester: Pytester) -> None: From 07b380bb3a7e7debe700ad35415868f1c111dbbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 03:03:45 +0000 Subject: [PATCH 214/255] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.1.1...4.1.2) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... 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 82929c87a73..8524bf2b710 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.1.1 +django==4.1.2 pytest-asyncio==0.19.0 pytest-bdd==6.0.1 pytest-cov==4.0.0 From d8c5e8805fb2a0bb000974e448f93c38a6907e7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 03:03:48 +0000 Subject: [PATCH 215/255] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.9.0 to 3.10.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.9.0...v3.10.0) --- updated-dependencies: - dependency-name: pytest-mock 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 82929c87a73..9f12e8d4997 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==4.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.9.0 +pytest-mock==3.10.0 pytest-rerunfailures==10.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 From 3de63f9a9bf9d7c638d0b4d51b25c6edf04d779f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Oct 2022 00:32:50 +0000 Subject: [PATCH 216/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0) - [github.com/PyCQA/autoflake: v1.6.1 → v1.7.2](https://github.com/PyCQA/autoflake/compare/v1.6.1...v1.7.2) - [github.com/asottile/reorder_python_imports: v3.8.3 → v3.8.4](https://github.com/asottile/reorder_python_imports/compare/v3.8.3...v3.8.4) - [github.com/asottile/pyupgrade: v2.38.2 → v3.1.0](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.1.0) - [github.com/pre-commit/mirrors-mypy: v0.981 → v0.982](https://github.com/pre-commit/mirrors-mypy/compare/v0.981...v0.982) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19329cb21b8..fd359ded07f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: "3.10" repos: - repo: https://github.com/psf/black - rev: 22.8.0 + rev: 22.10.0 hooks: - id: black args: [--safe, --quiet] @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.6.1 + rev: v1.7.2 hooks: - id: autoflake name: autoflake @@ -39,12 +39,12 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.3 + rev: v3.8.4 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.38.2 + rev: v3.1.0 hooks: - id: pyupgrade args: [--py37-plus] @@ -58,7 +58,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.981 + rev: v0.982 hooks: - id: mypy files: ^(src/|testing/) From a9c66172d48a8c93422f1b40e803ad0506d666db Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 11 Oct 2022 08:11:15 -0300 Subject: [PATCH 217/255] Update to autoflake to 1.7.3 Fixes PyCQA/autoflake#168 --- .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 fd359ded07f..ce3a30f1ed9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.7.2 + rev: v1.7.3 hooks: - id: autoflake name: autoflake From f13f4360d3ff379144f32b4bbb4b4fa4a7a8cf23 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 12 Oct 2022 10:20:16 +0200 Subject: [PATCH 218/255] Apply suggestions from code review Co-authored-by: Ran Benita --- changelog/7792.bugfix.rst | 6 +++++- src/_pytest/mark/structures.py | 8 +++++++- testing/test_mark.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/changelog/7792.bugfix.rst b/changelog/7792.bugfix.rst index 00e09ebe849..8f65637896d 100644 --- a/changelog/7792.bugfix.rst +++ b/changelog/7792.bugfix.rst @@ -1 +1,5 @@ -Consider the full mro when getting marks from classes. +Marks are now inherited according to the full MRO in test classes. Previously, if a test class inherited from two or more classes, only marks from the first super-class would apply. + +When inheriting marks from super-classes, marks from the sub-classes are now ordered before marks from the super-classes, in MRO order. Previously it was the reverse. + +When inheriting marks from super-classes, the `pytestmark` attribute of the sub-class now only contains the marks directly applied to it. Previously, it also contained marks from its super-classes. Please note that this attribute should not normally be accessed directly; use :func:`pytest.Node.iter_markers` instead. diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 0b1daefd639..b93bf6ed9fc 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -357,9 +357,15 @@ def __call__(self, *args: object, **kwargs: object): def get_unpacked_marks( obj: Union[object, type], + *, consider_mro: bool = True, ) -> List[Mark]: - """Obtain the unpacked marks that are stored on an object.""" + """Obtain the unpacked marks that are stored on an object. + + If obj is a class and consider_mro is true, return marks applied to + this class and all of its super-classes in MRO order. If consider_mro + is false, only return marks applied directly to this class. + """ if isinstance(obj, type): if not consider_mro: mark_lists = [obj.__dict__.get("pytestmark", [])] diff --git a/testing/test_mark.py b/testing/test_mark.py index ebb70e2470b..e2d1a40c38a 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1111,7 +1111,7 @@ def test_foo(): assert result.ret == ExitCode.USAGE_ERROR -def test_mark_mro(): +def test_mark_mro() -> None: xfail = pytest.mark.xfail @xfail("a") From c543e0c4e83f63943efb0cb06b6c94990c4eb0a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 08:21:16 +0000 Subject: [PATCH 219/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/mark/structures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index b93bf6ed9fc..5186c9ea3b6 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -361,7 +361,7 @@ def get_unpacked_marks( consider_mro: bool = True, ) -> List[Mark]: """Obtain the unpacked marks that are stored on an object. - + If obj is a class and consider_mro is true, return marks applied to this class and all of its super-classes in MRO order. If consider_mro is false, only return marks applied directly to this class. From 86602ce6e0683098c622e2aad530f989742bf6c9 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Wed, 12 Oct 2022 11:51:26 -0400 Subject: [PATCH 220/255] Fix packaging example --- doc/en/explanation/goodpractices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 5277c2ac54a..6b3af861a0d 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -22,7 +22,7 @@ The first few lines should look like this: requires = ["hatchling"] build-backend = "hatchling.build" - [metadata] + [project] name = "PACKAGENAME" where ``PACKAGENAME`` is the name of your package. From 6e7917c1a09c2174f143b34789c202a8b1a855e9 Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Thu, 13 Oct 2022 18:20:46 -0400 Subject: [PATCH 221/255] Don't break into `pdb` for `raise unittest.SkipTest()` --- src/_pytest/debugging.py | 5 ++++- testing/test_debugging.py | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index b99c3fe2d31..a3f80802cab 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -3,6 +3,7 @@ import functools import sys import types +import unittest from typing import Any from typing import Callable from typing import Generator @@ -293,7 +294,9 @@ def pytest_exception_interact( sys.stdout.write(out) sys.stdout.write(err) assert call.excinfo is not None - _enter_pdb(node, call.excinfo, report) + + if not isinstance(call.excinfo.value, unittest.SkipTest): + _enter_pdb(node, call.excinfo, report) def pytest_internalerror(self, excinfo: ExceptionInfo[BaseException]) -> None: tb = _postmortem_traceback(excinfo) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index 08ae09658ac..6761e61a967 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -123,6 +123,18 @@ def test_func(): ) assert rep.skipped assert len(pdblist) == 0 + + def test_pdb_on_raise_skiptest(self, pytester, pdblist) -> None: + rep = runpdb_and_get_report( + pytester, + """ + import unittest + + raise unittest.SkipTest("This is a common way to skip an entire file.") + """, + ) + assert rep.skipped + assert len(pdblist) == 0 def test_pdb_on_BdbQuit(self, pytester, pdblist) -> None: rep = runpdb_and_get_report( From 452617686c8d08e54b9974e30c8456726f6677c5 Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:53:06 -0400 Subject: [PATCH 222/255] Test fix --- testing/test_debugging.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index 6761e61a967..eecc1e39fd3 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -20,9 +20,18 @@ def pdb_env(request): pytester._monkeypatch.setenv("PDBPP_HIJACK_PDB", "0") -def runpdb_and_get_report(pytester: Pytester, source: str): +def runpdb(pytester: Pytester, source: str): p = pytester.makepyfile(source) - result = pytester.runpytest_inprocess("--pdb", p) + return pytester.runpytest_inprocess("--pdb", p) + + +def runpdb_and_get_stdout(pytester: Pytester, source: str): + result = runpdb(pytester, source) + return result.stdout.str() + + +def runpdb_and_get_report(pytester: Pytester, source: str): + result = runpdb(pytester, source) reports = result.reprec.getreports("pytest_runtest_logreport") # type: ignore[attr-defined] assert len(reports) == 3, reports # setup/call/teardown return reports[1] @@ -123,18 +132,16 @@ def test_func(): ) assert rep.skipped assert len(pdblist) == 0 - - def test_pdb_on_raise_skiptest(self, pytester, pdblist) -> None: - rep = runpdb_and_get_report( + + def test_pdb_on_top_level_raise_skiptest(self, pytester, pdblist) -> None: + stdout = runpdb_and_get_stdout( pytester, """ import unittest - raise unittest.SkipTest("This is a common way to skip an entire file.") """, ) - assert rep.skipped - assert len(pdblist) == 0 + assert "entering PDB" not in stdout, stdout def test_pdb_on_BdbQuit(self, pytester, pdblist) -> None: rep = runpdb_and_get_report( From f3d7e984abe4105c0e5c253e1b2f42be6ecae619 Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:58:59 -0400 Subject: [PATCH 223/255] Changelog --- changelog/10382.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/10382.bugfix.rst diff --git a/changelog/10382.bugfix.rst b/changelog/10382.bugfix.rst new file mode 100644 index 00000000000..5876a9a43c2 --- /dev/null +++ b/changelog/10382.bugfix.rst @@ -0,0 +1 @@ +Do not break into pdb when ``raise unittest.SkipTest()`` appears top-level in a file. From 0bc9ffcc8782fd126d0a9ce95ce130d1d760d2cb Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Fri, 14 Oct 2022 14:01:20 -0400 Subject: [PATCH 224/255] Add Gabriel Landau to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 55b0237ea08..7da1f8a0c57 100644 --- a/AUTHORS +++ b/AUTHORS @@ -129,6 +129,7 @@ Feng Ma Florian Bruhin Florian Dahlitz Floris Bruynooghe +Gabriel Landau Gabriel Reis Garvit Shubham Gene Wood From 2b6622fdd3678c37cdd2fc13f404546ac1a76de6 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:10:21 -0500 Subject: [PATCH 225/255] :wrench: Negating --showlocals with --no-showlocals This is necessary for addopts=--showlocals where individual test runs need to not show locals. --- src/_pytest/terminal.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 9739a467a66..d967a3ee6f1 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -178,6 +178,12 @@ def pytest_addoption(parser: Parser) -> None: default=False, help="Show locals in tracebacks (disabled by default)", ) + group._addoption( + "--no-showlocals", + action="store_false", + dest="showlocals", + help="Hide locals in tracebacks (negate --showlocals passed through addopts)", + ) group._addoption( "--tb", metavar="style", From 3a8d401ac78f2c112a1d78160868f7d2ac09b4c7 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:20:33 -0500 Subject: [PATCH 226/255] test(--no-showlocals): Should hide locals when addopts=--showlocals --- testing/test_terminal.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 9a8dd4d9ac9..9de9a85f093 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -998,6 +998,22 @@ def test_showlocals(): ] ) + def test_noshowlocals_addopts_override(self, pytester: Pytester) -> None: + pytester.makeini("[pytest]\naddopts=--showlocals") + p1 = pytester.makepyfile( + """ + def test_noshowlocals(): + x = 3 + y = "x" * 5000 + assert 0 + """ + ) + + # Override global --showlocals for py.test via arg + result = pytester.runpytest(p1, "--no-showlocals") + result.stdout.no_fnmatch_line("x* = 3") + result.stdout.no_fnmatch_line("y* = 'xxxxxx*") + def test_showlocals_short(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ From 7fada7127ed3b7c281164b0364429ce88df53b1a Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:37:53 -0500 Subject: [PATCH 227/255] docs(output): Note --no-show-locals --- doc/en/how-to/output.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index dc3a86ba29d..85081a47c61 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -12,8 +12,9 @@ Examples for modifying traceback printing: .. code-block:: bash - pytest --showlocals # show local variables in tracebacks - pytest -l # show local variables (shortcut) + pytest --showlocals # show local variables in tracebacks + pytest -l # show local variables (shortcut) + pytest --no-showlocals # hide local variables (if addopts enables them) pytest --tb=auto # (default) 'long' tracebacks for the first and last # entry, but 'short' style for the other entries From 2a33e6ab613f6de1a2cf54f0c4f39dd198729720 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:33:45 -0500 Subject: [PATCH 228/255] docs: Update changelog for --no-show-locals --- changelog/10381.improvement.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/10381.improvement.rst diff --git a/changelog/10381.improvement.rst b/changelog/10381.improvement.rst new file mode 100644 index 00000000000..f979a83b132 --- /dev/null +++ b/changelog/10381.improvement.rst @@ -0,0 +1 @@ +The ``--no-showlocals`` flag has been added. This can be passed directly to tests to override ``--showlocals`` declared through ``addopts``. From 8490ff52774be7276d7ba37e3950a7370a43c3e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 03:02:02 +0000 Subject: [PATCH 229/255] build(deps): Bump pytest-twisted in /testing/plugins_integration Bumps [pytest-twisted](https://github.com/pytest-dev/pytest-twisted) from 1.13.4 to 1.14.0. - [Release notes](https://github.com/pytest-dev/pytest-twisted/releases) - [Commits](https://github.com/pytest-dev/pytest-twisted/compare/v1.13.4...v1.14.0) --- updated-dependencies: - dependency-name: pytest-twisted 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 e76231d26a0..79156133348 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -10,6 +10,6 @@ pytest-mock==3.10.0 pytest-rerunfailures==10.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 -pytest-twisted==1.13.4 +pytest-twisted==1.14.0 twisted==22.8.0 pytest-xvfb==2.0.0 From c477ecd14674df7d1566a910c10f2444af6faf90 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 23:48:17 +0000 Subject: [PATCH 230/255] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/autoflake: v1.7.3 → v1.7.6](https://github.com/PyCQA/autoflake/compare/v1.7.3...v1.7.6) - [github.com/asottile/reorder_python_imports: v3.8.4 → v3.8.5](https://github.com/asottile/reorder_python_imports/compare/v3.8.4...v3.8.5) - [github.com/asottile/setup-cfg-fmt: v2.0.0 → v2.1.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.0.0...v2.1.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 ce3a30f1ed9..3cc1b1de718 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.7.3 + rev: v1.7.6 hooks: - id: autoflake name: autoflake @@ -39,7 +39,7 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.4 + rev: v3.8.5 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] @@ -49,7 +49,7 @@ repos: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.0.0 + rev: v2.1.0 hooks: - id: setup-cfg-fmt args: ["--max-py-version=3.10", "--include-version-classifiers"] From 19dda7c9bdc8ef71c792e0f77a9595bfad8d9248 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 10:10:49 -0400 Subject: [PATCH 231/255] vendor py.path and py.error --- .pre-commit-config.yaml | 1 - setup.cfg | 3 +- src/_pytest/_py/__init__.py | 0 src/_pytest/_py/error.py | 91 +++ src/_pytest/_py/path.py | 1489 +++++++++++++++++++++++++++++++++++ src/py.py | 10 + 6 files changed, 1592 insertions(+), 2 deletions(-) create mode 100644 src/_pytest/_py/__init__.py create mode 100644 src/_pytest/_py/error.py create mode 100644 src/_pytest/_py/path.py create mode 100644 src/py.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3cc1b1de718..de612d96988 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,7 +65,6 @@ repos: args: [] additional_dependencies: - iniconfig>=1.1.0 - - py>=1.8.2 - attrs>=19.2.0 - packaging - tomli diff --git a/setup.cfg b/setup.cfg index 38f50556c93..39ade4dff4c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,16 +36,17 @@ packages = _pytest _pytest._code _pytest._io + _pytest._py _pytest.assertion _pytest.config _pytest.mark pytest +py_modules = py install_requires = attrs>=19.2.0 iniconfig packaging pluggy>=0.12,<2.0 - py>=1.8.2 colorama;sys_platform=="win32" exceptiongroup>=1.0.0rc8;python_version<"3.11" importlib-metadata>=0.12;python_version<"3.8" diff --git a/src/_pytest/_py/__init__.py b/src/_pytest/_py/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/_pytest/_py/error.py b/src/_pytest/_py/error.py new file mode 100644 index 00000000000..e1e3ccd28af --- /dev/null +++ b/src/_pytest/_py/error.py @@ -0,0 +1,91 @@ +""" +create errno-specific classes for IO or os calls. + +""" +from types import ModuleType +import sys, os, errno + +class Error(EnvironmentError): + def __repr__(self): + return "%s.%s %r: %s " %(self.__class__.__module__, + self.__class__.__name__, + self.__class__.__doc__, + " ".join(map(str, self.args)), + #repr(self.args) + ) + + def __str__(self): + s = "[%s]: %s" %(self.__class__.__doc__, + " ".join(map(str, self.args)), + ) + return s + +_winerrnomap = { + 2: errno.ENOENT, + 3: errno.ENOENT, + 17: errno.EEXIST, + 18: errno.EXDEV, + 13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailiable + 22: errno.ENOTDIR, + 20: errno.ENOTDIR, + 267: errno.ENOTDIR, + 5: errno.EACCES, # anything better? +} + +class ErrorMaker(ModuleType): + """ lazily provides Exception classes for each possible POSIX errno + (as defined per the 'errno' module). All such instances + subclass EnvironmentError. + """ + Error = Error + _errno2class = {} + + def __getattr__(self, name): + if name[0] == "_": + raise AttributeError(name) + eno = getattr(errno, name) + cls = self._geterrnoclass(eno) + setattr(self, name, cls) + return cls + + def _geterrnoclass(self, eno): + try: + return self._errno2class[eno] + except KeyError: + clsname = errno.errorcode.get(eno, "UnknownErrno%d" %(eno,)) + errorcls = type(Error)(clsname, (Error,), + {'__module__':'py.error', + '__doc__': os.strerror(eno)}) + self._errno2class[eno] = errorcls + return errorcls + + def checked_call(self, func, *args, **kwargs): + """ call a function and raise an errno-exception if applicable. """ + __tracebackhide__ = True + try: + return func(*args, **kwargs) + except self.Error: + raise + except (OSError, EnvironmentError): + cls, value, tb = sys.exc_info() + if not hasattr(value, 'errno'): + raise + __tracebackhide__ = False + errno = value.errno + try: + if not isinstance(value, WindowsError): + raise NameError + except NameError: + # we are not on Windows, or we got a proper OSError + cls = self._geterrnoclass(errno) + else: + try: + cls = self._geterrnoclass(_winerrnomap[errno]) + except KeyError: + raise value + raise cls("%s%r" % (func.__name__, args)) + __tracebackhide__ = True + + +error = ErrorMaker('_pytest._py.error') +sys.modules[error.__name__] = error diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py new file mode 100644 index 00000000000..e8adbf27a79 --- /dev/null +++ b/src/_pytest/_py/path.py @@ -0,0 +1,1489 @@ +""" +local path implementation. +""" +from __future__ import with_statement + +from contextlib import contextmanager +import sys, os, atexit, io, uuid +from stat import S_ISLNK, S_ISDIR, S_ISREG + +from os.path import abspath, normpath, isabs, exists, isdir, isfile, islink, dirname + +import warnings +import os +import sys +import posixpath +import fnmatch + +from . import error + +# Moved from local.py. +iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt') + +try: + # FileNotFoundError might happen in py34, and is not available with py27. + import_errors = (ImportError, FileNotFoundError) +except NameError: + import_errors = (ImportError,) + +try: + from os import fspath +except ImportError: + def fspath(path): + """ + Return the string representation of the path. + If str or bytes is passed in, it is returned unchanged. + This code comes from PEP 519, modified to support earlier versions of + python. + + This is required for python < 3.6. + """ + if isinstance(path, (str, bytes)): + return path + + # Work from the object's type to match method resolution of other magic + # methods. + path_type = type(path) + try: + return path_type.__fspath__(path) + except AttributeError: + if hasattr(path_type, '__fspath__'): + raise + try: + import pathlib + except import_errors: + pass + else: + if isinstance(path, pathlib.PurePath): + return str(path) + + raise TypeError("expected str, bytes or os.PathLike object, not " + + path_type.__name__) + +class Checkers: + _depend_on_existence = 'exists', 'link', 'dir', 'file' + + def __init__(self, path): + self.path = path + + def dir(self): + raise NotImplementedError + + def file(self): + raise NotImplementedError + + def dotfile(self): + return self.path.basename.startswith('.') + + def ext(self, arg): + if not arg.startswith('.'): + arg = '.' + arg + return self.path.ext == arg + + def exists(self): + raise NotImplementedError + + def basename(self, arg): + return self.path.basename == arg + + def basestarts(self, arg): + return self.path.basename.startswith(arg) + + def relto(self, arg): + return self.path.relto(arg) + + def fnmatch(self, arg): + return self.path.fnmatch(arg) + + def endswith(self, arg): + return str(self.path).endswith(arg) + + def _evaluate(self, kw): + for name, value in kw.items(): + invert = False + meth = None + try: + meth = getattr(self, name) + except AttributeError: + if name[:3] == 'not': + invert = True + try: + meth = getattr(self, name[3:]) + except AttributeError: + pass + if meth is None: + raise TypeError( + "no %r checker available for %r" % (name, self.path)) + try: + if py.code.getrawcode(meth).co_argcount > 1: + if (not meth(value)) ^ invert: + return False + else: + if bool(value) ^ bool(meth()) ^ invert: + return False + except (error.ENOENT, error.ENOTDIR, error.EBUSY): + # EBUSY feels not entirely correct, + # but its kind of necessary since ENOMEDIUM + # is not accessible in python + for name in self._depend_on_existence: + if name in kw: + if kw.get(name): + return False + name = 'not' + name + if name in kw: + if not kw.get(name): + return False + return True + +class NeverRaised(Exception): + pass + +class PathBase(object): + """ shared implementation for filesystem path objects.""" + Checkers = Checkers + + def __div__(self, other): + return self.join(fspath(other)) + __truediv__ = __div__ # py3k + + def basename(self): + """ basename part of path. """ + return self._getbyspec('basename')[0] + basename = property(basename, None, None, basename.__doc__) + + def dirname(self): + """ dirname part of path. """ + return self._getbyspec('dirname')[0] + dirname = property(dirname, None, None, dirname.__doc__) + + def purebasename(self): + """ pure base name of the path.""" + return self._getbyspec('purebasename')[0] + purebasename = property(purebasename, None, None, purebasename.__doc__) + + def ext(self): + """ extension of the path (including the '.').""" + return self._getbyspec('ext')[0] + ext = property(ext, None, None, ext.__doc__) + + def dirpath(self, *args, **kwargs): + """ return the directory path joined with any given path arguments. """ + return self.new(basename='').join(*args, **kwargs) + + def read_binary(self): + """ read and return a bytestring from reading the path. """ + with self.open('rb') as f: + return f.read() + + def read_text(self, encoding): + """ read and return a Unicode string from reading the path. """ + with self.open("r", encoding=encoding) as f: + return f.read() + + + def read(self, mode='r'): + """ read and return a bytestring from reading the path. """ + with self.open(mode) as f: + return f.read() + + def readlines(self, cr=1): + """ read and return a list of lines from the path. if cr is False, the +newline will be removed from the end of each line. """ + if sys.version_info < (3, ): + mode = 'rU' + else: # python 3 deprecates mode "U" in favor of "newline" option + mode = 'r' + + if not cr: + content = self.read(mode) + return content.split('\n') + else: + f = self.open(mode) + try: + return f.readlines() + finally: + f.close() + + def load(self): + """ (deprecated) return object unpickled from self.read() """ + f = self.open('rb') + try: + import pickle + return error.checked_call(pickle.load, f) + finally: + f.close() + + def move(self, target): + """ move this path to target. """ + if target.relto(self): + raise error.EINVAL( + target, + "cannot move path into a subdirectory of itself") + try: + self.rename(target) + except error.EXDEV: # invalid cross-device link + self.copy(target) + self.remove() + + def __repr__(self): + """ return a string representation of this path. """ + return repr(str(self)) + + def check(self, **kw): + """ check a path for existence and properties. + + Without arguments, return True if the path exists, otherwise False. + + valid checkers:: + + file=1 # is a file + file=0 # is not a file (may not even exist) + dir=1 # is a dir + link=1 # is a link + exists=1 # exists + + You can specify multiple checker definitions, for example:: + + path.check(file=1, link=1) # a link pointing to a file + """ + if not kw: + kw = {'exists': 1} + return self.Checkers(self)._evaluate(kw) + + def fnmatch(self, pattern): + """return true if the basename/fullname matches the glob-'pattern'. + + valid pattern characters:: + + * matches everything + ? matches any single character + [seq] matches any character in seq + [!seq] matches any char not in seq + + If the pattern contains a path-separator then the full path + is used for pattern matching and a '*' is prepended to the + pattern. + + if the pattern doesn't contain a path-separator the pattern + is only matched against the basename. + """ + return FNMatcher(pattern)(self) + + def relto(self, relpath): + """ return a string which is the relative part of the path + to the given 'relpath'. + """ + if not isinstance(relpath, (str, PathBase)): + raise TypeError("%r: not a string or path object" %(relpath,)) + strrelpath = str(relpath) + if strrelpath and strrelpath[-1] != self.sep: + strrelpath += self.sep + #assert strrelpath[-1] == self.sep + #assert strrelpath[-2] != self.sep + strself = self.strpath + if sys.platform == "win32" or getattr(os, '_name', None) == 'nt': + if os.path.normcase(strself).startswith( + os.path.normcase(strrelpath)): + return strself[len(strrelpath):] + elif strself.startswith(strrelpath): + return strself[len(strrelpath):] + return "" + + def ensure_dir(self, *args): + """ ensure the path joined with args is a directory. """ + return self.ensure(*args, **{"dir": True}) + + def bestrelpath(self, dest): + """ return a string which is a relative path from self + (assumed to be a directory) to dest such that + self.join(bestrelpath) == dest and if not such + path can be determined return dest. + """ + try: + if self == dest: + return os.curdir + base = self.common(dest) + if not base: # can be the case on windows + return str(dest) + self2base = self.relto(base) + reldest = dest.relto(base) + if self2base: + n = self2base.count(self.sep) + 1 + else: + n = 0 + l = [os.pardir] * n + if reldest: + l.append(reldest) + target = dest.sep.join(l) + return target + except AttributeError: + return str(dest) + + def exists(self): + return self.check() + + def isdir(self): + return self.check(dir=1) + + def isfile(self): + return self.check(file=1) + + def parts(self, reverse=False): + """ return a root-first list of all ancestor directories + plus the path itself. + """ + current = self + l = [self] + while 1: + last = current + current = current.dirpath() + if last == current: + break + l.append(current) + if not reverse: + l.reverse() + return l + + def common(self, other): + """ return the common part shared with the other path + or None if there is no common part. + """ + last = None + for x, y in zip(self.parts(), other.parts()): + if x != y: + return last + last = x + return last + + def __add__(self, other): + """ return new path object with 'other' added to the basename""" + return self.new(basename=self.basename+str(other)) + + def __cmp__(self, other): + """ return sort value (-1, 0, +1). """ + try: + return cmp(self.strpath, other.strpath) + except AttributeError: + return cmp(str(self), str(other)) # self.path, other.path) + + def __lt__(self, other): + try: + return self.strpath < other.strpath + except AttributeError: + return str(self) < str(other) + + def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): + """ yields all paths below the current one + + fil is a filter (glob pattern or callable), if not matching the + path will not be yielded, defaulting to None (everything is + returned) + + rec is a filter (glob pattern or callable) that controls whether + a node is descended, defaulting to None + + ignore is an Exception class that is ignoredwhen calling dirlist() + on any of the paths (by default, all exceptions are reported) + + bf if True will cause a breadthfirst search instead of the + default depthfirst. Default: False + + sort if True will sort entries within each directory level. + """ + for x in Visitor(fil, rec, ignore, bf, sort).gen(self): + yield x + + def _sortlist(self, res, sort): + if sort: + if hasattr(sort, '__call__'): + warnings.warn(DeprecationWarning( + "listdir(sort=callable) is deprecated and breaks on python3" + ), stacklevel=3) + res.sort(sort) + else: + res.sort() + + def samefile(self, other): + """ return True if other refers to the same stat object as self. """ + return self.strpath == str(other) + + def __fspath__(self): + return self.strpath + +class Visitor: + def __init__(self, fil, rec, ignore, bf, sort): + if isinstance(fil, py.builtin._basestring): + fil = FNMatcher(fil) + if isinstance(rec, py.builtin._basestring): + self.rec = FNMatcher(rec) + elif not hasattr(rec, '__call__') and rec: + self.rec = lambda path: True + else: + self.rec = rec + self.fil = fil + self.ignore = ignore + self.breadthfirst = bf + self.optsort = sort and sorted or (lambda x: x) + + def gen(self, path): + try: + entries = path.listdir() + except self.ignore: + return + rec = self.rec + dirs = self.optsort([p for p in entries + if p.check(dir=1) and (rec is None or rec(p))]) + if not self.breadthfirst: + for subdir in dirs: + for p in self.gen(subdir): + yield p + for p in self.optsort(entries): + if self.fil is None or self.fil(p): + yield p + if self.breadthfirst: + for subdir in dirs: + for p in self.gen(subdir): + yield p + +class FNMatcher: + def __init__(self, pattern): + self.pattern = pattern + + def __call__(self, path): + pattern = self.pattern + + if (pattern.find(path.sep) == -1 and + iswin32 and + pattern.find(posixpath.sep) != -1): + # Running on Windows, the pattern has no Windows path separators, + # and the pattern has one or more Posix path separators. Replace + # the Posix path separators with the Windows path separator. + pattern = pattern.replace(posixpath.sep, path.sep) + + if pattern.find(path.sep) == -1: + name = path.basename + else: + name = str(path) # path.strpath # XXX svn? + if not os.path.isabs(pattern): + pattern = '*' + path.sep + pattern + return fnmatch.fnmatch(name, pattern) + + +if sys.version_info > (3,0): + def map_as_list(func, iter): + return list(map(func, iter)) +else: + map_as_list = map + +ALLOW_IMPORTLIB_MODE = sys.version_info > (3,5) +if ALLOW_IMPORTLIB_MODE: + import importlib + + +class Stat(object): + def __getattr__(self, name): + return getattr(self._osstatresult, "st_" + name) + + def __init__(self, path, osstatresult): + self.path = path + self._osstatresult = osstatresult + + @property + def owner(self): + if iswin32: + raise NotImplementedError("XXX win32") + import pwd + entry = error.checked_call(pwd.getpwuid, self.uid) + return entry[0] + + @property + def group(self): + """ return group name of file. """ + if iswin32: + raise NotImplementedError("XXX win32") + import grp + entry = error.checked_call(grp.getgrgid, self.gid) + return entry[0] + + def isdir(self): + return S_ISDIR(self._osstatresult.st_mode) + + def isfile(self): + return S_ISREG(self._osstatresult.st_mode) + + def islink(self): + st = self.path.lstat() + return S_ISLNK(self._osstatresult.st_mode) + +class PosixPath(PathBase): + def chown(self, user, group, rec=0): + """ change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. + """ + uid = getuserid(user) + gid = getgroupid(group) + if rec: + for x in self.visit(rec=lambda x: x.check(link=0)): + if x.check(link=0): + error.checked_call(os.chown, str(x), uid, gid) + error.checked_call(os.chown, str(self), uid, gid) + + def readlink(self): + """ return value of a symbolic link. """ + return error.checked_call(os.readlink, self.strpath) + + def mklinkto(self, oldname): + """ posix style hard link to another name. """ + error.checked_call(os.link, str(oldname), str(self)) + + def mksymlinkto(self, value, absolute=1): + """ create a symbolic link with the given value (pointing to another name). """ + if absolute: + error.checked_call(os.symlink, str(value), self.strpath) + else: + base = self.common(value) + # with posix local paths '/' is always a common base + relsource = self.__class__(value).relto(base) + reldest = self.relto(base) + n = reldest.count(self.sep) + target = self.sep.join(('..', )*n + (relsource, )) + error.checked_call(os.symlink, target, self.strpath) + +def getuserid(user): + import pwd + if not isinstance(user, int): + user = pwd.getpwnam(user)[2] + return user + +def getgroupid(group): + import grp + if not isinstance(group, int): + group = grp.getgrnam(group)[2] + return group + +FSBase = not iswin32 and PosixPath or PathBase + +class LocalPath(FSBase): + """ object oriented interface to os.path and other local filesystem + related information. + """ + class ImportMismatchError(ImportError): + """ raised on pyimport() if there is a mismatch of __file__'s""" + + sep = os.sep + class Checkers(Checkers): + def _stat(self): + try: + return self._statcache + except AttributeError: + try: + self._statcache = self.path.stat() + except error.ELOOP: + self._statcache = self.path.lstat() + return self._statcache + + def dir(self): + return S_ISDIR(self._stat().mode) + + def file(self): + return S_ISREG(self._stat().mode) + + def exists(self): + return self._stat() + + def link(self): + st = self.path.lstat() + return S_ISLNK(st.mode) + + def __init__(self, path=None, expanduser=False): + """ Initialize and return a local Path instance. + + Path can be relative to the current directory. + If path is None it defaults to the current working directory. + If expanduser is True, tilde-expansion is performed. + Note that Path instances always carry an absolute path. + Note also that passing in a local path object will simply return + the exact same path object. Use new() to get a new copy. + """ + if path is None: + self.strpath = error.checked_call(os.getcwd) + else: + try: + path = fspath(path) + except TypeError: + raise ValueError("can only pass None, Path instances " + "or non-empty strings to LocalPath") + if expanduser: + path = os.path.expanduser(path) + self.strpath = abspath(path) + + def __hash__(self): + s = self.strpath + if iswin32: + s = s.lower() + return hash(s) + + def __eq__(self, other): + s1 = fspath(self) + try: + s2 = fspath(other) + except TypeError: + return False + if iswin32: + s1 = s1.lower() + try: + s2 = s2.lower() + except AttributeError: + return False + return s1 == s2 + + def __ne__(self, other): + return not (self == other) + + def __lt__(self, other): + return fspath(self) < fspath(other) + + def __gt__(self, other): + return fspath(self) > fspath(other) + + def samefile(self, other): + """ return True if 'other' references the same file as 'self'. + """ + other = fspath(other) + if not isabs(other): + other = abspath(other) + if self == other: + return True + if not hasattr(os.path, "samefile"): + return False + return error.checked_call( + os.path.samefile, self.strpath, other) + + def remove(self, rec=1, ignore_errors=False): + """ remove a file or directory (or a directory tree if rec=1). + if ignore_errors is True, errors while removing directories will + be ignored. + """ + if self.check(dir=1, link=0): + if rec: + # force remove of readonly files on windows + if iswin32: + self.chmod(0o700, rec=1) + import shutil + error.checked_call( + shutil.rmtree, self.strpath, + ignore_errors=ignore_errors) + else: + error.checked_call(os.rmdir, self.strpath) + else: + if iswin32: + self.chmod(0o700) + error.checked_call(os.remove, self.strpath) + + def computehash(self, hashtype="md5", chunksize=524288): + """ return hexdigest of hashvalue for this file. """ + try: + try: + import hashlib as mod + except ImportError: + if hashtype == "sha1": + hashtype = "sha" + mod = __import__(hashtype) + hash = getattr(mod, hashtype)() + except (AttributeError, ImportError): + raise ValueError("Don't know how to compute %r hash" %(hashtype,)) + f = self.open('rb') + try: + while 1: + buf = f.read(chunksize) + if not buf: + return hash.hexdigest() + hash.update(buf) + finally: + f.close() + + def new(self, **kw): + """ create a modified version of this path. + the following keyword arguments modify various path parts:: + + a:/some/path/to/a/file.ext + xx drive + xxxxxxxxxxxxxxxxx dirname + xxxxxxxx basename + xxxx purebasename + xxx ext + """ + obj = object.__new__(self.__class__) + if not kw: + obj.strpath = self.strpath + return obj + drive, dirname, basename, purebasename,ext = self._getbyspec( + "drive,dirname,basename,purebasename,ext") + if 'basename' in kw: + if 'purebasename' in kw or 'ext' in kw: + raise ValueError("invalid specification %r" % kw) + else: + pb = kw.setdefault('purebasename', purebasename) + try: + ext = kw['ext'] + except KeyError: + pass + else: + if ext and not ext.startswith('.'): + ext = '.' + ext + kw['basename'] = pb + ext + + if ('dirname' in kw and not kw['dirname']): + kw['dirname'] = drive + else: + kw.setdefault('dirname', dirname) + kw.setdefault('sep', self.sep) + obj.strpath = normpath( + "%(dirname)s%(sep)s%(basename)s" % kw) + return obj + + def _getbyspec(self, spec): + """ see new for what 'spec' can be. """ + res = [] + parts = self.strpath.split(self.sep) + + args = filter(None, spec.split(',') ) + append = res.append + for name in args: + if name == 'drive': + append(parts[0]) + elif name == 'dirname': + append(self.sep.join(parts[:-1])) + else: + basename = parts[-1] + if name == 'basename': + append(basename) + else: + i = basename.rfind('.') + if i == -1: + purebasename, ext = basename, '' + else: + purebasename, ext = basename[:i], basename[i:] + if name == 'purebasename': + append(purebasename) + elif name == 'ext': + append(ext) + else: + raise ValueError("invalid part specification %r" % name) + return res + + def dirpath(self, *args, **kwargs): + """ return the directory path joined with any given path arguments. """ + if not kwargs: + path = object.__new__(self.__class__) + path.strpath = dirname(self.strpath) + if args: + path = path.join(*args) + return path + return super(LocalPath, self).dirpath(*args, **kwargs) + + def join(self, *args, **kwargs): + """ return a new path by appending all 'args' as path + components. if abs=1 is used restart from root if any + of the args is an absolute path. + """ + sep = self.sep + strargs = [fspath(arg) for arg in args] + strpath = self.strpath + if kwargs.get('abs'): + newargs = [] + for arg in reversed(strargs): + if isabs(arg): + strpath = arg + strargs = newargs + break + newargs.insert(0, arg) + # special case for when we have e.g. strpath == "/" + actual_sep = "" if strpath.endswith(sep) else sep + for arg in strargs: + arg = arg.strip(sep) + if iswin32: + # allow unix style paths even on windows. + arg = arg.strip('/') + arg = arg.replace('/', sep) + strpath = strpath + actual_sep + arg + actual_sep = sep + obj = object.__new__(self.__class__) + obj.strpath = normpath(strpath) + return obj + + def open(self, mode='r', ensure=False, encoding=None): + """ return an opened file with the given mode. + + If ensure is True, create parent directories if needed. + """ + if ensure: + self.dirpath().ensure(dir=1) + if encoding: + return error.checked_call(io.open, self.strpath, mode, encoding=encoding) + return error.checked_call(open, self.strpath, mode) + + def _fastjoin(self, name): + child = object.__new__(self.__class__) + child.strpath = self.strpath + self.sep + name + return child + + def islink(self): + return islink(self.strpath) + + def check(self, **kw): + if not kw: + return exists(self.strpath) + if len(kw) == 1: + if "dir" in kw: + return not kw["dir"] ^ isdir(self.strpath) + if "file" in kw: + return not kw["file"] ^ isfile(self.strpath) + return super(LocalPath, self).check(**kw) + + _patternchars = set("*?[" + os.path.sep) + def listdir(self, fil=None, sort=None): + """ list directory contents, possibly filter by the given fil func + and possibly sorted. + """ + if fil is None and sort is None: + names = error.checked_call(os.listdir, self.strpath) + return map_as_list(self._fastjoin, names) + if isinstance(fil, py.builtin._basestring): + if not self._patternchars.intersection(fil): + child = self._fastjoin(fil) + if exists(child.strpath): + return [child] + return [] + fil = FNMatcher(fil) + names = error.checked_call(os.listdir, self.strpath) + res = [] + for name in names: + child = self._fastjoin(name) + if fil is None or fil(child): + res.append(child) + self._sortlist(res, sort) + return res + + def size(self): + """ return size of the underlying file object """ + return self.stat().size + + def mtime(self): + """ return last modification time of the path. """ + return self.stat().mtime + + def copy(self, target, mode=False, stat=False): + """ copy path to target. + + If mode is True, will copy copy permission from path to target. + If stat is True, copy permission, last modification + time, last access time, and flags from path to target. + """ + if self.check(file=1): + if target.check(dir=1): + target = target.join(self.basename) + assert self!=target + copychunked(self, target) + if mode: + copymode(self.strpath, target.strpath) + if stat: + copystat(self, target) + else: + def rec(p): + return p.check(link=0) + for x in self.visit(rec=rec): + relpath = x.relto(self) + newx = target.join(relpath) + newx.dirpath().ensure(dir=1) + if x.check(link=1): + newx.mksymlinkto(x.readlink()) + continue + elif x.check(file=1): + copychunked(x, newx) + elif x.check(dir=1): + newx.ensure(dir=1) + if mode: + copymode(x.strpath, newx.strpath) + if stat: + copystat(x, newx) + + def rename(self, target): + """ rename this path to target. """ + target = fspath(target) + return error.checked_call(os.rename, self.strpath, target) + + def dump(self, obj, bin=1): + """ pickle object into path location""" + f = self.open('wb') + import pickle + try: + error.checked_call(pickle.dump, obj, f, bin) + finally: + f.close() + + def mkdir(self, *args): + """ create & return the directory joined with args. """ + p = self.join(*args) + error.checked_call(os.mkdir, fspath(p)) + return p + + def write_binary(self, data, ensure=False): + """ write binary data into path. If ensure is True create + missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + with self.open('wb') as f: + f.write(data) + + def write_text(self, data, encoding, ensure=False): + """ write text data into path using the specified encoding. + If ensure is True create missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + with self.open('w', encoding=encoding) as f: + f.write(data) + + def write(self, data, mode='w', ensure=False): + """ write data into path. If ensure is True create + missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + if 'b' in mode: + if not py.builtin._isbytes(data): + raise ValueError("can only process bytes") + else: + if not py.builtin._istext(data): + if not py.builtin._isbytes(data): + data = str(data) + else: + data = py.builtin._totext(data, sys.getdefaultencoding()) + f = self.open(mode) + try: + f.write(data) + finally: + f.close() + + def _ensuredirs(self): + parent = self.dirpath() + if parent == self: + return self + if parent.check(dir=0): + parent._ensuredirs() + if self.check(dir=0): + try: + self.mkdir() + except error.EEXIST: + # race condition: file/dir created by another thread/process. + # complain if it is not a dir + if self.check(dir=0): + raise + return self + + def ensure(self, *args, **kwargs): + """ ensure that an args-joined path exists (by default as + a file). if you specify a keyword argument 'dir=True' + then the path is forced to be a directory path. + """ + p = self.join(*args) + if kwargs.get('dir', 0): + return p._ensuredirs() + else: + p.dirpath()._ensuredirs() + if not p.check(file=1): + p.open('w').close() + return p + + def stat(self, raising=True): + """ Return an os.stat() tuple. """ + if raising == True: + return Stat(self, error.checked_call(os.stat, self.strpath)) + try: + return Stat(self, os.stat(self.strpath)) + except KeyboardInterrupt: + raise + except Exception: + return None + + def lstat(self): + """ Return an os.lstat() tuple. """ + return Stat(self, error.checked_call(os.lstat, self.strpath)) + + def setmtime(self, mtime=None): + """ set modification time for the given path. if 'mtime' is None + (the default) then the file's mtime is set to current time. + + Note that the resolution for 'mtime' is platform dependent. + """ + if mtime is None: + return error.checked_call(os.utime, self.strpath, mtime) + try: + return error.checked_call(os.utime, self.strpath, (-1, mtime)) + except error.EINVAL: + return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) + + def chdir(self): + """ change directory to self and return old current directory """ + try: + old = self.__class__() + except error.ENOENT: + old = None + error.checked_call(os.chdir, self.strpath) + return old + + + @contextmanager + def as_cwd(self): + """ + Return a context manager, which changes to the path's dir during the + managed "with" context. + On __enter__ it returns the old dir, which might be ``None``. + """ + old = self.chdir() + try: + yield old + finally: + if old is not None: + old.chdir() + + def realpath(self): + """ return a new path which contains no symbolic links.""" + return self.__class__(os.path.realpath(self.strpath)) + + def atime(self): + """ return last access time of the path. """ + return self.stat().atime + + def __repr__(self): + return 'local(%r)' % self.strpath + + def __str__(self): + """ return string representation of the Path. """ + return self.strpath + + def chmod(self, mode, rec=0): + """ change permissions to the given mode. If mode is an + integer it directly encodes the os-specific modes. + if rec is True perform recursively. + """ + if not isinstance(mode, int): + raise TypeError("mode %r must be an integer" % (mode,)) + if rec: + for x in self.visit(rec=rec): + error.checked_call(os.chmod, str(x), mode) + error.checked_call(os.chmod, self.strpath, mode) + + def pypkgpath(self): + """ return the Python package path by looking for the last + directory upwards which still contains an __init__.py. + Return None if a pkgpath can not be determined. + """ + pkgpath = None + for parent in self.parts(reverse=True): + if parent.isdir(): + if not parent.join('__init__.py').exists(): + break + if not isimportable(parent.basename): + break + pkgpath = parent + return pkgpath + + def _ensuresyspath(self, ensuremode, path): + if ensuremode: + s = str(path) + if ensuremode == "append": + if s not in sys.path: + sys.path.append(s) + else: + if s != sys.path[0]: + sys.path.insert(0, s) + + def pyimport(self, modname=None, ensuresyspath=True): + """ return path as an imported python module. + + If modname is None, look for the containing package + and construct an according module name. + The module will be put/looked up in sys.modules. + if ensuresyspath is True then the root dir for importing + the file (taking __init__.py files into account) will + be prepended to sys.path if it isn't there already. + If ensuresyspath=="append" the root dir will be appended + if it isn't already contained in sys.path. + if ensuresyspath is False no modification of syspath happens. + + Special value of ensuresyspath=="importlib" is intended + purely for using in pytest, it is capable only of importing + separate .py files outside packages, e.g. for test suite + without any __init__.py file. It effectively allows having + same-named test modules in different places and offers + mild opt-in via this option. Note that it works only in + recent versions of python. + """ + if not self.check(): + raise error.ENOENT(self) + + if ensuresyspath == 'importlib': + if modname is None: + modname = self.purebasename + if not ALLOW_IMPORTLIB_MODE: + raise ImportError( + "Can't use importlib due to old version of Python") + spec = importlib.util.spec_from_file_location( + modname, str(self)) + if spec is None: + raise ImportError( + "Can't find module %s at location %s" % + (modname, str(self)) + ) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + pkgpath = None + if modname is None: + pkgpath = self.pypkgpath() + if pkgpath is not None: + pkgroot = pkgpath.dirpath() + names = self.new(ext="").relto(pkgroot).split(self.sep) + if names[-1] == "__init__": + names.pop() + modname = ".".join(names) + else: + pkgroot = self.dirpath() + modname = self.purebasename + + self._ensuresyspath(ensuresyspath, pkgroot) + __import__(modname) + mod = sys.modules[modname] + if self.basename == "__init__.py": + return mod # we don't check anything as we might + # be in a namespace package ... too icky to check + modfile = mod.__file__ + if modfile[-4:] in ('.pyc', '.pyo'): + modfile = modfile[:-1] + elif modfile.endswith('$py.class'): + modfile = modfile[:-9] + '.py' + if modfile.endswith(os.path.sep + "__init__.py"): + if self.basename != "__init__.py": + modfile = modfile[:-12] + try: + issame = self.samefile(modfile) + except error.ENOENT: + issame = False + if not issame: + ignore = os.getenv('PY_IGNORE_IMPORTMISMATCH') + if ignore != '1': + raise self.ImportMismatchError(modname, modfile, self) + return mod + else: + try: + return sys.modules[modname] + except KeyError: + # we have a custom modname, do a pseudo-import + import types + mod = types.ModuleType(modname) + mod.__file__ = str(self) + sys.modules[modname] = mod + try: + py.builtin.execfile(str(self), mod.__dict__) + except: + del sys.modules[modname] + raise + return mod + + def sysexec(self, *argv, **popen_opts): + """ return stdout text from executing a system child process, + where the 'self' path points to executable. + The process is directly invoked and not through a system shell. + """ + from subprocess import Popen, PIPE + argv = map_as_list(str, argv) + popen_opts['stdout'] = popen_opts['stderr'] = PIPE + proc = Popen([str(self)] + argv, **popen_opts) + stdout, stderr = proc.communicate() + ret = proc.wait() + if py.builtin._isbytes(stdout): + stdout = py.builtin._totext(stdout, sys.getdefaultencoding()) + if ret != 0: + if py.builtin._isbytes(stderr): + stderr = py.builtin._totext(stderr, sys.getdefaultencoding()) + raise py.process.cmdexec.Error(ret, ret, str(self), + stdout, stderr,) + return stdout + + def sysfind(cls, name, checker=None, paths=None): + """ return a path object found by looking at the systems + underlying PATH specification. If the checker is not None + it will be invoked to filter matching paths. If a binary + cannot be found, None is returned + Note: This is probably not working on plain win32 systems + but may work on cygwin. + """ + if isabs(name): + p = py.path.local(name) + if p.check(file=1): + return p + else: + if paths is None: + if iswin32: + paths = os.environ['Path'].split(';') + if '' not in paths and '.' not in paths: + paths.append('.') + try: + systemroot = os.environ['SYSTEMROOT'] + except KeyError: + pass + else: + paths = [path.replace('%SystemRoot%', systemroot) + for path in paths] + else: + paths = os.environ['PATH'].split(':') + tryadd = [] + if iswin32: + tryadd += os.environ['PATHEXT'].split(os.pathsep) + tryadd.append("") + + for x in paths: + for addext in tryadd: + p = py.path.local(x).join(name, abs=True) + addext + try: + if p.check(file=1): + if checker: + if not checker(p): + continue + return p + except error.EACCES: + pass + return None + sysfind = classmethod(sysfind) + + def _gethomedir(cls): + try: + x = os.environ['HOME'] + except KeyError: + try: + x = os.environ["HOMEDRIVE"] + os.environ['HOMEPATH'] + except KeyError: + return None + return cls(x) + _gethomedir = classmethod(_gethomedir) + + # """ + # special class constructors for local filesystem paths + # """ + @classmethod + def get_temproot(cls): + """ return the system's temporary directory + (where tempfiles are usually created in) + """ + import tempfile + return py.path.local(tempfile.gettempdir()) + + @classmethod + def mkdtemp(cls, rootdir=None): + """ return a Path object pointing to a fresh new temporary directory + (which we created ourself). + """ + import tempfile + if rootdir is None: + rootdir = cls.get_temproot() + return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir))) + + def make_numbered_dir(cls, prefix='session-', rootdir=None, keep=3, + lock_timeout=172800): # two days + """ return unique directory with a number greater than the current + maximum one. The number is assumed to start directly after prefix. + if keep is true directories with a number less than (maxnum-keep) + will be removed. If .lock files are used (lock_timeout non-zero), + algorithm is multi-process safe. + """ + if rootdir is None: + rootdir = cls.get_temproot() + + nprefix = prefix.lower() + def parse_num(path): + """ parse the number out of a path (if it matches the prefix) """ + nbasename = path.basename.lower() + if nbasename.startswith(nprefix): + try: + return int(nbasename[len(nprefix):]) + except ValueError: + pass + + def create_lockfile(path): + """ exclusively create lockfile. Throws when failed """ + mypid = os.getpid() + lockfile = path.join('.lock') + if hasattr(lockfile, 'mksymlinkto'): + lockfile.mksymlinkto(str(mypid)) + else: + fd = error.checked_call(os.open, str(lockfile), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644) + with os.fdopen(fd, 'w') as f: + f.write(str(mypid)) + return lockfile + + def atexit_remove_lockfile(lockfile): + """ ensure lockfile is removed at process exit """ + mypid = os.getpid() + def try_remove_lockfile(): + # in a fork() situation, only the last process should + # remove the .lock, otherwise the other processes run the + # risk of seeing their temporary dir disappear. For now + # we remove the .lock in the parent only (i.e. we assume + # that the children finish before the parent). + if os.getpid() != mypid: + return + try: + lockfile.remove() + except error.Error: + pass + atexit.register(try_remove_lockfile) + + # compute the maximum number currently in use with the prefix + lastmax = None + while True: + maxnum = -1 + for path in rootdir.listdir(): + num = parse_num(path) + if num is not None: + maxnum = max(maxnum, num) + + # make the new directory + try: + udir = rootdir.mkdir(prefix + str(maxnum+1)) + if lock_timeout: + lockfile = create_lockfile(udir) + atexit_remove_lockfile(lockfile) + except (error.EEXIST, error.ENOENT, error.EBUSY): + # race condition (1): another thread/process created the dir + # in the meantime - try again + # race condition (2): another thread/process spuriously acquired + # lock treating empty directory as candidate + # for removal - try again + # race condition (3): another thread/process tried to create the lock at + # the same time (happened in Python 3.3 on Windows) + # https://ci.appveyor.com/project/pytestbot/py/build/1.0.21/job/ffi85j4c0lqwsfwa + if lastmax == maxnum: + raise + lastmax = maxnum + continue + break + + def get_mtime(path): + """ read file modification time """ + try: + return path.lstat().mtime + except error.Error: + pass + + garbage_prefix = prefix + 'garbage-' + + def is_garbage(path): + """ check if path denotes directory scheduled for removal """ + bn = path.basename + return bn.startswith(garbage_prefix) + + # prune old directories + udir_time = get_mtime(udir) + if keep and udir_time: + for path in rootdir.listdir(): + num = parse_num(path) + if num is not None and num <= (maxnum - keep): + try: + # try acquiring lock to remove directory as exclusive user + if lock_timeout: + create_lockfile(path) + except (error.EEXIST, error.ENOENT, error.EBUSY): + path_time = get_mtime(path) + if not path_time: + # assume directory doesn't exist now + continue + if abs(udir_time - path_time) < lock_timeout: + # assume directory with lockfile exists + # and lock timeout hasn't expired yet + continue + + # path dir locked for exclusive use + # and scheduled for removal to avoid another thread/process + # treating it as a new directory or removal candidate + garbage_path = rootdir.join(garbage_prefix + str(uuid.uuid4())) + try: + path.rename(garbage_path) + garbage_path.remove(rec=1) + except KeyboardInterrupt: + raise + except: # this might be error.Error, WindowsError ... + pass + if is_garbage(path): + try: + path.remove(rec=1) + except KeyboardInterrupt: + raise + except: # this might be error.Error, WindowsError ... + pass + + # make link... + try: + username = os.environ['USER'] #linux, et al + except KeyError: + try: + username = os.environ['USERNAME'] #windows + except KeyError: + username = 'current' + + src = str(udir) + dest = src[:src.rfind('-')] + '-' + username + try: + os.unlink(dest) + except OSError: + pass + try: + os.symlink(src, dest) + except (OSError, AttributeError, NotImplementedError): + pass + + return udir + make_numbered_dir = classmethod(make_numbered_dir) + + +def copymode(src, dest): + """ copy permission from src to dst. """ + import shutil + shutil.copymode(src, dest) + + +def copystat(src, dest): + """ copy permission, last modification time, + last access time, and flags from src to dst.""" + import shutil + shutil.copystat(str(src), str(dest)) + + +def copychunked(src, dest): + chunksize = 524288 # half a meg of bytes + fsrc = src.open('rb') + try: + fdest = dest.open('wb') + try: + while 1: + buf = fsrc.read(chunksize) + if not buf: + break + fdest.write(buf) + finally: + fdest.close() + finally: + fsrc.close() + + +def isimportable(name): + if name and (name[0].isalpha() or name[0] == '_'): + name = name.replace("_", '') + return not name or name.isalnum() + +local = LocalPath diff --git a/src/py.py b/src/py.py new file mode 100644 index 00000000000..c4f049e360f --- /dev/null +++ b/src/py.py @@ -0,0 +1,10 @@ +# shim for pylib going away +# if pylib is installed this file will get skipped +# (`py/__init__.py` has higher precedence) +import sys + +import _pytest._py.error as error +import _pytest._py.path as path + +sys.modules['py.error'] = error +sys.modules['py.path'] = path From 49abbf248524b444e00571eb692e804fc855704d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:19:24 +0000 Subject: [PATCH 232/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/_py/error.py | 56 ++-- src/_pytest/_py/path.py | 656 +++++++++++++++++++++------------------ src/_pytest/compat.py | 1 + src/py.py | 4 +- 4 files changed, 389 insertions(+), 328 deletions(-) diff --git a/src/_pytest/_py/error.py b/src/_pytest/_py/error.py index e1e3ccd28af..c427ee5f599 100644 --- a/src/_pytest/_py/error.py +++ b/src/_pytest/_py/error.py @@ -2,41 +2,49 @@ create errno-specific classes for IO or os calls. """ +import errno +import os +import sys from types import ModuleType -import sys, os, errno + class Error(EnvironmentError): def __repr__(self): - return "%s.%s %r: %s " %(self.__class__.__module__, - self.__class__.__name__, - self.__class__.__doc__, - " ".join(map(str, self.args)), - #repr(self.args) - ) + return "{}.{} {!r}: {} ".format( + self.__class__.__module__, + self.__class__.__name__, + self.__class__.__doc__, + " ".join(map(str, self.args)), + # repr(self.args) + ) def __str__(self): - s = "[%s]: %s" %(self.__class__.__doc__, - " ".join(map(str, self.args)), - ) + s = "[{}]: {}".format( + self.__class__.__doc__, + " ".join(map(str, self.args)), + ) return s + _winerrnomap = { 2: errno.ENOENT, 3: errno.ENOENT, 17: errno.EEXIST, 18: errno.EXDEV, - 13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailiable + 13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailiable 22: errno.ENOTDIR, 20: errno.ENOTDIR, 267: errno.ENOTDIR, 5: errno.EACCES, # anything better? } + class ErrorMaker(ModuleType): - """ lazily provides Exception classes for each possible POSIX errno - (as defined per the 'errno' module). All such instances - subclass EnvironmentError. + """lazily provides Exception classes for each possible POSIX errno + (as defined per the 'errno' module). All such instances + subclass EnvironmentError. """ + Error = Error _errno2class = {} @@ -52,23 +60,25 @@ def _geterrnoclass(self, eno): try: return self._errno2class[eno] except KeyError: - clsname = errno.errorcode.get(eno, "UnknownErrno%d" %(eno,)) - errorcls = type(Error)(clsname, (Error,), - {'__module__':'py.error', - '__doc__': os.strerror(eno)}) + clsname = errno.errorcode.get(eno, "UnknownErrno%d" % (eno,)) + errorcls = type(Error)( + clsname, + (Error,), + {"__module__": "py.error", "__doc__": os.strerror(eno)}, + ) self._errno2class[eno] = errorcls return errorcls def checked_call(self, func, *args, **kwargs): - """ call a function and raise an errno-exception if applicable. """ + """call a function and raise an errno-exception if applicable.""" __tracebackhide__ = True try: return func(*args, **kwargs) except self.Error: raise - except (OSError, EnvironmentError): + except OSError: cls, value, tb = sys.exc_info() - if not hasattr(value, 'errno'): + if not hasattr(value, "errno"): raise __tracebackhide__ = False errno = value.errno @@ -83,9 +93,9 @@ def checked_call(self, func, *args, **kwargs): cls = self._geterrnoclass(_winerrnomap[errno]) except KeyError: raise value - raise cls("%s%r" % (func.__name__, args)) + raise cls(f"{func.__name__}{args!r}") __tracebackhide__ = True -error = ErrorMaker('_pytest._py.error') +error = ErrorMaker("_pytest._py.error") sys.modules[error.__name__] = error diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index e8adbf27a79..0bf27bcfaf4 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1,24 +1,31 @@ """ local path implementation. """ -from __future__ import with_statement - -from contextlib import contextmanager -import sys, os, atexit, io, uuid -from stat import S_ISLNK, S_ISDIR, S_ISREG - -from os.path import abspath, normpath, isabs, exists, isdir, isfile, islink, dirname - -import warnings +import atexit +import fnmatch +import io import os -import sys import posixpath -import fnmatch +import sys +import uuid +import warnings +from contextlib import contextmanager +from os.path import abspath +from os.path import dirname +from os.path import exists +from os.path import isabs +from os.path import isdir +from os.path import isfile +from os.path import islink +from os.path import normpath +from stat import S_ISDIR +from stat import S_ISLNK +from stat import S_ISREG from . import error # Moved from local.py. -iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt') +iswin32 = sys.platform == "win32" or (getattr(os, "_name", False) == "nt") try: # FileNotFoundError might happen in py34, and is not available with py27. @@ -29,6 +36,7 @@ try: from os import fspath except ImportError: + def fspath(path): """ Return the string representation of the path. @@ -47,7 +55,7 @@ def fspath(path): try: return path_type.__fspath__(path) except AttributeError: - if hasattr(path_type, '__fspath__'): + if hasattr(path_type, "__fspath__"): raise try: import pathlib @@ -57,11 +65,13 @@ def fspath(path): if isinstance(path, pathlib.PurePath): return str(path) - raise TypeError("expected str, bytes or os.PathLike object, not " - + path_type.__name__) + raise TypeError( + "expected str, bytes or os.PathLike object, not " + path_type.__name__ + ) + class Checkers: - _depend_on_existence = 'exists', 'link', 'dir', 'file' + _depend_on_existence = "exists", "link", "dir", "file" def __init__(self, path): self.path = path @@ -73,11 +83,11 @@ def file(self): raise NotImplementedError def dotfile(self): - return self.path.basename.startswith('.') + return self.path.basename.startswith(".") def ext(self, arg): - if not arg.startswith('.'): - arg = '.' + arg + if not arg.startswith("."): + arg = "." + arg return self.path.ext == arg def exists(self): @@ -105,15 +115,14 @@ def _evaluate(self, kw): try: meth = getattr(self, name) except AttributeError: - if name[:3] == 'not': + if name[:3] == "not": invert = True try: meth = getattr(self, name[3:]) except AttributeError: pass if meth is None: - raise TypeError( - "no %r checker available for %r" % (name, self.path)) + raise TypeError(f"no {name!r} checker available for {self.path!r}") try: if py.code.getrawcode(meth).co_argcount > 1: if (not meth(value)) ^ invert: @@ -129,74 +138,78 @@ def _evaluate(self, kw): if name in kw: if kw.get(name): return False - name = 'not' + name + name = "not" + name if name in kw: if not kw.get(name): return False return True + class NeverRaised(Exception): pass -class PathBase(object): - """ shared implementation for filesystem path objects.""" + +class PathBase: + """shared implementation for filesystem path objects.""" + Checkers = Checkers def __div__(self, other): return self.join(fspath(other)) - __truediv__ = __div__ # py3k + + __truediv__ = __div__ # py3k def basename(self): - """ basename part of path. """ - return self._getbyspec('basename')[0] + """basename part of path.""" + return self._getbyspec("basename")[0] + basename = property(basename, None, None, basename.__doc__) def dirname(self): - """ dirname part of path. """ - return self._getbyspec('dirname')[0] + """dirname part of path.""" + return self._getbyspec("dirname")[0] + dirname = property(dirname, None, None, dirname.__doc__) def purebasename(self): - """ pure base name of the path.""" - return self._getbyspec('purebasename')[0] + """pure base name of the path.""" + return self._getbyspec("purebasename")[0] + purebasename = property(purebasename, None, None, purebasename.__doc__) def ext(self): - """ extension of the path (including the '.').""" - return self._getbyspec('ext')[0] + """extension of the path (including the '.').""" + return self._getbyspec("ext")[0] + ext = property(ext, None, None, ext.__doc__) def dirpath(self, *args, **kwargs): - """ return the directory path joined with any given path arguments. """ - return self.new(basename='').join(*args, **kwargs) + """return the directory path joined with any given path arguments.""" + return self.new(basename="").join(*args, **kwargs) def read_binary(self): - """ read and return a bytestring from reading the path. """ - with self.open('rb') as f: + """read and return a bytestring from reading the path.""" + with self.open("rb") as f: return f.read() def read_text(self, encoding): - """ read and return a Unicode string from reading the path. """ + """read and return a Unicode string from reading the path.""" with self.open("r", encoding=encoding) as f: return f.read() - - def read(self, mode='r'): - """ read and return a bytestring from reading the path. """ + def read(self, mode="r"): + """read and return a bytestring from reading the path.""" with self.open(mode) as f: return f.read() def readlines(self, cr=1): - """ read and return a list of lines from the path. if cr is False, the -newline will be removed from the end of each line. """ - if sys.version_info < (3, ): - mode = 'rU' - else: # python 3 deprecates mode "U" in favor of "newline" option - mode = 'r' + """read and return a list of lines from the path. if cr is False, the + newline will be removed from the end of each line.""" + mode = "r" if not cr: content = self.read(mode) - return content.split('\n') + return content.split("\n") else: f = self.open(mode) try: @@ -205,20 +218,19 @@ def readlines(self, cr=1): f.close() def load(self): - """ (deprecated) return object unpickled from self.read() """ - f = self.open('rb') + """(deprecated) return object unpickled from self.read()""" + f = self.open("rb") try: import pickle + return error.checked_call(pickle.load, f) finally: f.close() def move(self, target): - """ move this path to target. """ + """move this path to target.""" if target.relto(self): - raise error.EINVAL( - target, - "cannot move path into a subdirectory of itself") + raise error.EINVAL(target, "cannot move path into a subdirectory of itself") try: self.rename(target) except error.EXDEV: # invalid cross-device link @@ -226,28 +238,28 @@ def move(self, target): self.remove() def __repr__(self): - """ return a string representation of this path. """ + """return a string representation of this path.""" return repr(str(self)) def check(self, **kw): - """ check a path for existence and properties. + """check a path for existence and properties. - Without arguments, return True if the path exists, otherwise False. + Without arguments, return True if the path exists, otherwise False. - valid checkers:: + valid checkers:: - file=1 # is a file - file=0 # is not a file (may not even exist) - dir=1 # is a dir - link=1 # is a link - exists=1 # exists + file=1 # is a file + file=0 # is not a file (may not even exist) + dir=1 # is a dir + link=1 # is a link + exists=1 # exists - You can specify multiple checker definitions, for example:: + You can specify multiple checker definitions, for example:: - path.check(file=1, link=1) # a link pointing to a file + path.check(file=1, link=1) # a link pointing to a file """ if not kw: - kw = {'exists': 1} + kw = {"exists": 1} return self.Checkers(self)._evaluate(kw) def fnmatch(self, pattern): @@ -270,34 +282,33 @@ def fnmatch(self, pattern): return FNMatcher(pattern)(self) def relto(self, relpath): - """ return a string which is the relative part of the path + """return a string which is the relative part of the path to the given 'relpath'. """ if not isinstance(relpath, (str, PathBase)): - raise TypeError("%r: not a string or path object" %(relpath,)) + raise TypeError(f"{relpath!r}: not a string or path object") strrelpath = str(relpath) if strrelpath and strrelpath[-1] != self.sep: strrelpath += self.sep - #assert strrelpath[-1] == self.sep - #assert strrelpath[-2] != self.sep + # assert strrelpath[-1] == self.sep + # assert strrelpath[-2] != self.sep strself = self.strpath - if sys.platform == "win32" or getattr(os, '_name', None) == 'nt': - if os.path.normcase(strself).startswith( - os.path.normcase(strrelpath)): - return strself[len(strrelpath):] + if sys.platform == "win32" or getattr(os, "_name", None) == "nt": + if os.path.normcase(strself).startswith(os.path.normcase(strrelpath)): + return strself[len(strrelpath) :] elif strself.startswith(strrelpath): - return strself[len(strrelpath):] + return strself[len(strrelpath) :] return "" def ensure_dir(self, *args): - """ ensure the path joined with args is a directory. """ + """ensure the path joined with args is a directory.""" return self.ensure(*args, **{"dir": True}) def bestrelpath(self, dest): - """ return a string which is a relative path from self - (assumed to be a directory) to dest such that - self.join(bestrelpath) == dest and if not such - path can be determined return dest. + """return a string which is a relative path from self + (assumed to be a directory) to dest such that + self.join(bestrelpath) == dest and if not such + path can be determined return dest. """ try: if self == dest: @@ -329,8 +340,8 @@ def isfile(self): return self.check(file=1) def parts(self, reverse=False): - """ return a root-first list of all ancestor directories - plus the path itself. + """return a root-first list of all ancestor directories + plus the path itself. """ current = self l = [self] @@ -345,8 +356,8 @@ def parts(self, reverse=False): return l def common(self, other): - """ return the common part shared with the other path - or None if there is no common part. + """return the common part shared with the other path + or None if there is no common part. """ last = None for x, y in zip(self.parts(), other.parts()): @@ -356,15 +367,15 @@ def common(self, other): return last def __add__(self, other): - """ return new path object with 'other' added to the basename""" - return self.new(basename=self.basename+str(other)) + """return new path object with 'other' added to the basename""" + return self.new(basename=self.basename + str(other)) def __cmp__(self, other): - """ return sort value (-1, 0, +1). """ + """return sort value (-1, 0, +1).""" try: return cmp(self.strpath, other.strpath) except AttributeError: - return cmp(str(self), str(other)) # self.path, other.path) + return cmp(str(self), str(other)) # self.path, other.path) def __lt__(self, other): try: @@ -373,50 +384,53 @@ def __lt__(self, other): return str(self) < str(other) def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): - """ yields all paths below the current one + """yields all paths below the current one - fil is a filter (glob pattern or callable), if not matching the - path will not be yielded, defaulting to None (everything is - returned) + fil is a filter (glob pattern or callable), if not matching the + path will not be yielded, defaulting to None (everything is + returned) - rec is a filter (glob pattern or callable) that controls whether - a node is descended, defaulting to None + rec is a filter (glob pattern or callable) that controls whether + a node is descended, defaulting to None - ignore is an Exception class that is ignoredwhen calling dirlist() - on any of the paths (by default, all exceptions are reported) + ignore is an Exception class that is ignoredwhen calling dirlist() + on any of the paths (by default, all exceptions are reported) - bf if True will cause a breadthfirst search instead of the - default depthfirst. Default: False + bf if True will cause a breadthfirst search instead of the + default depthfirst. Default: False - sort if True will sort entries within each directory level. + sort if True will sort entries within each directory level. """ - for x in Visitor(fil, rec, ignore, bf, sort).gen(self): - yield x + yield from Visitor(fil, rec, ignore, bf, sort).gen(self) def _sortlist(self, res, sort): if sort: - if hasattr(sort, '__call__'): - warnings.warn(DeprecationWarning( - "listdir(sort=callable) is deprecated and breaks on python3" - ), stacklevel=3) + if hasattr(sort, "__call__"): + warnings.warn( + DeprecationWarning( + "listdir(sort=callable) is deprecated and breaks on python3" + ), + stacklevel=3, + ) res.sort(sort) else: res.sort() def samefile(self, other): - """ return True if other refers to the same stat object as self. """ + """return True if other refers to the same stat object as self.""" return self.strpath == str(other) def __fspath__(self): return self.strpath + class Visitor: def __init__(self, fil, rec, ignore, bf, sort): if isinstance(fil, py.builtin._basestring): fil = FNMatcher(fil) if isinstance(rec, py.builtin._basestring): self.rec = FNMatcher(rec) - elif not hasattr(rec, '__call__') and rec: + elif not hasattr(rec, "__call__") and rec: self.rec = lambda path: True else: self.rec = rec @@ -431,8 +445,9 @@ def gen(self, path): except self.ignore: return rec = self.rec - dirs = self.optsort([p for p in entries - if p.check(dir=1) and (rec is None or rec(p))]) + dirs = self.optsort( + [p for p in entries if p.check(dir=1) and (rec is None or rec(p))] + ) if not self.breadthfirst: for subdir in dirs: for p in self.gen(subdir): @@ -445,6 +460,7 @@ def gen(self, path): for p in self.gen(subdir): yield p + class FNMatcher: def __init__(self, pattern): self.pattern = pattern @@ -452,9 +468,11 @@ def __init__(self, pattern): def __call__(self, path): pattern = self.pattern - if (pattern.find(path.sep) == -1 and - iswin32 and - pattern.find(posixpath.sep) != -1): + if ( + pattern.find(path.sep) == -1 + and iswin32 + and pattern.find(posixpath.sep) != -1 + ): # Running on Windows, the pattern has no Windows path separators, # and the pattern has one or more Posix path separators. Replace # the Posix path separators with the Windows path separator. @@ -463,24 +481,22 @@ def __call__(self, path): if pattern.find(path.sep) == -1: name = path.basename else: - name = str(path) # path.strpath # XXX svn? + name = str(path) # path.strpath # XXX svn? if not os.path.isabs(pattern): - pattern = '*' + path.sep + pattern + pattern = "*" + path.sep + pattern return fnmatch.fnmatch(name, pattern) -if sys.version_info > (3,0): - def map_as_list(func, iter): - return list(map(func, iter)) -else: - map_as_list = map +def map_as_list(func, iter): + return list(map(func, iter)) -ALLOW_IMPORTLIB_MODE = sys.version_info > (3,5) + +ALLOW_IMPORTLIB_MODE = sys.version_info > (3, 5) if ALLOW_IMPORTLIB_MODE: import importlib -class Stat(object): +class Stat: def __getattr__(self, name): return getattr(self._osstatresult, "st_" + name) @@ -493,15 +509,17 @@ def owner(self): if iswin32: raise NotImplementedError("XXX win32") import pwd + entry = error.checked_call(pwd.getpwuid, self.uid) return entry[0] @property def group(self): - """ return group name of file. """ + """return group name of file.""" if iswin32: raise NotImplementedError("XXX win32") import grp + entry = error.checked_call(grp.getgrgid, self.gid) return entry[0] @@ -512,15 +530,16 @@ def isfile(self): return S_ISREG(self._osstatresult.st_mode) def islink(self): - st = self.path.lstat() + self.path.lstat() return S_ISLNK(self._osstatresult.st_mode) + class PosixPath(PathBase): def chown(self, user, group, rec=0): - """ change ownership to the given user and group. - user and group may be specified by a number or - by a name. if rec is True change ownership - recursively. + """change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. """ uid = getuserid(user) gid = getgroupid(group) @@ -531,15 +550,15 @@ def chown(self, user, group, rec=0): error.checked_call(os.chown, str(self), uid, gid) def readlink(self): - """ return value of a symbolic link. """ + """return value of a symbolic link.""" return error.checked_call(os.readlink, self.strpath) def mklinkto(self, oldname): - """ posix style hard link to another name. """ + """posix style hard link to another name.""" error.checked_call(os.link, str(oldname), str(self)) def mksymlinkto(self, value, absolute=1): - """ create a symbolic link with the given value (pointing to another name). """ + """create a symbolic link with the given value (pointing to another name).""" if absolute: error.checked_call(os.symlink, str(value), self.strpath) else: @@ -548,31 +567,39 @@ def mksymlinkto(self, value, absolute=1): relsource = self.__class__(value).relto(base) reldest = self.relto(base) n = reldest.count(self.sep) - target = self.sep.join(('..', )*n + (relsource, )) + target = self.sep.join(("..",) * n + (relsource,)) error.checked_call(os.symlink, target, self.strpath) + def getuserid(user): import pwd + if not isinstance(user, int): user = pwd.getpwnam(user)[2] return user + def getgroupid(group): import grp + if not isinstance(group, int): group = grp.getgrnam(group)[2] return group + FSBase = not iswin32 and PosixPath or PathBase + class LocalPath(FSBase): - """ object oriented interface to os.path and other local filesystem - related information. + """object oriented interface to os.path and other local filesystem + related information. """ + class ImportMismatchError(ImportError): - """ raised on pyimport() if there is a mismatch of __file__'s""" + """raised on pyimport() if there is a mismatch of __file__'s""" sep = os.sep + class Checkers(Checkers): def _stat(self): try: @@ -598,7 +625,7 @@ def link(self): return S_ISLNK(st.mode) def __init__(self, path=None, expanduser=False): - """ Initialize and return a local Path instance. + """Initialize and return a local Path instance. Path can be relative to the current directory. If path is None it defaults to the current working directory. @@ -613,8 +640,10 @@ def __init__(self, path=None, expanduser=False): try: path = fspath(path) except TypeError: - raise ValueError("can only pass None, Path instances " - "or non-empty strings to LocalPath") + raise ValueError( + "can only pass None, Path instances " + "or non-empty strings to LocalPath" + ) if expanduser: path = os.path.expanduser(path) self.strpath = abspath(path) @@ -649,8 +678,7 @@ def __gt__(self, other): return fspath(self) > fspath(other) def samefile(self, other): - """ return True if 'other' references the same file as 'self'. - """ + """return True if 'other' references the same file as 'self'.""" other = fspath(other) if not isabs(other): other = abspath(other) @@ -658,11 +686,10 @@ def samefile(self, other): return True if not hasattr(os.path, "samefile"): return False - return error.checked_call( - os.path.samefile, self.strpath, other) + return error.checked_call(os.path.samefile, self.strpath, other) def remove(self, rec=1, ignore_errors=False): - """ remove a file or directory (or a directory tree if rec=1). + """remove a file or directory (or a directory tree if rec=1). if ignore_errors is True, errors while removing directories will be ignored. """ @@ -672,9 +699,10 @@ def remove(self, rec=1, ignore_errors=False): if iswin32: self.chmod(0o700, rec=1) import shutil + error.checked_call( - shutil.rmtree, self.strpath, - ignore_errors=ignore_errors) + shutil.rmtree, self.strpath, ignore_errors=ignore_errors + ) else: error.checked_call(os.rmdir, self.strpath) else: @@ -683,7 +711,7 @@ def remove(self, rec=1, ignore_errors=False): error.checked_call(os.remove, self.strpath) def computehash(self, hashtype="md5", chunksize=524288): - """ return hexdigest of hashvalue for this file. """ + """return hexdigest of hashvalue for this file.""" try: try: import hashlib as mod @@ -693,8 +721,8 @@ def computehash(self, hashtype="md5", chunksize=524288): mod = __import__(hashtype) hash = getattr(mod, hashtype)() except (AttributeError, ImportError): - raise ValueError("Don't know how to compute %r hash" %(hashtype,)) - f = self.open('rb') + raise ValueError(f"Don't know how to compute {hashtype!r} hash") + f = self.open("rb") try: while 1: buf = f.read(chunksize) @@ -705,94 +733,94 @@ def computehash(self, hashtype="md5", chunksize=524288): f.close() def new(self, **kw): - """ create a modified version of this path. - the following keyword arguments modify various path parts:: - - a:/some/path/to/a/file.ext - xx drive - xxxxxxxxxxxxxxxxx dirname - xxxxxxxx basename - xxxx purebasename - xxx ext + """create a modified version of this path. + the following keyword arguments modify various path parts:: + + a:/some/path/to/a/file.ext + xx drive + xxxxxxxxxxxxxxxxx dirname + xxxxxxxx basename + xxxx purebasename + xxx ext """ obj = object.__new__(self.__class__) if not kw: obj.strpath = self.strpath return obj - drive, dirname, basename, purebasename,ext = self._getbyspec( - "drive,dirname,basename,purebasename,ext") - if 'basename' in kw: - if 'purebasename' in kw or 'ext' in kw: + drive, dirname, basename, purebasename, ext = self._getbyspec( + "drive,dirname,basename,purebasename,ext" + ) + if "basename" in kw: + if "purebasename" in kw or "ext" in kw: raise ValueError("invalid specification %r" % kw) else: - pb = kw.setdefault('purebasename', purebasename) + pb = kw.setdefault("purebasename", purebasename) try: - ext = kw['ext'] + ext = kw["ext"] except KeyError: pass else: - if ext and not ext.startswith('.'): - ext = '.' + ext - kw['basename'] = pb + ext + if ext and not ext.startswith("."): + ext = "." + ext + kw["basename"] = pb + ext - if ('dirname' in kw and not kw['dirname']): - kw['dirname'] = drive + if "dirname" in kw and not kw["dirname"]: + kw["dirname"] = drive else: - kw.setdefault('dirname', dirname) - kw.setdefault('sep', self.sep) - obj.strpath = normpath( - "%(dirname)s%(sep)s%(basename)s" % kw) + kw.setdefault("dirname", dirname) + kw.setdefault("sep", self.sep) + obj.strpath = normpath("%(dirname)s%(sep)s%(basename)s" % kw) return obj def _getbyspec(self, spec): - """ see new for what 'spec' can be. """ + """see new for what 'spec' can be.""" res = [] parts = self.strpath.split(self.sep) - args = filter(None, spec.split(',') ) + args = filter(None, spec.split(",")) append = res.append for name in args: - if name == 'drive': + if name == "drive": append(parts[0]) - elif name == 'dirname': + elif name == "dirname": append(self.sep.join(parts[:-1])) else: basename = parts[-1] - if name == 'basename': + if name == "basename": append(basename) else: - i = basename.rfind('.') + i = basename.rfind(".") if i == -1: - purebasename, ext = basename, '' + purebasename, ext = basename, "" else: purebasename, ext = basename[:i], basename[i:] - if name == 'purebasename': + if name == "purebasename": append(purebasename) - elif name == 'ext': + elif name == "ext": append(ext) else: raise ValueError("invalid part specification %r" % name) return res def dirpath(self, *args, **kwargs): - """ return the directory path joined with any given path arguments. """ + """return the directory path joined with any given path arguments.""" if not kwargs: path = object.__new__(self.__class__) path.strpath = dirname(self.strpath) if args: path = path.join(*args) return path - return super(LocalPath, self).dirpath(*args, **kwargs) + return super().dirpath(*args, **kwargs) def join(self, *args, **kwargs): - """ return a new path by appending all 'args' as path + """return a new path by appending all 'args' as path components. if abs=1 is used restart from root if any of the args is an absolute path. """ sep = self.sep strargs = [fspath(arg) for arg in args] strpath = self.strpath - if kwargs.get('abs'): + if kwargs.get("abs"): newargs = [] for arg in reversed(strargs): if isabs(arg): @@ -806,16 +834,16 @@ def join(self, *args, **kwargs): arg = arg.strip(sep) if iswin32: # allow unix style paths even on windows. - arg = arg.strip('/') - arg = arg.replace('/', sep) + arg = arg.strip("/") + arg = arg.replace("/", sep) strpath = strpath + actual_sep + arg actual_sep = sep obj = object.__new__(self.__class__) obj.strpath = normpath(strpath) return obj - def open(self, mode='r', ensure=False, encoding=None): - """ return an opened file with the given mode. + def open(self, mode="r", ensure=False, encoding=None): + """return an opened file with the given mode. If ensure is True, create parent directories if needed. """ @@ -841,12 +869,13 @@ def check(self, **kw): return not kw["dir"] ^ isdir(self.strpath) if "file" in kw: return not kw["file"] ^ isfile(self.strpath) - return super(LocalPath, self).check(**kw) + return super().check(**kw) _patternchars = set("*?[" + os.path.sep) + def listdir(self, fil=None, sort=None): - """ list directory contents, possibly filter by the given fil func - and possibly sorted. + """list directory contents, possibly filter by the given fil func + and possibly sorted. """ if fil is None and sort is None: names = error.checked_call(os.listdir, self.strpath) @@ -868,32 +897,34 @@ def listdir(self, fil=None, sort=None): return res def size(self): - """ return size of the underlying file object """ + """return size of the underlying file object""" return self.stat().size def mtime(self): - """ return last modification time of the path. """ + """return last modification time of the path.""" return self.stat().mtime def copy(self, target, mode=False, stat=False): - """ copy path to target. + """copy path to target. - If mode is True, will copy copy permission from path to target. - If stat is True, copy permission, last modification - time, last access time, and flags from path to target. + If mode is True, will copy copy permission from path to target. + If stat is True, copy permission, last modification + time, last access time, and flags from path to target. """ if self.check(file=1): if target.check(dir=1): target = target.join(self.basename) - assert self!=target + assert self != target copychunked(self, target) if mode: copymode(self.strpath, target.strpath) if stat: copystat(self, target) else: + def rec(p): return p.check(link=0) + for x in self.visit(rec=rec): relpath = x.relto(self) newx = target.join(relpath) @@ -911,50 +942,51 @@ def rec(p): copystat(x, newx) def rename(self, target): - """ rename this path to target. """ + """rename this path to target.""" target = fspath(target) return error.checked_call(os.rename, self.strpath, target) def dump(self, obj, bin=1): - """ pickle object into path location""" - f = self.open('wb') + """pickle object into path location""" + f = self.open("wb") import pickle + try: error.checked_call(pickle.dump, obj, f, bin) finally: f.close() def mkdir(self, *args): - """ create & return the directory joined with args. """ + """create & return the directory joined with args.""" p = self.join(*args) error.checked_call(os.mkdir, fspath(p)) return p def write_binary(self, data, ensure=False): - """ write binary data into path. If ensure is True create + """write binary data into path. If ensure is True create missing parent directories. """ if ensure: self.dirpath().ensure(dir=1) - with self.open('wb') as f: + with self.open("wb") as f: f.write(data) def write_text(self, data, encoding, ensure=False): - """ write text data into path using the specified encoding. + """write text data into path using the specified encoding. If ensure is True create missing parent directories. """ if ensure: self.dirpath().ensure(dir=1) - with self.open('w', encoding=encoding) as f: + with self.open("w", encoding=encoding) as f: f.write(data) - def write(self, data, mode='w', ensure=False): - """ write data into path. If ensure is True create + def write(self, data, mode="w", ensure=False): + """write data into path. If ensure is True create missing parent directories. """ if ensure: self.dirpath().ensure(dir=1) - if 'b' in mode: + if "b" in mode: if not py.builtin._isbytes(data): raise ValueError("can only process bytes") else: @@ -986,21 +1018,21 @@ def _ensuredirs(self): return self def ensure(self, *args, **kwargs): - """ ensure that an args-joined path exists (by default as - a file). if you specify a keyword argument 'dir=True' - then the path is forced to be a directory path. + """ensure that an args-joined path exists (by default as + a file). if you specify a keyword argument 'dir=True' + then the path is forced to be a directory path. """ p = self.join(*args) - if kwargs.get('dir', 0): + if kwargs.get("dir", 0): return p._ensuredirs() else: p.dirpath()._ensuredirs() if not p.check(file=1): - p.open('w').close() + p.open("w").close() return p def stat(self, raising=True): - """ Return an os.stat() tuple. """ + """Return an os.stat() tuple.""" if raising == True: return Stat(self, error.checked_call(os.stat, self.strpath)) try: @@ -1011,11 +1043,11 @@ def stat(self, raising=True): return None def lstat(self): - """ Return an os.lstat() tuple. """ + """Return an os.lstat() tuple.""" return Stat(self, error.checked_call(os.lstat, self.strpath)) def setmtime(self, mtime=None): - """ set modification time for the given path. if 'mtime' is None + """set modification time for the given path. if 'mtime' is None (the default) then the file's mtime is set to current time. Note that the resolution for 'mtime' is platform dependent. @@ -1028,7 +1060,7 @@ def setmtime(self, mtime=None): return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) def chdir(self): - """ change directory to self and return old current directory """ + """change directory to self and return old current directory""" try: old = self.__class__() except error.ENOENT: @@ -1036,7 +1068,6 @@ def chdir(self): error.checked_call(os.chdir, self.strpath) return old - @contextmanager def as_cwd(self): """ @@ -1052,41 +1083,41 @@ def as_cwd(self): old.chdir() def realpath(self): - """ return a new path which contains no symbolic links.""" + """return a new path which contains no symbolic links.""" return self.__class__(os.path.realpath(self.strpath)) def atime(self): - """ return last access time of the path. """ + """return last access time of the path.""" return self.stat().atime def __repr__(self): - return 'local(%r)' % self.strpath + return "local(%r)" % self.strpath def __str__(self): - """ return string representation of the Path. """ + """return string representation of the Path.""" return self.strpath def chmod(self, mode, rec=0): - """ change permissions to the given mode. If mode is an - integer it directly encodes the os-specific modes. - if rec is True perform recursively. + """change permissions to the given mode. If mode is an + integer it directly encodes the os-specific modes. + if rec is True perform recursively. """ if not isinstance(mode, int): - raise TypeError("mode %r must be an integer" % (mode,)) + raise TypeError(f"mode {mode!r} must be an integer") if rec: for x in self.visit(rec=rec): error.checked_call(os.chmod, str(x), mode) error.checked_call(os.chmod, self.strpath, mode) def pypkgpath(self): - """ return the Python package path by looking for the last + """return the Python package path by looking for the last directory upwards which still contains an __init__.py. Return None if a pkgpath can not be determined. """ pkgpath = None for parent in self.parts(reverse=True): if parent.isdir(): - if not parent.join('__init__.py').exists(): + if not parent.join("__init__.py").exists(): break if not isimportable(parent.basename): break @@ -1104,7 +1135,7 @@ def _ensuresyspath(self, ensuremode, path): sys.path.insert(0, s) def pyimport(self, modname=None, ensuresyspath=True): - """ return path as an imported python module. + """return path as an imported python module. If modname is None, look for the containing package and construct an according module name. @@ -1127,18 +1158,15 @@ def pyimport(self, modname=None, ensuresyspath=True): if not self.check(): raise error.ENOENT(self) - if ensuresyspath == 'importlib': + if ensuresyspath == "importlib": if modname is None: modname = self.purebasename if not ALLOW_IMPORTLIB_MODE: - raise ImportError( - "Can't use importlib due to old version of Python") - spec = importlib.util.spec_from_file_location( - modname, str(self)) + raise ImportError("Can't use importlib due to old version of Python") + spec = importlib.util.spec_from_file_location(modname, str(self)) if spec is None: raise ImportError( - "Can't find module %s at location %s" % - (modname, str(self)) + f"Can't find module {modname} at location {str(self)}" ) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) @@ -1161,13 +1189,13 @@ def pyimport(self, modname=None, ensuresyspath=True): __import__(modname) mod = sys.modules[modname] if self.basename == "__init__.py": - return mod # we don't check anything as we might - # be in a namespace package ... too icky to check + return mod # we don't check anything as we might + # be in a namespace package ... too icky to check modfile = mod.__file__ - if modfile[-4:] in ('.pyc', '.pyo'): + if modfile[-4:] in (".pyc", ".pyo"): modfile = modfile[:-1] - elif modfile.endswith('$py.class'): - modfile = modfile[:-9] + '.py' + elif modfile.endswith("$py.class"): + modfile = modfile[:-9] + ".py" if modfile.endswith(os.path.sep + "__init__.py"): if self.basename != "__init__.py": modfile = modfile[:-12] @@ -1176,8 +1204,8 @@ def pyimport(self, modname=None, ensuresyspath=True): except error.ENOENT: issame = False if not issame: - ignore = os.getenv('PY_IGNORE_IMPORTMISMATCH') - if ignore != '1': + ignore = os.getenv("PY_IGNORE_IMPORTMISMATCH") + if ignore != "1": raise self.ImportMismatchError(modname, modfile, self) return mod else: @@ -1186,6 +1214,7 @@ def pyimport(self, modname=None, ensuresyspath=True): except KeyError: # we have a custom modname, do a pseudo-import import types + mod = types.ModuleType(modname) mod.__file__ = str(self) sys.modules[modname] = mod @@ -1197,13 +1226,14 @@ def pyimport(self, modname=None, ensuresyspath=True): return mod def sysexec(self, *argv, **popen_opts): - """ return stdout text from executing a system child process, - where the 'self' path points to executable. - The process is directly invoked and not through a system shell. + """return stdout text from executing a system child process, + where the 'self' path points to executable. + The process is directly invoked and not through a system shell. """ from subprocess import Popen, PIPE + argv = map_as_list(str, argv) - popen_opts['stdout'] = popen_opts['stderr'] = PIPE + popen_opts["stdout"] = popen_opts["stderr"] = PIPE proc = Popen([str(self)] + argv, **popen_opts) stdout, stderr = proc.communicate() ret = proc.wait() @@ -1212,17 +1242,22 @@ def sysexec(self, *argv, **popen_opts): if ret != 0: if py.builtin._isbytes(stderr): stderr = py.builtin._totext(stderr, sys.getdefaultencoding()) - raise py.process.cmdexec.Error(ret, ret, str(self), - stdout, stderr,) + raise py.process.cmdexec.Error( + ret, + ret, + str(self), + stdout, + stderr, + ) return stdout def sysfind(cls, name, checker=None, paths=None): - """ return a path object found by looking at the systems - underlying PATH specification. If the checker is not None - it will be invoked to filter matching paths. If a binary - cannot be found, None is returned - Note: This is probably not working on plain win32 systems - but may work on cygwin. + """return a path object found by looking at the systems + underlying PATH specification. If the checker is not None + it will be invoked to filter matching paths. If a binary + cannot be found, None is returned + Note: This is probably not working on plain win32 systems + but may work on cygwin. """ if isabs(name): p = py.path.local(name) @@ -1231,21 +1266,22 @@ def sysfind(cls, name, checker=None, paths=None): else: if paths is None: if iswin32: - paths = os.environ['Path'].split(';') - if '' not in paths and '.' not in paths: - paths.append('.') + paths = os.environ["Path"].split(";") + if "" not in paths and "." not in paths: + paths.append(".") try: - systemroot = os.environ['SYSTEMROOT'] + systemroot = os.environ["SYSTEMROOT"] except KeyError: pass else: - paths = [path.replace('%SystemRoot%', systemroot) - for path in paths] + paths = [ + path.replace("%SystemRoot%", systemroot) for path in paths + ] else: - paths = os.environ['PATH'].split(':') + paths = os.environ["PATH"].split(":") tryadd = [] if iswin32: - tryadd += os.environ['PATHEXT'].split(os.pathsep) + tryadd += os.environ["PATHEXT"].split(os.pathsep) tryadd.append("") for x in paths: @@ -1260,17 +1296,19 @@ def sysfind(cls, name, checker=None, paths=None): except error.EACCES: pass return None + sysfind = classmethod(sysfind) def _gethomedir(cls): try: - x = os.environ['HOME'] + x = os.environ["HOME"] except KeyError: try: - x = os.environ["HOMEDRIVE"] + os.environ['HOMEPATH'] + x = os.environ["HOMEDRIVE"] + os.environ["HOMEPATH"] except KeyError: return None return cls(x) + _gethomedir = classmethod(_gethomedir) # """ @@ -1278,58 +1316,65 @@ def _gethomedir(cls): # """ @classmethod def get_temproot(cls): - """ return the system's temporary directory - (where tempfiles are usually created in) + """return the system's temporary directory + (where tempfiles are usually created in) """ import tempfile + return py.path.local(tempfile.gettempdir()) @classmethod def mkdtemp(cls, rootdir=None): - """ return a Path object pointing to a fresh new temporary directory - (which we created ourself). + """return a Path object pointing to a fresh new temporary directory + (which we created ourself). """ import tempfile + if rootdir is None: rootdir = cls.get_temproot() return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir))) - def make_numbered_dir(cls, prefix='session-', rootdir=None, keep=3, - lock_timeout=172800): # two days - """ return unique directory with a number greater than the current - maximum one. The number is assumed to start directly after prefix. - if keep is true directories with a number less than (maxnum-keep) - will be removed. If .lock files are used (lock_timeout non-zero), - algorithm is multi-process safe. + def make_numbered_dir( + cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800 + ): # two days + """return unique directory with a number greater than the current + maximum one. The number is assumed to start directly after prefix. + if keep is true directories with a number less than (maxnum-keep) + will be removed. If .lock files are used (lock_timeout non-zero), + algorithm is multi-process safe. """ if rootdir is None: rootdir = cls.get_temproot() nprefix = prefix.lower() + def parse_num(path): - """ parse the number out of a path (if it matches the prefix) """ + """parse the number out of a path (if it matches the prefix)""" nbasename = path.basename.lower() if nbasename.startswith(nprefix): try: - return int(nbasename[len(nprefix):]) + return int(nbasename[len(nprefix) :]) except ValueError: pass def create_lockfile(path): - """ exclusively create lockfile. Throws when failed """ + """exclusively create lockfile. Throws when failed""" mypid = os.getpid() - lockfile = path.join('.lock') - if hasattr(lockfile, 'mksymlinkto'): + lockfile = path.join(".lock") + if hasattr(lockfile, "mksymlinkto"): lockfile.mksymlinkto(str(mypid)) else: - fd = error.checked_call(os.open, str(lockfile), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644) - with os.fdopen(fd, 'w') as f: + fd = error.checked_call( + os.open, str(lockfile), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644 + ) + with os.fdopen(fd, "w") as f: f.write(str(mypid)) return lockfile def atexit_remove_lockfile(lockfile): - """ ensure lockfile is removed at process exit """ + """ensure lockfile is removed at process exit""" mypid = os.getpid() + def try_remove_lockfile(): # in a fork() situation, only the last process should # remove the .lock, otherwise the other processes run the @@ -1342,6 +1387,7 @@ def try_remove_lockfile(): lockfile.remove() except error.Error: pass + atexit.register(try_remove_lockfile) # compute the maximum number currently in use with the prefix @@ -1355,7 +1401,7 @@ def try_remove_lockfile(): # make the new directory try: - udir = rootdir.mkdir(prefix + str(maxnum+1)) + udir = rootdir.mkdir(prefix + str(maxnum + 1)) if lock_timeout: lockfile = create_lockfile(udir) atexit_remove_lockfile(lockfile) @@ -1375,16 +1421,16 @@ def try_remove_lockfile(): break def get_mtime(path): - """ read file modification time """ + """read file modification time""" try: return path.lstat().mtime except error.Error: pass - garbage_prefix = prefix + 'garbage-' + garbage_prefix = prefix + "garbage-" def is_garbage(path): - """ check if path denotes directory scheduled for removal """ + """check if path denotes directory scheduled for removal""" bn = path.basename return bn.startswith(garbage_prefix) @@ -1417,27 +1463,27 @@ def is_garbage(path): garbage_path.remove(rec=1) except KeyboardInterrupt: raise - except: # this might be error.Error, WindowsError ... + except: # this might be error.Error, WindowsError ... pass if is_garbage(path): try: path.remove(rec=1) except KeyboardInterrupt: raise - except: # this might be error.Error, WindowsError ... + except: # this might be error.Error, WindowsError ... pass # make link... try: - username = os.environ['USER'] #linux, et al + username = os.environ["USER"] # linux, et al except KeyError: try: - username = os.environ['USERNAME'] #windows + username = os.environ["USERNAME"] # windows except KeyError: - username = 'current' + username = "current" - src = str(udir) - dest = src[:src.rfind('-')] + '-' + username + src = str(udir) + dest = src[: src.rfind("-")] + "-" + username try: os.unlink(dest) except OSError: @@ -1448,27 +1494,30 @@ def is_garbage(path): pass return udir + make_numbered_dir = classmethod(make_numbered_dir) def copymode(src, dest): - """ copy permission from src to dst. """ + """copy permission from src to dst.""" import shutil + shutil.copymode(src, dest) def copystat(src, dest): - """ copy permission, last modification time, + """copy permission, last modification time, last access time, and flags from src to dst.""" import shutil + shutil.copystat(str(src), str(dest)) def copychunked(src, dest): chunksize = 524288 # half a meg of bytes - fsrc = src.open('rb') + fsrc = src.open("rb") try: - fdest = dest.open('wb') + fdest = dest.open("wb") try: while 1: buf = fsrc.read(chunksize) @@ -1482,8 +1531,9 @@ def copychunked(src, dest): def isimportable(name): - if name and (name[0].isalpha() or name[0] == '_'): - name = name.replace("_", '') + if name and (name[0].isalpha() or name[0] == "_"): + name = name.replace("_", "") return not name or name.isalnum() + local = LocalPath diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index fab4c31107f..211407b2374 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -18,6 +18,7 @@ from typing import Union import attr + import py # fmt: off diff --git a/src/py.py b/src/py.py index c4f049e360f..7813c9b93cd 100644 --- a/src/py.py +++ b/src/py.py @@ -6,5 +6,5 @@ import _pytest._py.error as error import _pytest._py.path as path -sys.modules['py.error'] = error -sys.modules['py.path'] = path +sys.modules["py.error"] = error +sys.modules["py.path"] = path From 349f4bffa087fa2ebddd375805914a69e8fbbb45 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 10:30:19 -0400 Subject: [PATCH 233/255] use module __getattr__ for py.error to fix doctesting --- src/_pytest/_py/error.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/_pytest/_py/error.py b/src/_pytest/_py/error.py index c427ee5f599..1f33c5aadbe 100644 --- a/src/_pytest/_py/error.py +++ b/src/_pytest/_py/error.py @@ -5,7 +5,6 @@ import errno import os import sys -from types import ModuleType class Error(EnvironmentError): @@ -39,7 +38,7 @@ def __str__(self): } -class ErrorMaker(ModuleType): +class ErrorMaker: """lazily provides Exception classes for each possible POSIX errno (as defined per the 'errno' module). All such instances subclass EnvironmentError. @@ -97,5 +96,8 @@ def checked_call(self, func, *args, **kwargs): __tracebackhide__ = True -error = ErrorMaker("_pytest._py.error") -sys.modules[error.__name__] = error +_error_maker = ErrorMaker() + + +def __getattr__(attr): + return getattr(_error_maker, attr) From 965e942dfb4f68d1e28d6388544ff81247a0a4ef Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 10:56:43 -0400 Subject: [PATCH 234/255] use getrawcode from _pytest._code --- src/_pytest/_py/path.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 0bf27bcfaf4..585edd65d64 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -109,6 +109,8 @@ def endswith(self, arg): return str(self.path).endswith(arg) def _evaluate(self, kw): + from .._code.source import getrawcode + for name, value in kw.items(): invert = False meth = None @@ -124,7 +126,7 @@ def _evaluate(self, kw): if meth is None: raise TypeError(f"no {name!r} checker available for {self.path!r}") try: - if py.code.getrawcode(meth).co_argcount > 1: + if getrawcode(meth).co_argcount > 1: if (not meth(value)) ^ invert: return False else: From a7c1fc204bc40638029a27045ad4f25beec67f5c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:03:30 -0400 Subject: [PATCH 235/255] remove other py.* accesses in _pytest._py.path --- src/_pytest/_py/path.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 585edd65d64..a3c72dcbcf7 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -428,9 +428,9 @@ def __fspath__(self): class Visitor: def __init__(self, fil, rec, ignore, bf, sort): - if isinstance(fil, py.builtin._basestring): + if isinstance(fil, str): fil = FNMatcher(fil) - if isinstance(rec, py.builtin._basestring): + if isinstance(rec, str): self.rec = FNMatcher(rec) elif not hasattr(rec, "__call__") and rec: self.rec = lambda path: True @@ -882,7 +882,7 @@ def listdir(self, fil=None, sort=None): if fil is None and sort is None: names = error.checked_call(os.listdir, self.strpath) return map_as_list(self._fastjoin, names) - if isinstance(fil, py.builtin._basestring): + if isinstance(fil, str): if not self._patternchars.intersection(fil): child = self._fastjoin(fil) if exists(child.strpath): @@ -989,14 +989,14 @@ def write(self, data, mode="w", ensure=False): if ensure: self.dirpath().ensure(dir=1) if "b" in mode: - if not py.builtin._isbytes(data): + if not isinstance(data, bytes): raise ValueError("can only process bytes") else: - if not py.builtin._istext(data): - if not py.builtin._isbytes(data): + if not isinstance(data, str): + if not isinstance(data, bytes): data = str(data) else: - data = py.builtin._totext(data, sys.getdefaultencoding()) + data = data.decode(sys.getdefaultencoding()) f = self.open(mode) try: f.write(data) @@ -1221,7 +1221,8 @@ def pyimport(self, modname=None, ensuresyspath=True): mod.__file__ = str(self) sys.modules[modname] = mod try: - py.builtin.execfile(str(self), mod.__dict__) + with open(str(self), "rb") as f: + exec(f.read(), mod.__dict__) except: del sys.modules[modname] raise @@ -1239,12 +1240,12 @@ def sysexec(self, *argv, **popen_opts): proc = Popen([str(self)] + argv, **popen_opts) stdout, stderr = proc.communicate() ret = proc.wait() - if py.builtin._isbytes(stdout): - stdout = py.builtin._totext(stdout, sys.getdefaultencoding()) + if isinstance(stdout, bytes): + stdout = stdout.decode(sys.getdefaultencoding()) if ret != 0: - if py.builtin._isbytes(stderr): - stderr = py.builtin._totext(stderr, sys.getdefaultencoding()) - raise py.process.cmdexec.Error( + if isinstance(stderr, bytes): + stderr = stderr.decode(sys.getdefaultencoding()) + raise RuntimeError( ret, ret, str(self), @@ -1262,7 +1263,7 @@ def sysfind(cls, name, checker=None, paths=None): but may work on cygwin. """ if isabs(name): - p = py.path.local(name) + p = local(name) if p.check(file=1): return p else: @@ -1288,7 +1289,7 @@ def sysfind(cls, name, checker=None, paths=None): for x in paths: for addext in tryadd: - p = py.path.local(x).join(name, abs=True) + addext + p = local(x).join(name, abs=True) + addext try: if p.check(file=1): if checker: @@ -1323,7 +1324,7 @@ def get_temproot(cls): """ import tempfile - return py.path.local(tempfile.gettempdir()) + return local(tempfile.gettempdir()) @classmethod def mkdtemp(cls, rootdir=None): From 8a151774b8c3381bd03d664320574e8a70d7ffda Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:51:52 -0400 Subject: [PATCH 236/255] _pytest._py.path: remove fspath compat --- src/_pytest/_py/path.py | 62 +++++++---------------------------------- 1 file changed, 10 insertions(+), 52 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index a3c72dcbcf7..ccddcd38d3d 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -27,48 +27,6 @@ # Moved from local.py. iswin32 = sys.platform == "win32" or (getattr(os, "_name", False) == "nt") -try: - # FileNotFoundError might happen in py34, and is not available with py27. - import_errors = (ImportError, FileNotFoundError) -except NameError: - import_errors = (ImportError,) - -try: - from os import fspath -except ImportError: - - def fspath(path): - """ - Return the string representation of the path. - If str or bytes is passed in, it is returned unchanged. - This code comes from PEP 519, modified to support earlier versions of - python. - - This is required for python < 3.6. - """ - if isinstance(path, (str, bytes)): - return path - - # Work from the object's type to match method resolution of other magic - # methods. - path_type = type(path) - try: - return path_type.__fspath__(path) - except AttributeError: - if hasattr(path_type, "__fspath__"): - raise - try: - import pathlib - except import_errors: - pass - else: - if isinstance(path, pathlib.PurePath): - return str(path) - - raise TypeError( - "expected str, bytes or os.PathLike object, not " + path_type.__name__ - ) - class Checkers: _depend_on_existence = "exists", "link", "dir", "file" @@ -157,7 +115,7 @@ class PathBase: Checkers = Checkers def __div__(self, other): - return self.join(fspath(other)) + return self.join(os.fspath(other)) __truediv__ = __div__ # py3k @@ -640,7 +598,7 @@ def __init__(self, path=None, expanduser=False): self.strpath = error.checked_call(os.getcwd) else: try: - path = fspath(path) + path = os.fspath(path) except TypeError: raise ValueError( "can only pass None, Path instances " @@ -657,9 +615,9 @@ def __hash__(self): return hash(s) def __eq__(self, other): - s1 = fspath(self) + s1 = os.fspath(self) try: - s2 = fspath(other) + s2 = os.fspath(other) except TypeError: return False if iswin32: @@ -674,14 +632,14 @@ def __ne__(self, other): return not (self == other) def __lt__(self, other): - return fspath(self) < fspath(other) + return os.fspath(self) < os.fspath(other) def __gt__(self, other): - return fspath(self) > fspath(other) + return os.fspath(self) > os.fspath(other) def samefile(self, other): """return True if 'other' references the same file as 'self'.""" - other = fspath(other) + other = os.fspath(other) if not isabs(other): other = abspath(other) if self == other: @@ -820,7 +778,7 @@ def join(self, *args, **kwargs): of the args is an absolute path. """ sep = self.sep - strargs = [fspath(arg) for arg in args] + strargs = [os.fspath(arg) for arg in args] strpath = self.strpath if kwargs.get("abs"): newargs = [] @@ -945,7 +903,7 @@ def rec(p): def rename(self, target): """rename this path to target.""" - target = fspath(target) + target = os.fspath(target) return error.checked_call(os.rename, self.strpath, target) def dump(self, obj, bin=1): @@ -961,7 +919,7 @@ def dump(self, obj, bin=1): def mkdir(self, *args): """create & return the directory joined with args.""" p = self.join(*args) - error.checked_call(os.mkdir, fspath(p)) + error.checked_call(os.mkdir, os.fspath(p)) return p def write_binary(self, data, ensure=False): From 00e2f1c15ca2f3f54f5736cf7942129ed99fe31d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:52:25 -0400 Subject: [PATCH 237/255] _pytest._py.path: remove _cmp compat --- src/_pytest/_py/path.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index ccddcd38d3d..93f5528529a 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -330,13 +330,6 @@ def __add__(self, other): """return new path object with 'other' added to the basename""" return self.new(basename=self.basename + str(other)) - def __cmp__(self, other): - """return sort value (-1, 0, +1).""" - try: - return cmp(self.strpath, other.strpath) - except AttributeError: - return cmp(str(self), str(other)) # self.path, other.path) - def __lt__(self, other): try: return self.strpath < other.strpath From 382209d9e9ea0ffa61a31dcfb1a961ebf8135b3d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:53:35 -0400 Subject: [PATCH 238/255] _pytest._py.path: remove decorator compat --- src/_pytest/_py/path.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 93f5528529a..f51e574cef0 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -119,30 +119,26 @@ def __div__(self, other): __truediv__ = __div__ # py3k + @property def basename(self): """basename part of path.""" return self._getbyspec("basename")[0] - basename = property(basename, None, None, basename.__doc__) - + @property def dirname(self): """dirname part of path.""" return self._getbyspec("dirname")[0] - dirname = property(dirname, None, None, dirname.__doc__) - + @property def purebasename(self): """pure base name of the path.""" return self._getbyspec("purebasename")[0] - purebasename = property(purebasename, None, None, purebasename.__doc__) - + @property def ext(self): """extension of the path (including the '.').""" return self._getbyspec("ext")[0] - ext = property(ext, None, None, ext.__doc__) - def dirpath(self, *args, **kwargs): """return the directory path joined with any given path arguments.""" return self.new(basename="").join(*args, **kwargs) @@ -1205,6 +1201,7 @@ def sysexec(self, *argv, **popen_opts): ) return stdout + @classmethod def sysfind(cls, name, checker=None, paths=None): """return a path object found by looking at the systems underlying PATH specification. If the checker is not None @@ -1251,8 +1248,7 @@ def sysfind(cls, name, checker=None, paths=None): pass return None - sysfind = classmethod(sysfind) - + @classmethod def _gethomedir(cls): try: x = os.environ["HOME"] @@ -1263,8 +1259,6 @@ def _gethomedir(cls): return None return cls(x) - _gethomedir = classmethod(_gethomedir) - # """ # special class constructors for local filesystem paths # """ @@ -1288,6 +1282,7 @@ def mkdtemp(cls, rootdir=None): rootdir = cls.get_temproot() return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir))) + @classmethod def make_numbered_dir( cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800 ): # two days @@ -1449,8 +1444,6 @@ def is_garbage(path): return udir - make_numbered_dir = classmethod(make_numbered_dir) - def copymode(src, dest): """copy permission from src to dst.""" From eebbfc65c908346df0ff383dff7cad046e3e8616 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 13:08:48 -0400 Subject: [PATCH 239/255] _pytest._py.error: mypy typing --- src/_pytest/_py/error.py | 58 ++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/src/_pytest/_py/error.py b/src/_pytest/_py/error.py index 1f33c5aadbe..0b8f2d535ef 100644 --- a/src/_pytest/_py/error.py +++ b/src/_pytest/_py/error.py @@ -1,14 +1,23 @@ -""" -create errno-specific classes for IO or os calls. +"""create errno-specific classes for IO or os calls.""" +from __future__ import annotations -""" import errno import os import sys +from typing import Callable +from typing import TYPE_CHECKING +from typing import TypeVar + +if TYPE_CHECKING: + from typing_extensions import ParamSpec + + P = ParamSpec("P") + +R = TypeVar("R") class Error(EnvironmentError): - def __repr__(self): + def __repr__(self) -> str: return "{}.{} {!r}: {} ".format( self.__class__.__module__, self.__class__.__name__, @@ -17,7 +26,7 @@ def __repr__(self): # repr(self.args) ) - def __str__(self): + def __str__(self) -> str: s = "[{}]: {}".format( self.__class__.__doc__, " ".join(map(str, self.args)), @@ -44,10 +53,9 @@ class ErrorMaker: subclass EnvironmentError. """ - Error = Error - _errno2class = {} + _errno2class: dict[int, type[Error]] = {} - def __getattr__(self, name): + def __getattr__(self, name: str) -> type[Error]: if name[0] == "_": raise AttributeError(name) eno = getattr(errno, name) @@ -55,12 +63,12 @@ def __getattr__(self, name): setattr(self, name, cls) return cls - def _geterrnoclass(self, eno): + def _geterrnoclass(self, eno: int) -> type[Error]: try: return self._errno2class[eno] except KeyError: clsname = errno.errorcode.get(eno, "UnknownErrno%d" % (eno,)) - errorcls = type(Error)( + errorcls = type( clsname, (Error,), {"__module__": "py.error", "__doc__": os.strerror(eno)}, @@ -68,36 +76,34 @@ def _geterrnoclass(self, eno): self._errno2class[eno] = errorcls return errorcls - def checked_call(self, func, *args, **kwargs): - """call a function and raise an errno-exception if applicable.""" + def checked_call( + self, func: Callable[P, R], *args: P.args, **kwargs: P.kwargs + ) -> R: + """Call a function and raise an errno-exception if applicable.""" __tracebackhide__ = True try: return func(*args, **kwargs) - except self.Error: + except Error: raise - except OSError: - cls, value, tb = sys.exc_info() + except OSError as value: if not hasattr(value, "errno"): raise - __tracebackhide__ = False errno = value.errno - try: - if not isinstance(value, WindowsError): - raise NameError - except NameError: - # we are not on Windows, or we got a proper OSError - cls = self._geterrnoclass(errno) - else: + if sys.platform == "win32": try: cls = self._geterrnoclass(_winerrnomap[errno]) except KeyError: raise value + else: + # we are not on Windows, or we got a proper OSError + cls = self._geterrnoclass(errno) + raise cls(f"{func.__name__}{args!r}") - __tracebackhide__ = True _error_maker = ErrorMaker() +checked_call = _error_maker.checked_call -def __getattr__(attr): - return getattr(_error_maker, attr) +def __getattr__(attr: str) -> type[Error]: + return getattr(_error_maker, attr) # type: ignore[no-any-return] From 63c4d45c591e692084ff1031875c4bb00d71c28e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 16:58:16 -0400 Subject: [PATCH 240/255] _pytest._py.path: importlib mode always available --- src/_pytest/_py/path.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index f51e574cef0..3fc0d694be7 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1,8 +1,11 @@ """ local path implementation. """ +from __future__ import annotations + import atexit import fnmatch +import importlib.util import io import os import posixpath @@ -440,11 +443,6 @@ def map_as_list(func, iter): return list(map(func, iter)) -ALLOW_IMPORTLIB_MODE = sys.version_info > (3, 5) -if ALLOW_IMPORTLIB_MODE: - import importlib - - class Stat: def __getattr__(self, name): return getattr(self._osstatresult, "st_" + name) @@ -1110,8 +1108,6 @@ def pyimport(self, modname=None, ensuresyspath=True): if ensuresyspath == "importlib": if modname is None: modname = self.purebasename - if not ALLOW_IMPORTLIB_MODE: - raise ImportError("Can't use importlib due to old version of Python") spec = importlib.util.spec_from_file_location(modname, str(self)) if spec is None: raise ImportError( From 73349ef3e1896f2cab0192d96126a128d22b6c62 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 17:07:43 -0400 Subject: [PATCH 241/255] _pytest._py.path: flake8 fixes --- src/_pytest/_py/path.py | 158 ++++++++++++++++++++-------------------- 1 file changed, 78 insertions(+), 80 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 3fc0d694be7..e9b50977ed8 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1,6 +1,4 @@ -""" -local path implementation. -""" +"""local path implementation.""" from __future__ import annotations import atexit @@ -124,45 +122,45 @@ def __div__(self, other): @property def basename(self): - """basename part of path.""" + """Basename part of path.""" return self._getbyspec("basename")[0] @property def dirname(self): - """dirname part of path.""" + """Dirname part of path.""" return self._getbyspec("dirname")[0] @property def purebasename(self): - """pure base name of the path.""" + """Pure base name of the path.""" return self._getbyspec("purebasename")[0] @property def ext(self): - """extension of the path (including the '.').""" + """Extension of the path (including the '.').""" return self._getbyspec("ext")[0] def dirpath(self, *args, **kwargs): - """return the directory path joined with any given path arguments.""" + """Return the directory path joined with any given path arguments.""" return self.new(basename="").join(*args, **kwargs) def read_binary(self): - """read and return a bytestring from reading the path.""" + """Read and return a bytestring from reading the path.""" with self.open("rb") as f: return f.read() def read_text(self, encoding): - """read and return a Unicode string from reading the path.""" + """Read and return a Unicode string from reading the path.""" with self.open("r", encoding=encoding) as f: return f.read() def read(self, mode="r"): - """read and return a bytestring from reading the path.""" + """Read and return a bytestring from reading the path.""" with self.open(mode) as f: return f.read() def readlines(self, cr=1): - """read and return a list of lines from the path. if cr is False, the + """Read and return a list of lines from the path. if cr is False, the newline will be removed from the end of each line.""" mode = "r" @@ -187,7 +185,7 @@ def load(self): f.close() def move(self, target): - """move this path to target.""" + """Move this path to target.""" if target.relto(self): raise error.EINVAL(target, "cannot move path into a subdirectory of itself") try: @@ -197,11 +195,11 @@ def move(self, target): self.remove() def __repr__(self): - """return a string representation of this path.""" + """Return a string representation of this path.""" return repr(str(self)) def check(self, **kw): - """check a path for existence and properties. + """Check a path for existence and properties. Without arguments, return True if the path exists, otherwise False. @@ -222,7 +220,7 @@ def check(self, **kw): return self.Checkers(self)._evaluate(kw) def fnmatch(self, pattern): - """return true if the basename/fullname matches the glob-'pattern'. + """Return true if the basename/fullname matches the glob-'pattern'. valid pattern characters:: @@ -241,7 +239,7 @@ def fnmatch(self, pattern): return FNMatcher(pattern)(self) def relto(self, relpath): - """return a string which is the relative part of the path + """Return a string which is the relative part of the path to the given 'relpath'. """ if not isinstance(relpath, (str, PathBase)): @@ -260,11 +258,11 @@ def relto(self, relpath): return "" def ensure_dir(self, *args): - """ensure the path joined with args is a directory.""" + """Ensure the path joined with args is a directory.""" return self.ensure(*args, **{"dir": True}) def bestrelpath(self, dest): - """return a string which is a relative path from self + """Return a string which is a relative path from self (assumed to be a directory) to dest such that self.join(bestrelpath) == dest and if not such path can be determined return dest. @@ -281,10 +279,10 @@ def bestrelpath(self, dest): n = self2base.count(self.sep) + 1 else: n = 0 - l = [os.pardir] * n + lst = [os.pardir] * n if reldest: - l.append(reldest) - target = dest.sep.join(l) + lst.append(reldest) + target = dest.sep.join(lst) return target except AttributeError: return str(dest) @@ -299,23 +297,23 @@ def isfile(self): return self.check(file=1) def parts(self, reverse=False): - """return a root-first list of all ancestor directories + """Return a root-first list of all ancestor directories plus the path itself. """ current = self - l = [self] + lst = [self] while 1: last = current current = current.dirpath() if last == current: break - l.append(current) + lst.append(current) if not reverse: - l.reverse() - return l + lst.reverse() + return lst def common(self, other): - """return the common part shared with the other path + """Return the common part shared with the other path or None if there is no common part. """ last = None @@ -326,7 +324,7 @@ def common(self, other): return last def __add__(self, other): - """return new path object with 'other' added to the basename""" + """Return new path object with 'other' added to the basename""" return self.new(basename=self.basename + str(other)) def __lt__(self, other): @@ -336,7 +334,7 @@ def __lt__(self, other): return str(self) < str(other) def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): - """yields all paths below the current one + """Yields all paths below the current one fil is a filter (glob pattern or callable), if not matching the path will not be yielded, defaulting to None (everything is @@ -369,7 +367,7 @@ def _sortlist(self, res, sort): res.sort() def samefile(self, other): - """return True if other refers to the same stat object as self.""" + """Return True if other refers to the same stat object as self.""" return self.strpath == str(other) def __fspath__(self): @@ -462,7 +460,7 @@ def owner(self): @property def group(self): - """return group name of file.""" + """Return group name of file.""" if iswin32: raise NotImplementedError("XXX win32") import grp @@ -483,7 +481,7 @@ def islink(self): class PosixPath(PathBase): def chown(self, user, group, rec=0): - """change ownership to the given user and group. + """Change ownership to the given user and group. user and group may be specified by a number or by a name. if rec is True change ownership recursively. @@ -497,15 +495,15 @@ def chown(self, user, group, rec=0): error.checked_call(os.chown, str(self), uid, gid) def readlink(self): - """return value of a symbolic link.""" + """Return value of a symbolic link.""" return error.checked_call(os.readlink, self.strpath) def mklinkto(self, oldname): - """posix style hard link to another name.""" + """Posix style hard link to another name.""" error.checked_call(os.link, str(oldname), str(self)) def mksymlinkto(self, value, absolute=1): - """create a symbolic link with the given value (pointing to another name).""" + """Create a symbolic link with the given value (pointing to another name).""" if absolute: error.checked_call(os.symlink, str(value), self.strpath) else: @@ -538,7 +536,7 @@ def getgroupid(group): class LocalPath(FSBase): - """object oriented interface to os.path and other local filesystem + """Object oriented interface to os.path and other local filesystem related information. """ @@ -625,7 +623,7 @@ def __gt__(self, other): return os.fspath(self) > os.fspath(other) def samefile(self, other): - """return True if 'other' references the same file as 'self'.""" + """Return True if 'other' references the same file as 'self'.""" other = os.fspath(other) if not isabs(other): other = abspath(other) @@ -636,7 +634,7 @@ def samefile(self, other): return error.checked_call(os.path.samefile, self.strpath, other) def remove(self, rec=1, ignore_errors=False): - """remove a file or directory (or a directory tree if rec=1). + """Remove a file or directory (or a directory tree if rec=1). if ignore_errors is True, errors while removing directories will be ignored. """ @@ -658,7 +656,7 @@ def remove(self, rec=1, ignore_errors=False): error.checked_call(os.remove, self.strpath) def computehash(self, hashtype="md5", chunksize=524288): - """return hexdigest of hashvalue for this file.""" + """Return hexdigest of hashvalue for this file.""" try: try: import hashlib as mod @@ -680,7 +678,7 @@ def computehash(self, hashtype="md5", chunksize=524288): f.close() def new(self, **kw): - """create a modified version of this path. + """Create a modified version of this path. the following keyword arguments modify various path parts:: a:/some/path/to/a/file.ext @@ -720,7 +718,7 @@ def new(self, **kw): return obj def _getbyspec(self, spec): - """see new for what 'spec' can be.""" + """See new for what 'spec' can be.""" res = [] parts = self.strpath.split(self.sep) @@ -750,7 +748,7 @@ def _getbyspec(self, spec): return res def dirpath(self, *args, **kwargs): - """return the directory path joined with any given path arguments.""" + """Return the directory path joined with any given path arguments.""" if not kwargs: path = object.__new__(self.__class__) path.strpath = dirname(self.strpath) @@ -760,7 +758,7 @@ def dirpath(self, *args, **kwargs): return super().dirpath(*args, **kwargs) def join(self, *args, **kwargs): - """return a new path by appending all 'args' as path + """Return a new path by appending all 'args' as path components. if abs=1 is used restart from root if any of the args is an absolute path. """ @@ -790,7 +788,7 @@ def join(self, *args, **kwargs): return obj def open(self, mode="r", ensure=False, encoding=None): - """return an opened file with the given mode. + """Return an opened file with the given mode. If ensure is True, create parent directories if needed. """ @@ -821,7 +819,7 @@ def check(self, **kw): _patternchars = set("*?[" + os.path.sep) def listdir(self, fil=None, sort=None): - """list directory contents, possibly filter by the given fil func + """List directory contents, possibly filter by the given fil func and possibly sorted. """ if fil is None and sort is None: @@ -844,15 +842,15 @@ def listdir(self, fil=None, sort=None): return res def size(self): - """return size of the underlying file object""" + """Return size of the underlying file object""" return self.stat().size def mtime(self): - """return last modification time of the path.""" + """Return last modification time of the path.""" return self.stat().mtime def copy(self, target, mode=False, stat=False): - """copy path to target. + """Copy path to target. If mode is True, will copy copy permission from path to target. If stat is True, copy permission, last modification @@ -889,12 +887,12 @@ def rec(p): copystat(x, newx) def rename(self, target): - """rename this path to target.""" + """Rename this path to target.""" target = os.fspath(target) return error.checked_call(os.rename, self.strpath, target) def dump(self, obj, bin=1): - """pickle object into path location""" + """Pickle object into path location""" f = self.open("wb") import pickle @@ -904,13 +902,13 @@ def dump(self, obj, bin=1): f.close() def mkdir(self, *args): - """create & return the directory joined with args.""" + """Create & return the directory joined with args.""" p = self.join(*args) error.checked_call(os.mkdir, os.fspath(p)) return p def write_binary(self, data, ensure=False): - """write binary data into path. If ensure is True create + """Write binary data into path. If ensure is True create missing parent directories. """ if ensure: @@ -919,7 +917,7 @@ def write_binary(self, data, ensure=False): f.write(data) def write_text(self, data, encoding, ensure=False): - """write text data into path using the specified encoding. + """Write text data into path using the specified encoding. If ensure is True create missing parent directories. """ if ensure: @@ -928,7 +926,7 @@ def write_text(self, data, encoding, ensure=False): f.write(data) def write(self, data, mode="w", ensure=False): - """write data into path. If ensure is True create + """Write data into path. If ensure is True create missing parent directories. """ if ensure: @@ -965,7 +963,7 @@ def _ensuredirs(self): return self def ensure(self, *args, **kwargs): - """ensure that an args-joined path exists (by default as + """Ensure that an args-joined path exists (by default as a file). if you specify a keyword argument 'dir=True' then the path is forced to be a directory path. """ @@ -980,7 +978,7 @@ def ensure(self, *args, **kwargs): def stat(self, raising=True): """Return an os.stat() tuple.""" - if raising == True: + if raising: return Stat(self, error.checked_call(os.stat, self.strpath)) try: return Stat(self, os.stat(self.strpath)) @@ -994,7 +992,7 @@ def lstat(self): return Stat(self, error.checked_call(os.lstat, self.strpath)) def setmtime(self, mtime=None): - """set modification time for the given path. if 'mtime' is None + """Set modification time for the given path. if 'mtime' is None (the default) then the file's mtime is set to current time. Note that the resolution for 'mtime' is platform dependent. @@ -1007,7 +1005,7 @@ def setmtime(self, mtime=None): return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) def chdir(self): - """change directory to self and return old current directory""" + """Change directory to self and return old current directory""" try: old = self.__class__() except error.ENOENT: @@ -1030,22 +1028,22 @@ def as_cwd(self): old.chdir() def realpath(self): - """return a new path which contains no symbolic links.""" + """Return a new path which contains no symbolic links.""" return self.__class__(os.path.realpath(self.strpath)) def atime(self): - """return last access time of the path.""" + """Return last access time of the path.""" return self.stat().atime def __repr__(self): return "local(%r)" % self.strpath def __str__(self): - """return string representation of the Path.""" + """Return string representation of the Path.""" return self.strpath def chmod(self, mode, rec=0): - """change permissions to the given mode. If mode is an + """Change permissions to the given mode. If mode is an integer it directly encodes the os-specific modes. if rec is True perform recursively. """ @@ -1057,7 +1055,7 @@ def chmod(self, mode, rec=0): error.checked_call(os.chmod, self.strpath, mode) def pypkgpath(self): - """return the Python package path by looking for the last + """Return the Python package path by looking for the last directory upwards which still contains an __init__.py. Return None if a pkgpath can not be determined. """ @@ -1082,7 +1080,7 @@ def _ensuresyspath(self, ensuremode, path): sys.path.insert(0, s) def pyimport(self, modname=None, ensuresyspath=True): - """return path as an imported python module. + """Return path as an imported python module. If modname is None, look for the containing package and construct an according module name. @@ -1166,13 +1164,13 @@ def pyimport(self, modname=None, ensuresyspath=True): try: with open(str(self), "rb") as f: exec(f.read(), mod.__dict__) - except: + except BaseException: del sys.modules[modname] raise return mod def sysexec(self, *argv, **popen_opts): - """return stdout text from executing a system child process, + """Return stdout text from executing a system child process, where the 'self' path points to executable. The process is directly invoked and not through a system shell. """ @@ -1199,7 +1197,7 @@ def sysexec(self, *argv, **popen_opts): @classmethod def sysfind(cls, name, checker=None, paths=None): - """return a path object found by looking at the systems + """Return a path object found by looking at the systems underlying PATH specification. If the checker is not None it will be invoked to filter matching paths. If a binary cannot be found, None is returned @@ -1260,7 +1258,7 @@ def _gethomedir(cls): # """ @classmethod def get_temproot(cls): - """return the system's temporary directory + """Return the system's temporary directory (where tempfiles are usually created in) """ import tempfile @@ -1269,7 +1267,7 @@ def get_temproot(cls): @classmethod def mkdtemp(cls, rootdir=None): - """return a Path object pointing to a fresh new temporary directory + """Return a Path object pointing to a fresh new temporary directory (which we created ourself). """ import tempfile @@ -1282,7 +1280,7 @@ def mkdtemp(cls, rootdir=None): def make_numbered_dir( cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800 ): # two days - """return unique directory with a number greater than the current + """Return unique directory with a number greater than the current maximum one. The number is assumed to start directly after prefix. if keep is true directories with a number less than (maxnum-keep) will be removed. If .lock files are used (lock_timeout non-zero), @@ -1294,7 +1292,7 @@ def make_numbered_dir( nprefix = prefix.lower() def parse_num(path): - """parse the number out of a path (if it matches the prefix)""" + """Parse the number out of a path (if it matches the prefix)""" nbasename = path.basename.lower() if nbasename.startswith(nprefix): try: @@ -1303,7 +1301,7 @@ def parse_num(path): pass def create_lockfile(path): - """exclusively create lockfile. Throws when failed""" + """Exclusively create lockfile. Throws when failed""" mypid = os.getpid() lockfile = path.join(".lock") if hasattr(lockfile, "mksymlinkto"): @@ -1317,7 +1315,7 @@ def create_lockfile(path): return lockfile def atexit_remove_lockfile(lockfile): - """ensure lockfile is removed at process exit""" + """Ensure lockfile is removed at process exit""" mypid = os.getpid() def try_remove_lockfile(): @@ -1366,7 +1364,7 @@ def try_remove_lockfile(): break def get_mtime(path): - """read file modification time""" + """Read file modification time""" try: return path.lstat().mtime except error.Error: @@ -1375,7 +1373,7 @@ def get_mtime(path): garbage_prefix = prefix + "garbage-" def is_garbage(path): - """check if path denotes directory scheduled for removal""" + """Check if path denotes directory scheduled for removal""" bn = path.basename return bn.startswith(garbage_prefix) @@ -1408,14 +1406,14 @@ def is_garbage(path): garbage_path.remove(rec=1) except KeyboardInterrupt: raise - except: # this might be error.Error, WindowsError ... + except Exception: # this might be error.Error, WindowsError ... pass if is_garbage(path): try: path.remove(rec=1) except KeyboardInterrupt: raise - except: # this might be error.Error, WindowsError ... + except Exception: # this might be error.Error, WindowsError ... pass # make link... @@ -1442,14 +1440,14 @@ def is_garbage(path): def copymode(src, dest): - """copy permission from src to dst.""" + """Copy permission from src to dst.""" import shutil shutil.copymode(src, dest) def copystat(src, dest): - """copy permission, last modification time, + """Copy permission, last modification time, last access time, and flags from src to dst.""" import shutil From af078f3a96cab9fbad610bd6c20a256a5c249cf7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 18:37:22 -0400 Subject: [PATCH 242/255] _pytest._py.path: combine Checkers classes --- src/_pytest/_py/path.py | 60 +++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index e9b50977ed8..5cca5c1471f 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -35,12 +35,6 @@ class Checkers: def __init__(self, path): self.path = path - def dir(self): - raise NotImplementedError - - def file(self): - raise NotImplementedError - def dotfile(self): return self.path.basename.startswith(".") @@ -49,9 +43,6 @@ def ext(self, arg): arg = "." + arg return self.path.ext == arg - def exists(self): - raise NotImplementedError - def basename(self, arg): return self.path.basename == arg @@ -105,6 +96,29 @@ def _evaluate(self, kw): return False return True + def _stat(self): + try: + return self._statcache + except AttributeError: + try: + self._statcache = self.path.stat() + except error.ELOOP: + self._statcache = self.path.lstat() + return self._statcache + + def dir(self): + return S_ISDIR(self._stat().mode) + + def file(self): + return S_ISREG(self._stat().mode) + + def exists(self): + return self._stat() + + def link(self): + st = self.path.lstat() + return S_ISLNK(st.mode) + class NeverRaised(Exception): pass @@ -113,8 +127,6 @@ class NeverRaised(Exception): class PathBase: """shared implementation for filesystem path objects.""" - Checkers = Checkers - def __div__(self, other): return self.join(os.fspath(other)) @@ -217,7 +229,7 @@ def check(self, **kw): """ if not kw: kw = {"exists": 1} - return self.Checkers(self)._evaluate(kw) + return Checkers(self)._evaluate(kw) def fnmatch(self, pattern): """Return true if the basename/fullname matches the glob-'pattern'. @@ -545,30 +557,6 @@ class ImportMismatchError(ImportError): sep = os.sep - class Checkers(Checkers): - def _stat(self): - try: - return self._statcache - except AttributeError: - try: - self._statcache = self.path.stat() - except error.ELOOP: - self._statcache = self.path.lstat() - return self._statcache - - def dir(self): - return S_ISDIR(self._stat().mode) - - def file(self): - return S_ISREG(self._stat().mode) - - def exists(self): - return self._stat() - - def link(self): - st = self.path.lstat() - return S_ISLNK(st.mode) - def __init__(self, path=None, expanduser=False): """Initialize and return a local Path instance. From 6660d4552140679f9bd66b8821a1550f4e39ddb6 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 18:44:36 -0400 Subject: [PATCH 243/255] _pytest._py.path: combine PosixPath into LocalPath --- src/_pytest/_py/path.py | 79 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 5cca5c1471f..378de6967bf 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -491,43 +491,6 @@ def islink(self): return S_ISLNK(self._osstatresult.st_mode) -class PosixPath(PathBase): - def chown(self, user, group, rec=0): - """Change ownership to the given user and group. - user and group may be specified by a number or - by a name. if rec is True change ownership - recursively. - """ - uid = getuserid(user) - gid = getgroupid(group) - if rec: - for x in self.visit(rec=lambda x: x.check(link=0)): - if x.check(link=0): - error.checked_call(os.chown, str(x), uid, gid) - error.checked_call(os.chown, str(self), uid, gid) - - def readlink(self): - """Return value of a symbolic link.""" - return error.checked_call(os.readlink, self.strpath) - - def mklinkto(self, oldname): - """Posix style hard link to another name.""" - error.checked_call(os.link, str(oldname), str(self)) - - def mksymlinkto(self, value, absolute=1): - """Create a symbolic link with the given value (pointing to another name).""" - if absolute: - error.checked_call(os.symlink, str(value), self.strpath) - else: - base = self.common(value) - # with posix local paths '/' is always a common base - relsource = self.__class__(value).relto(base) - reldest = self.relto(base) - n = reldest.count(self.sep) - target = self.sep.join(("..",) * n + (relsource,)) - error.checked_call(os.symlink, target, self.strpath) - - def getuserid(user): import pwd @@ -544,10 +507,7 @@ def getgroupid(group): return group -FSBase = not iswin32 and PosixPath or PathBase - - -class LocalPath(FSBase): +class LocalPath(PathBase): """Object oriented interface to os.path and other local filesystem related information. """ @@ -581,6 +541,43 @@ def __init__(self, path=None, expanduser=False): path = os.path.expanduser(path) self.strpath = abspath(path) + if sys.platform != "win32": + + def chown(self, user, group, rec=0): + """Change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. + """ + uid = getuserid(user) + gid = getgroupid(group) + if rec: + for x in self.visit(rec=lambda x: x.check(link=0)): + if x.check(link=0): + error.checked_call(os.chown, str(x), uid, gid) + error.checked_call(os.chown, str(self), uid, gid) + + def readlink(self): + """Return value of a symbolic link.""" + return error.checked_call(os.readlink, self.strpath) + + def mklinkto(self, oldname): + """Posix style hard link to another name.""" + error.checked_call(os.link, str(oldname), str(self)) + + def mksymlinkto(self, value, absolute=1): + """Create a symbolic link with the given value (pointing to another name).""" + if absolute: + error.checked_call(os.symlink, str(value), self.strpath) + else: + base = self.common(value) + # with posix local paths '/' is always a common base + relsource = self.__class__(value).relto(base) + reldest = self.relto(base) + n = reldest.count(self.sep) + target = self.sep.join(("..",) * n + (relsource,)) + error.checked_call(os.symlink, target, self.strpath) + def __hash__(self): s = self.strpath if iswin32: From ed4c18f686282b4a7603b04cd3e9c1855366202c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 18:50:44 -0400 Subject: [PATCH 244/255] _pytest._py.path: combine PathBase and LocalPath --- src/_pytest/_py/path.py | 449 +++++++++++++++++++--------------------- 1 file changed, 212 insertions(+), 237 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 378de6967bf..2e2189cb3cf 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -124,8 +124,197 @@ class NeverRaised(Exception): pass -class PathBase: - """shared implementation for filesystem path objects.""" +class Visitor: + def __init__(self, fil, rec, ignore, bf, sort): + if isinstance(fil, str): + fil = FNMatcher(fil) + if isinstance(rec, str): + self.rec = FNMatcher(rec) + elif not hasattr(rec, "__call__") and rec: + self.rec = lambda path: True + else: + self.rec = rec + self.fil = fil + self.ignore = ignore + self.breadthfirst = bf + self.optsort = sort and sorted or (lambda x: x) + + def gen(self, path): + try: + entries = path.listdir() + except self.ignore: + return + rec = self.rec + dirs = self.optsort( + [p for p in entries if p.check(dir=1) and (rec is None or rec(p))] + ) + if not self.breadthfirst: + for subdir in dirs: + for p in self.gen(subdir): + yield p + for p in self.optsort(entries): + if self.fil is None or self.fil(p): + yield p + if self.breadthfirst: + for subdir in dirs: + for p in self.gen(subdir): + yield p + + +class FNMatcher: + def __init__(self, pattern): + self.pattern = pattern + + def __call__(self, path): + pattern = self.pattern + + if ( + pattern.find(path.sep) == -1 + and iswin32 + and pattern.find(posixpath.sep) != -1 + ): + # Running on Windows, the pattern has no Windows path separators, + # and the pattern has one or more Posix path separators. Replace + # the Posix path separators with the Windows path separator. + pattern = pattern.replace(posixpath.sep, path.sep) + + if pattern.find(path.sep) == -1: + name = path.basename + else: + name = str(path) # path.strpath # XXX svn? + if not os.path.isabs(pattern): + pattern = "*" + path.sep + pattern + return fnmatch.fnmatch(name, pattern) + + +def map_as_list(func, iter): + return list(map(func, iter)) + + +class Stat: + def __getattr__(self, name): + return getattr(self._osstatresult, "st_" + name) + + def __init__(self, path, osstatresult): + self.path = path + self._osstatresult = osstatresult + + @property + def owner(self): + if iswin32: + raise NotImplementedError("XXX win32") + import pwd + + entry = error.checked_call(pwd.getpwuid, self.uid) + return entry[0] + + @property + def group(self): + """Return group name of file.""" + if iswin32: + raise NotImplementedError("XXX win32") + import grp + + entry = error.checked_call(grp.getgrgid, self.gid) + return entry[0] + + def isdir(self): + return S_ISDIR(self._osstatresult.st_mode) + + def isfile(self): + return S_ISREG(self._osstatresult.st_mode) + + def islink(self): + self.path.lstat() + return S_ISLNK(self._osstatresult.st_mode) + + +def getuserid(user): + import pwd + + if not isinstance(user, int): + user = pwd.getpwnam(user)[2] + return user + + +def getgroupid(group): + import grp + + if not isinstance(group, int): + group = grp.getgrnam(group)[2] + return group + + +class LocalPath: + """Object oriented interface to os.path and other local filesystem + related information. + """ + + class ImportMismatchError(ImportError): + """raised on pyimport() if there is a mismatch of __file__'s""" + + sep = os.sep + + def __init__(self, path=None, expanduser=False): + """Initialize and return a local Path instance. + + Path can be relative to the current directory. + If path is None it defaults to the current working directory. + If expanduser is True, tilde-expansion is performed. + Note that Path instances always carry an absolute path. + Note also that passing in a local path object will simply return + the exact same path object. Use new() to get a new copy. + """ + if path is None: + self.strpath = error.checked_call(os.getcwd) + else: + try: + path = os.fspath(path) + except TypeError: + raise ValueError( + "can only pass None, Path instances " + "or non-empty strings to LocalPath" + ) + if expanduser: + path = os.path.expanduser(path) + self.strpath = abspath(path) + + if sys.platform != "win32": + + def chown(self, user, group, rec=0): + """Change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. + """ + uid = getuserid(user) + gid = getgroupid(group) + if rec: + for x in self.visit(rec=lambda x: x.check(link=0)): + if x.check(link=0): + error.checked_call(os.chown, str(x), uid, gid) + error.checked_call(os.chown, str(self), uid, gid) + + def readlink(self): + """Return value of a symbolic link.""" + return error.checked_call(os.readlink, self.strpath) + + def mklinkto(self, oldname): + """Posix style hard link to another name.""" + error.checked_call(os.link, str(oldname), str(self)) + + def mksymlinkto(self, value, absolute=1): + """Create a symbolic link with the given value (pointing to another name).""" + if absolute: + error.checked_call(os.symlink, str(value), self.strpath) + else: + base = self.common(value) + # with posix local paths '/' is always a common base + relsource = self.__class__(value).relto(base) + reldest = self.relto(base) + n = reldest.count(self.sep) + target = self.sep.join(("..",) * n + (relsource,)) + error.checked_call(os.symlink, target, self.strpath) def __div__(self, other): return self.join(os.fspath(other)) @@ -152,10 +341,6 @@ def ext(self): """Extension of the path (including the '.').""" return self._getbyspec("ext")[0] - def dirpath(self, *args, **kwargs): - """Return the directory path joined with any given path arguments.""" - return self.new(basename="").join(*args, **kwargs) - def read_binary(self): """Read and return a bytestring from reading the path.""" with self.open("rb") as f: @@ -206,31 +391,6 @@ def move(self, target): self.copy(target) self.remove() - def __repr__(self): - """Return a string representation of this path.""" - return repr(str(self)) - - def check(self, **kw): - """Check a path for existence and properties. - - Without arguments, return True if the path exists, otherwise False. - - valid checkers:: - - file=1 # is a file - file=0 # is not a file (may not even exist) - dir=1 # is a dir - link=1 # is a link - exists=1 # exists - - You can specify multiple checker definitions, for example:: - - path.check(file=1, link=1) # a link pointing to a file - """ - if not kw: - kw = {"exists": 1} - return Checkers(self)._evaluate(kw) - def fnmatch(self, pattern): """Return true if the basename/fullname matches the glob-'pattern'. @@ -254,7 +414,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, PathBase)): + 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: @@ -339,12 +499,6 @@ def __add__(self, other): """Return new path object with 'other' added to the basename""" return self.new(basename=self.basename + str(other)) - def __lt__(self, other): - try: - return self.strpath < other.strpath - except AttributeError: - return str(self) < str(other) - def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): """Yields all paths below the current one @@ -378,206 +532,9 @@ def _sortlist(self, res, sort): else: res.sort() - def samefile(self, other): - """Return True if other refers to the same stat object as self.""" - return self.strpath == str(other) - def __fspath__(self): return self.strpath - -class Visitor: - def __init__(self, fil, rec, ignore, bf, sort): - if isinstance(fil, str): - fil = FNMatcher(fil) - if isinstance(rec, str): - self.rec = FNMatcher(rec) - elif not hasattr(rec, "__call__") and rec: - self.rec = lambda path: True - else: - self.rec = rec - self.fil = fil - self.ignore = ignore - self.breadthfirst = bf - self.optsort = sort and sorted or (lambda x: x) - - def gen(self, path): - try: - entries = path.listdir() - except self.ignore: - return - rec = self.rec - dirs = self.optsort( - [p for p in entries if p.check(dir=1) and (rec is None or rec(p))] - ) - if not self.breadthfirst: - for subdir in dirs: - for p in self.gen(subdir): - yield p - for p in self.optsort(entries): - if self.fil is None or self.fil(p): - yield p - if self.breadthfirst: - for subdir in dirs: - for p in self.gen(subdir): - yield p - - -class FNMatcher: - def __init__(self, pattern): - self.pattern = pattern - - def __call__(self, path): - pattern = self.pattern - - if ( - pattern.find(path.sep) == -1 - and iswin32 - and pattern.find(posixpath.sep) != -1 - ): - # Running on Windows, the pattern has no Windows path separators, - # and the pattern has one or more Posix path separators. Replace - # the Posix path separators with the Windows path separator. - pattern = pattern.replace(posixpath.sep, path.sep) - - if pattern.find(path.sep) == -1: - name = path.basename - else: - name = str(path) # path.strpath # XXX svn? - if not os.path.isabs(pattern): - pattern = "*" + path.sep + pattern - return fnmatch.fnmatch(name, pattern) - - -def map_as_list(func, iter): - return list(map(func, iter)) - - -class Stat: - def __getattr__(self, name): - return getattr(self._osstatresult, "st_" + name) - - def __init__(self, path, osstatresult): - self.path = path - self._osstatresult = osstatresult - - @property - def owner(self): - if iswin32: - raise NotImplementedError("XXX win32") - import pwd - - entry = error.checked_call(pwd.getpwuid, self.uid) - return entry[0] - - @property - def group(self): - """Return group name of file.""" - if iswin32: - raise NotImplementedError("XXX win32") - import grp - - entry = error.checked_call(grp.getgrgid, self.gid) - return entry[0] - - def isdir(self): - return S_ISDIR(self._osstatresult.st_mode) - - def isfile(self): - return S_ISREG(self._osstatresult.st_mode) - - def islink(self): - self.path.lstat() - return S_ISLNK(self._osstatresult.st_mode) - - -def getuserid(user): - import pwd - - if not isinstance(user, int): - user = pwd.getpwnam(user)[2] - return user - - -def getgroupid(group): - import grp - - if not isinstance(group, int): - group = grp.getgrnam(group)[2] - return group - - -class LocalPath(PathBase): - """Object oriented interface to os.path and other local filesystem - related information. - """ - - class ImportMismatchError(ImportError): - """raised on pyimport() if there is a mismatch of __file__'s""" - - sep = os.sep - - def __init__(self, path=None, expanduser=False): - """Initialize and return a local Path instance. - - Path can be relative to the current directory. - If path is None it defaults to the current working directory. - If expanduser is True, tilde-expansion is performed. - Note that Path instances always carry an absolute path. - Note also that passing in a local path object will simply return - the exact same path object. Use new() to get a new copy. - """ - if path is None: - self.strpath = error.checked_call(os.getcwd) - else: - try: - path = os.fspath(path) - except TypeError: - raise ValueError( - "can only pass None, Path instances " - "or non-empty strings to LocalPath" - ) - if expanduser: - path = os.path.expanduser(path) - self.strpath = abspath(path) - - if sys.platform != "win32": - - def chown(self, user, group, rec=0): - """Change ownership to the given user and group. - user and group may be specified by a number or - by a name. if rec is True change ownership - recursively. - """ - uid = getuserid(user) - gid = getgroupid(group) - if rec: - for x in self.visit(rec=lambda x: x.check(link=0)): - if x.check(link=0): - error.checked_call(os.chown, str(x), uid, gid) - error.checked_call(os.chown, str(self), uid, gid) - - def readlink(self): - """Return value of a symbolic link.""" - return error.checked_call(os.readlink, self.strpath) - - def mklinkto(self, oldname): - """Posix style hard link to another name.""" - error.checked_call(os.link, str(oldname), str(self)) - - def mksymlinkto(self, value, absolute=1): - """Create a symbolic link with the given value (pointing to another name).""" - if absolute: - error.checked_call(os.symlink, str(value), self.strpath) - else: - base = self.common(value) - # with posix local paths '/' is always a common base - relsource = self.__class__(value).relto(base) - reldest = self.relto(base) - n = reldest.count(self.sep) - target = self.sep.join(("..",) * n + (relsource,)) - error.checked_call(os.symlink, target, self.strpath) - def __hash__(self): s = self.strpath if iswin32: @@ -740,7 +697,7 @@ def dirpath(self, *args, **kwargs): if args: path = path.join(*args) return path - return super().dirpath(*args, **kwargs) + return self.new(basename="").join(*args, **kwargs) def join(self, *args, **kwargs): """Return a new path by appending all 'args' as path @@ -792,6 +749,22 @@ def islink(self): return islink(self.strpath) def check(self, **kw): + """Check a path for existence and properties. + + Without arguments, return True if the path exists, otherwise False. + + valid checkers:: + + file=1 # is a file + file=0 # is not a file (may not even exist) + dir=1 # is a dir + link=1 # is a link + exists=1 # exists + + You can specify multiple checker definitions, for example:: + + path.check(file=1, link=1) # a link pointing to a file + """ if not kw: return exists(self.strpath) if len(kw) == 1: @@ -799,7 +772,9 @@ def check(self, **kw): return not kw["dir"] ^ isdir(self.strpath) if "file" in kw: return not kw["file"] ^ isfile(self.strpath) - return super().check(**kw) + if not kw: + kw = {"exists": 1} + return Checkers(self)._evaluate(kw) _patternchars = set("*?[" + os.path.sep) From 59d8f8a22324fa7e816c53c271e4096c44bd536b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 19:26:44 -0400 Subject: [PATCH 245/255] _pytest._py.path: get mypy passing --- src/_pytest/_py/path.py | 82 +++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 2e2189cb3cf..00f1515238b 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -22,9 +22,16 @@ from stat import S_ISDIR from stat import S_ISLNK from stat import S_ISREG +from typing import Any +from typing import Callable +from typing import overload +from typing import TYPE_CHECKING from . import error +if TYPE_CHECKING: + from typing import Literal + # Moved from local.py. iswin32 = sys.platform == "win32" or (getattr(os, "_name", False) == "nt") @@ -96,7 +103,9 @@ def _evaluate(self, kw): return False return True - def _stat(self): + _statcache: Stat + + def _stat(self) -> Stat: try: return self._statcache except AttributeError: @@ -129,7 +138,7 @@ def __init__(self, fil, rec, ignore, bf, sort): if isinstance(fil, str): fil = FNMatcher(fil) if isinstance(rec, str): - self.rec = FNMatcher(rec) + self.rec: Callable[[LocalPath], bool] = FNMatcher(rec) elif not hasattr(rec, "__call__") and rec: self.rec = lambda path: True else: @@ -192,7 +201,17 @@ def map_as_list(func, iter): class Stat: - def __getattr__(self, name): + if TYPE_CHECKING: + + @property + def size(self) -> int: + ... + + @property + def mtime(self) -> float: + ... + + def __getattr__(self, name: str) -> Any: return getattr(self._osstatresult, "st_" + name) def __init__(self, path, osstatresult): @@ -295,9 +314,10 @@ def chown(self, user, group, rec=0): error.checked_call(os.chown, str(x), uid, gid) error.checked_call(os.chown, str(self), uid, gid) - def readlink(self): + def readlink(self) -> str: """Return value of a symbolic link.""" - return error.checked_call(os.readlink, self.strpath) + # https://github.com/python/mypy/issues/12278 + return error.checked_call(os.readlink, self.strpath) # type: ignore[arg-type,return-value] def mklinkto(self, oldname): """Posix style hard link to another name.""" @@ -659,22 +679,21 @@ def new(self, **kw): obj.strpath = normpath("%(dirname)s%(sep)s%(basename)s" % kw) return obj - def _getbyspec(self, spec): + def _getbyspec(self, spec: str) -> list[str]: """See new for what 'spec' can be.""" res = [] parts = self.strpath.split(self.sep) args = filter(None, spec.split(",")) - append = res.append for name in args: if name == "drive": - append(parts[0]) + res.append(parts[0]) elif name == "dirname": - append(self.sep.join(parts[:-1])) + res.append(self.sep.join(parts[:-1])) else: basename = parts[-1] if name == "basename": - append(basename) + res.append(basename) else: i = basename.rfind(".") if i == -1: @@ -682,9 +701,9 @@ def _getbyspec(self, spec): else: purebasename, ext = basename[:i], basename[i:] if name == "purebasename": - append(purebasename) + res.append(purebasename) elif name == "ext": - append(ext) + res.append(ext) else: raise ValueError("invalid part specification %r" % name) return res @@ -699,7 +718,7 @@ def dirpath(self, *args, **kwargs): return path return self.new(basename="").join(*args, **kwargs) - def join(self, *args, **kwargs): + def join(self, *args: os.PathLike[str], abs: bool = False) -> LocalPath: """Return a new path by appending all 'args' as path components. if abs=1 is used restart from root if any of the args is an absolute path. @@ -707,8 +726,8 @@ def join(self, *args, **kwargs): sep = self.sep strargs = [os.fspath(arg) for arg in args] strpath = self.strpath - if kwargs.get("abs"): - newargs = [] + if abs: + newargs: list[str] = [] for arg in reversed(strargs): if isabs(arg): strpath = arg @@ -801,11 +820,11 @@ def listdir(self, fil=None, sort=None): self._sortlist(res, sort) return res - def size(self): + def size(self) -> int: """Return size of the underlying file object""" return self.stat().size - def mtime(self): + def mtime(self) -> float: """Return last modification time of the path.""" return self.stat().mtime @@ -936,7 +955,15 @@ def ensure(self, *args, **kwargs): p.open("w").close() return p - def stat(self, raising=True): + @overload + def stat(self, raising: Literal[True] = ...) -> Stat: + ... + + @overload + def stat(self, raising: Literal[False]) -> Stat | None: + ... + + def stat(self, raising: bool = True) -> Stat | None: """Return an os.stat() tuple.""" if raising: return Stat(self, error.checked_call(os.stat, self.strpath)) @@ -947,7 +974,7 @@ def stat(self, raising=True): except Exception: return None - def lstat(self): + def lstat(self) -> Stat: """Return an os.lstat() tuple.""" return Stat(self, error.checked_call(os.lstat, self.strpath)) @@ -1067,7 +1094,7 @@ def pyimport(self, modname=None, ensuresyspath=True): if modname is None: modname = self.purebasename spec = importlib.util.spec_from_file_location(modname, str(self)) - if spec is None: + if spec is None or spec.loader is None: raise ImportError( f"Can't find module {modname} at location {str(self)}" ) @@ -1095,6 +1122,7 @@ def pyimport(self, modname=None, ensuresyspath=True): return mod # we don't check anything as we might # be in a namespace package ... too icky to check modfile = mod.__file__ + assert modfile is not None if modfile[-4:] in (".pyc", ".pyo"): modfile = modfile[:-1] elif modfile.endswith("$py.class"): @@ -1129,16 +1157,22 @@ def pyimport(self, modname=None, ensuresyspath=True): raise return mod - def sysexec(self, *argv, **popen_opts): + def sysexec(self, *argv: os.PathLike[str], **popen_opts: Any) -> str: """Return stdout text from executing a system child process, where the 'self' path points to executable. The process is directly invoked and not through a system shell. """ from subprocess import Popen, PIPE - argv = map_as_list(str, argv) - popen_opts["stdout"] = popen_opts["stderr"] = PIPE - proc = Popen([str(self)] + argv, **popen_opts) + popen_opts.pop("stdout", None) + popen_opts.pop("stderr", None) + proc = Popen( + [str(self)] + [str(arg) for arg in argv], + **popen_opts, + stdout=PIPE, + stderr=PIPE, + ) + stdout: str | bytes stdout, stderr = proc.communicate() ret = proc.wait() if isinstance(stdout, bytes): From 82344ba4f8e6bd49afd52235385a105890dc3d88 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 21:42:11 -0400 Subject: [PATCH 246/255] add py.path.local tests --- testing/_py/test_local.py | 1542 +++++++++++++++++++++++++++++++++++++ 1 file changed, 1542 insertions(+) create mode 100644 testing/_py/test_local.py diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py new file mode 100644 index 00000000000..6e2c44bc2e0 --- /dev/null +++ b/testing/_py/test_local.py @@ -0,0 +1,1542 @@ +import multiprocessing +import os +import sys +import time + +import pytest +from py import error +from py.path import local + + +class CommonFSTests: + def test_constructor_equality(self, path1): + p = path1.__class__(path1) + assert p == path1 + + def test_eq_nonstring(self, path1): + p1 = path1.join("sampledir") + p2 = path1.join("sampledir") + assert p1 == p2 + + def test_new_identical(self, path1): + assert path1 == path1.new() + + def test_join(self, path1): + p = path1.join("sampledir") + strp = str(p) + assert strp.endswith("sampledir") + assert strp.startswith(str(path1)) + + def test_join_normalized(self, path1): + newpath = path1.join(path1.sep + "sampledir") + strp = str(newpath) + assert strp.endswith("sampledir") + assert strp.startswith(str(path1)) + newpath = path1.join((path1.sep * 2) + "sampledir") + strp = str(newpath) + assert strp.endswith("sampledir") + assert strp.startswith(str(path1)) + + def test_join_noargs(self, path1): + newpath = path1.join() + assert path1 == newpath + + def test_add_something(self, path1): + p = path1.join("sample") + p = p + "dir" + assert p.check() + assert p.exists() + assert p.isdir() + assert not p.isfile() + + def test_parts(self, path1): + newpath = path1.join("sampledir", "otherfile") + par = newpath.parts()[-3:] + assert par == [path1, path1.join("sampledir"), newpath] + + revpar = newpath.parts(reverse=True)[:3] + assert revpar == [newpath, path1.join("sampledir"), path1] + + def test_common(self, path1): + other = path1.join("sampledir") + x = other.common(path1) + assert x == path1 + + # def test_parents_nonexisting_file(self, path1): + # newpath = path1 / 'dirnoexist' / 'nonexisting file' + # par = list(newpath.parents()) + # assert par[:2] == [path1 / 'dirnoexist', path1] + + def test_basename_checks(self, path1): + newpath = path1.join("sampledir") + assert newpath.check(basename="sampledir") + assert newpath.check(notbasename="xyz") + assert newpath.basename == "sampledir" + + def test_basename(self, path1): + newpath = path1.join("sampledir") + assert newpath.check(basename="sampledir") + assert newpath.basename, "sampledir" + + def test_dirname(self, path1): + newpath = path1.join("sampledir") + assert newpath.dirname == str(path1) + + def test_dirpath(self, path1): + newpath = path1.join("sampledir") + assert newpath.dirpath() == path1 + + def test_dirpath_with_args(self, path1): + newpath = path1.join("sampledir") + assert newpath.dirpath("x") == path1.join("x") + + def test_newbasename(self, path1): + newpath = path1.join("samplefile") + newbase = newpath.new(basename="samplefile2") + assert newbase.basename == "samplefile2" + assert newbase.dirpath() == newpath.dirpath() + + def test_not_exists(self, path1): + assert not path1.join("does_not_exist").check() + assert path1.join("does_not_exist").check(exists=0) + + def test_exists(self, path1): + assert path1.join("samplefile").check() + assert path1.join("samplefile").check(exists=1) + assert path1.join("samplefile").exists() + assert path1.join("samplefile").isfile() + assert not path1.join("samplefile").isdir() + + def test_dir(self, path1): + # print repr(path1.join("sampledir")) + assert path1.join("sampledir").check(dir=1) + assert path1.join("samplefile").check(notdir=1) + assert not path1.join("samplefile").check(dir=1) + assert path1.join("samplefile").exists() + assert not path1.join("samplefile").isdir() + assert path1.join("samplefile").isfile() + + def test_fnmatch_file(self, path1): + assert path1.join("samplefile").check(fnmatch="s*e") + assert path1.join("samplefile").fnmatch("s*e") + assert not path1.join("samplefile").fnmatch("s*x") + assert not path1.join("samplefile").check(fnmatch="s*x") + + # def test_fnmatch_dir(self, path1): + + # pattern = path1.sep.join(['s*file']) + # sfile = path1.join("samplefile") + # assert sfile.check(fnmatch=pattern) + + def test_relto(self, path1): + p = path1.join("sampledir", "otherfile") + assert p.relto(path1) == p.sep.join(["sampledir", "otherfile"]) + assert p.check(relto=path1) + assert path1.check(notrelto=p) + assert not path1.check(relto=p) + + def test_bestrelpath(self, path1): + curdir = path1 + sep = curdir.sep + s = curdir.bestrelpath(curdir) + assert s == "." + s = curdir.bestrelpath(curdir.join("hello", "world")) + assert s == "hello" + sep + "world" + + s = curdir.bestrelpath(curdir.dirpath().join("sister")) + assert s == ".." + sep + "sister" + assert curdir.bestrelpath(curdir.dirpath()) == ".." + + assert curdir.bestrelpath("hello") == "hello" + + def test_relto_not_relative(self, path1): + l1 = path1.join("bcde") + l2 = path1.join("b") + assert not l1.relto(l2) + assert not l2.relto(l1) + + def test_listdir(self, path1): + p = path1.listdir() + assert path1.join("sampledir") in p + assert path1.join("samplefile") in p + with pytest.raises(error.ENOTDIR): + path1.join("samplefile").listdir() + + def test_listdir_fnmatchstring(self, path1): + p = path1.listdir("s*dir") + assert len(p) + assert p[0], path1.join("sampledir") + + def test_listdir_filter(self, path1): + p = path1.listdir(lambda x: x.check(dir=1)) + assert path1.join("sampledir") in p + assert not path1.join("samplefile") in p + + def test_listdir_sorted(self, path1): + p = path1.listdir(lambda x: x.check(basestarts="sample"), sort=True) + assert path1.join("sampledir") == p[0] + assert path1.join("samplefile") == p[1] + assert path1.join("samplepickle") == p[2] + + def test_visit_nofilter(self, path1): + lst = [] + for i in path1.visit(): + lst.append(i.relto(path1)) + assert "sampledir" in lst + assert path1.sep.join(["sampledir", "otherfile"]) in lst + + def test_visit_norecurse(self, path1): + lst = [] + for i in path1.visit(None, lambda x: x.basename != "sampledir"): + lst.append(i.relto(path1)) + assert "sampledir" in lst + assert not path1.sep.join(["sampledir", "otherfile"]) in lst + + @pytest.mark.parametrize( + "fil", + ["*dir", "*dir", pytest.mark.skip("sys.version_info <" " (3,6)")(b"*dir")], + ) + def test_visit_filterfunc_is_string(self, path1, fil): + lst = [] + for i in path1.visit(fil): + lst.append(i.relto(path1)) + assert len(lst), 2 + assert "sampledir" in lst + assert "otherdir" in lst + + def test_visit_ignore(self, path1): + p = path1.join("nonexisting") + assert list(p.visit(ignore=error.ENOENT)) == [] + + def test_visit_endswith(self, path1): + p = [] + for i in path1.visit(lambda x: x.check(endswith="file")): + p.append(i.relto(path1)) + assert path1.sep.join(["sampledir", "otherfile"]) in p + assert "samplefile" in p + + def test_cmp(self, path1): + path1 = path1.join("samplefile") + path2 = path1.join("samplefile2") + assert (path1 < path2) == ("samplefile" < "samplefile2") + assert not (path1 < path1) + + def test_simple_read(self, path1): + x = path1.join("samplefile").read("r") + assert x == "samplefile\n" + + def test_join_div_operator(self, path1): + newpath = path1 / "/sampledir" / "/test//" + newpath2 = path1.join("sampledir", "test") + assert newpath == newpath2 + + def test_ext(self, path1): + newpath = path1.join("sampledir.ext") + assert newpath.ext == ".ext" + newpath = path1.join("sampledir") + assert not newpath.ext + + def test_purebasename(self, path1): + newpath = path1.join("samplefile.py") + assert newpath.purebasename == "samplefile" + + def test_multiple_parts(self, path1): + newpath = path1.join("samplefile.py") + dirname, purebasename, basename, ext = newpath._getbyspec( + "dirname,purebasename,basename,ext" + ) + assert str(path1).endswith(dirname) # be careful with win32 'drive' + assert purebasename == "samplefile" + assert basename == "samplefile.py" + assert ext == ".py" + + def test_dotted_name_ext(self, path1): + newpath = path1.join("a.b.c") + ext = newpath.ext + assert ext == ".c" + assert newpath.ext == ".c" + + def test_newext(self, path1): + newpath = path1.join("samplefile.py") + newext = newpath.new(ext=".txt") + assert newext.basename == "samplefile.txt" + assert newext.purebasename == "samplefile" + + def test_readlines(self, path1): + fn = path1.join("samplefile") + contents = fn.readlines() + assert contents == ["samplefile\n"] + + def test_readlines_nocr(self, path1): + fn = path1.join("samplefile") + contents = fn.readlines(cr=0) + assert contents == ["samplefile", ""] + + def test_file(self, path1): + assert path1.join("samplefile").check(file=1) + + def test_not_file(self, path1): + assert not path1.join("sampledir").check(file=1) + assert path1.join("sampledir").check(file=0) + + def test_non_existent(self, path1): + assert path1.join("sampledir.nothere").check(dir=0) + assert path1.join("sampledir.nothere").check(file=0) + assert path1.join("sampledir.nothere").check(notfile=1) + assert path1.join("sampledir.nothere").check(notdir=1) + assert path1.join("sampledir.nothere").check(notexists=1) + assert not path1.join("sampledir.nothere").check(notfile=0) + + # pattern = path1.sep.join(['s*file']) + # sfile = path1.join("samplefile") + # assert sfile.check(fnmatch=pattern) + + def test_size(self, path1): + url = path1.join("samplefile") + assert url.size() > len("samplefile") + + def test_mtime(self, path1): + url = path1.join("samplefile") + assert url.mtime() > 0 + + def test_relto_wrong_type(self, path1): + with pytest.raises(TypeError): + path1.relto(42) + + def test_load(self, path1): + p = path1.join("samplepickle") + obj = p.load() + assert type(obj) is dict + assert obj.get("answer", None) == 42 + + def test_visit_filesonly(self, path1): + p = [] + for i in path1.visit(lambda x: x.check(file=1)): + p.append(i.relto(path1)) + assert "sampledir" not in p + assert path1.sep.join(["sampledir", "otherfile"]) in p + + def test_visit_nodotfiles(self, path1): + p = [] + for i in path1.visit(lambda x: x.check(dotfile=0)): + p.append(i.relto(path1)) + assert "sampledir" in p + assert path1.sep.join(["sampledir", "otherfile"]) in p + assert ".dotfile" not in p + + def test_visit_breadthfirst(self, path1): + lst = [] + for i in path1.visit(bf=True): + lst.append(i.relto(path1)) + for i, p in enumerate(lst): + if path1.sep in p: + for j in range(i, len(lst)): + assert path1.sep in lst[j] + break + else: + pytest.fail("huh") + + def test_visit_sort(self, path1): + lst = [] + for i in path1.visit(bf=True, sort=True): + lst.append(i.relto(path1)) + for i, p in enumerate(lst): + if path1.sep in p: + break + assert lst[:i] == sorted(lst[:i]) + assert lst[i:] == sorted(lst[i:]) + + def test_endswith(self, path1): + def chk(p): + return p.check(endswith="pickle") + + assert not chk(path1) + assert not chk(path1.join("samplefile")) + assert chk(path1.join("somepickle")) + + def test_copy_file(self, path1): + otherdir = path1.join("otherdir") + initpy = otherdir.join("__init__.py") + copied = otherdir.join("copied") + initpy.copy(copied) + try: + assert copied.check() + s1 = initpy.read() + s2 = copied.read() + assert s1 == s2 + finally: + if copied.check(): + copied.remove() + + def test_copy_dir(self, path1): + otherdir = path1.join("otherdir") + copied = path1.join("newdir") + try: + otherdir.copy(copied) + assert copied.check(dir=1) + assert copied.join("__init__.py").check(file=1) + s1 = otherdir.join("__init__.py").read() + s2 = copied.join("__init__.py").read() + assert s1 == s2 + finally: + if copied.check(dir=1): + copied.remove(rec=1) + + def test_remove_file(self, path1): + d = path1.ensure("todeleted") + assert d.check() + d.remove() + assert not d.check() + + def test_remove_dir_recursive_by_default(self, path1): + d = path1.ensure("to", "be", "deleted") + assert d.check() + p = path1.join("to") + p.remove() + assert not p.check() + + def test_ensure_dir(self, path1): + b = path1.ensure_dir("001", "002") + assert b.basename == "002" + assert b.isdir() + + def test_mkdir_and_remove(self, path1): + tmpdir = path1 + with pytest.raises(error.EEXIST): + tmpdir.mkdir("sampledir") + new = tmpdir.join("mktest1") + new.mkdir() + assert new.check(dir=1) + new.remove() + + new = tmpdir.mkdir("mktest") + assert new.check(dir=1) + new.remove() + assert tmpdir.join("mktest") == new + + def test_move_file(self, path1): + p = path1.join("samplefile") + newp = p.dirpath("moved_samplefile") + p.move(newp) + try: + assert newp.check(file=1) + assert not p.check() + finally: + dp = newp.dirpath() + if hasattr(dp, "revert"): + dp.revert() + else: + newp.move(p) + assert p.check() + + def test_move_dir(self, path1): + source = path1.join("sampledir") + dest = path1.join("moveddir") + source.move(dest) + assert dest.check(dir=1) + assert dest.join("otherfile").check(file=1) + assert not source.join("sampledir").check() + + def test_fspath_protocol_match_strpath(self, path1): + assert path1.__fspath__() == path1.strpath + + def test_fspath_func_match_strpath(self, path1): + from os import fspath + + 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) + + @pytest.mark.skip("sys.version_info < (3,6)") + def test_fspath_fsencode(self, path1): + from os import fsencode + + assert fsencode(path1) == fsencode(path1.strpath) + + +def setuptestfs(path): + if path.join("samplefile").check(): + return + # print "setting up test fs for", repr(path) + samplefile = path.ensure("samplefile") + samplefile.write("samplefile\n") + + execfile = path.ensure("execfile") + execfile.write("x=42") + + execfilepy = path.ensure("execfile.py") + execfilepy.write("x=42") + + d = {1: 2, "hello": "world", "answer": 42} + path.ensure("samplepickle").dump(d) + + sampledir = path.ensure("sampledir", dir=1) + sampledir.ensure("otherfile") + + otherdir = path.ensure("otherdir", dir=1) + otherdir.ensure("__init__.py") + + module_a = otherdir.ensure("a.py") + module_a.write("from .b import stuff as result\n") + module_b = otherdir.ensure("b.py") + module_b.write('stuff="got it"\n') + module_c = otherdir.ensure("c.py") + module_c.write( + """import py; +import otherdir.a +value = otherdir.a.result +""" + ) + module_d = otherdir.ensure("d.py") + module_d.write( + """import py; +from otherdir import a +value2 = a.result +""" + ) + + +win32only = pytest.mark.skipif( + "not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')" +) +skiponwin32 = pytest.mark.skipif( + "sys.platform == 'win32' or getattr(os, '_name', None) == 'nt'" +) + +ATIME_RESOLUTION = 0.01 + + +@pytest.fixture(scope="session") +def path1(tmpdir_factory): + path = tmpdir_factory.mktemp("path") + setuptestfs(path) + yield path + assert path.join("samplefile").check() + + +@pytest.fixture +def fake_fspath_obj(request): + class FakeFSPathClass: + def __init__(self, path): + self._path = path + + def __fspath__(self): + return self._path + + return FakeFSPathClass(os.path.join("this", "is", "a", "fake", "path")) + + +def batch_make_numbered_dirs(rootdir, repeats): + for i in range(repeats): + dir_ = local.make_numbered_dir(prefix="repro-", rootdir=rootdir) + file_ = dir_.join("foo") + file_.write("%s" % i) + actual = int(file_.read()) + assert actual == i, f"int(file_.read()) is {actual} instead of {i}" + dir_.join(".lock").remove(ignore_errors=True) + return True + + +class TestLocalPath(CommonFSTests): + def test_join_normpath(self, tmpdir): + assert tmpdir.join(".") == tmpdir + p = tmpdir.join("../%s" % tmpdir.basename) + assert p == tmpdir + p = tmpdir.join("..//%s/" % tmpdir.basename) + assert p == tmpdir + + @skiponwin32 + def test_dirpath_abs_no_abs(self, tmpdir): + p = tmpdir.join("foo") + assert p.dirpath("/bar") == tmpdir.join("bar") + assert tmpdir.dirpath("/bar", abs=True) == local("/bar") + + def test_gethash(self, tmpdir): + from hashlib import md5 + from hashlib import sha1 as sha + + fn = tmpdir.join("testhashfile") + data = b"hello" + fn.write(data, mode="wb") + assert fn.computehash("md5") == md5(data).hexdigest() + assert fn.computehash("sha1") == sha(data).hexdigest() + with pytest.raises(ValueError): + fn.computehash("asdasd") + + def test_remove_removes_readonly_file(self, tmpdir): + readonly_file = tmpdir.join("readonly").ensure() + readonly_file.chmod(0) + readonly_file.remove() + assert not readonly_file.check(exists=1) + + def test_remove_removes_readonly_dir(self, tmpdir): + readonly_dir = tmpdir.join("readonlydir").ensure(dir=1) + readonly_dir.chmod(int("500", 8)) + readonly_dir.remove() + assert not readonly_dir.check(exists=1) + + def test_remove_removes_dir_and_readonly_file(self, tmpdir): + readonly_dir = tmpdir.join("readonlydir").ensure(dir=1) + readonly_file = readonly_dir.join("readonlyfile").ensure() + readonly_file.chmod(0) + readonly_dir.remove() + assert not readonly_dir.check(exists=1) + + def test_remove_routes_ignore_errors(self, tmpdir, monkeypatch): + lst = [] + monkeypatch.setattr("shutil.rmtree", lambda *args, **kwargs: lst.append(kwargs)) + tmpdir.remove() + assert not lst[0]["ignore_errors"] + for val in (True, False): + lst[:] = [] + tmpdir.remove(ignore_errors=val) + assert lst[0]["ignore_errors"] == val + + def test_initialize_curdir(self): + assert str(local()) == os.getcwd() + + @skiponwin32 + def test_chdir_gone(self, path1): + p = path1.ensure("dir_to_be_removed", dir=1) + p.chdir() + p.remove() + pytest.raises(error.ENOENT, local) + assert path1.chdir() is None + assert os.getcwd() == str(path1) + + with pytest.raises(error.ENOENT): + with p.as_cwd(): + raise NotImplementedError + + @skiponwin32 + def test_chdir_gone_in_as_cwd(self, path1): + p = path1.ensure("dir_to_be_removed", dir=1) + p.chdir() + p.remove() + + with path1.as_cwd() as old: + assert old is None + + def test_as_cwd(self, path1): + dir = path1.ensure("subdir", dir=1) + old = local() + with dir.as_cwd() as x: + assert x == old + assert local() == dir + assert os.getcwd() == str(old) + + def test_as_cwd_exception(self, path1): + old = local() + dir = path1.ensure("subdir", dir=1) + with pytest.raises(ValueError): + with dir.as_cwd(): + raise ValueError() + assert old == local() + + def test_initialize_reldir(self, path1): + with path1.as_cwd(): + p = local("samplefile") + assert p.check() + + def test_tilde_expansion(self, monkeypatch, tmpdir): + monkeypatch.setenv("HOME", str(tmpdir)) + p = local("~", expanduser=True) + assert p == os.path.expanduser("~") + + @pytest.mark.skipif( + not sys.platform.startswith("win32"), reason="case insensitive only on windows" + ) + def test_eq_hash_are_case_insensitive_on_windows(self): + a = local("/some/path") + b = local("/some/PATH") + assert a == b + assert hash(a) == hash(b) + assert a in {b} + assert a in {b: "b"} + + def test_eq_with_strings(self, path1): + path1 = path1.join("sampledir") + path2 = str(path1) + assert path1 == path2 + assert path2 == path1 + path3 = path1.join("samplefile") + assert path3 != path2 + assert path2 != path3 + + def test_eq_with_none(self, path1): + assert path1 != None # noqa: E711 + + def test_eq_non_ascii_unicode(self, path1): + path2 = path1.join("temp") + path3 = path1.join("ação") + path4 = path1.join("ディレクトリ") + + assert path2 != path3 + assert path2 != path4 + assert path4 != path3 + + def test_gt_with_strings(self, path1): + path2 = path1.join("sampledir") + path3 = str(path1.join("ttt")) + assert path3 > path2 + assert path2 < path3 + assert path2 < "ttt" + assert "ttt" > path2 + path4 = path1.join("aaa") + lst = [path2, path4, path3] + assert sorted(lst) == [path4, path2, path3] + + def test_open_and_ensure(self, path1): + p = path1.join("sub1", "sub2", "file") + with p.open("w", ensure=1) as f: + f.write("hello") + assert p.read() == "hello" + + def test_write_and_ensure(self, path1): + p = path1.join("sub1", "sub2", "file") + p.write("hello", ensure=1) + assert p.read() == "hello" + + @pytest.mark.parametrize("bin", (False, True)) + def test_dump(self, tmpdir, bin): + path = tmpdir.join("dumpfile%s" % int(bin)) + try: + d = {"answer": 42} + path.dump(d, bin=bin) + f = path.open("rb+") + import pickle + + dnew = pickle.load(f) + assert d == dnew + finally: + f.close() + + def test_setmtime(self): + import tempfile + import time + + try: + fd, name = tempfile.mkstemp() + os.close(fd) + except AttributeError: + name = tempfile.mktemp() + open(name, "w").close() + try: + mtime = int(time.time()) - 100 + path = local(name) + assert path.mtime() != mtime + path.setmtime(mtime) + assert path.mtime() == mtime + path.setmtime() + assert path.mtime() != mtime + finally: + os.remove(name) + + def test_normpath(self, path1): + new1 = path1.join("/otherdir") + new2 = path1.join("otherdir") + assert str(new1) == str(new2) + + def test_mkdtemp_creation(self): + d = local.mkdtemp() + try: + assert d.check(dir=1) + finally: + d.remove(rec=1) + + def test_tmproot(self): + d = local.mkdtemp() + tmproot = local.get_temproot() + try: + assert d.check(dir=1) + assert d.dirpath() == tmproot + finally: + d.remove(rec=1) + + def test_chdir(self, tmpdir): + old = local() + try: + res = tmpdir.chdir() + assert str(res) == str(old) + assert os.getcwd() == str(tmpdir) + finally: + old.chdir() + + def test_ensure_filepath_withdir(self, tmpdir): + newfile = tmpdir.join("test1", "test") + newfile.ensure() + assert newfile.check(file=1) + newfile.write("42") + newfile.ensure() + s = newfile.read() + assert s == "42" + + def test_ensure_filepath_withoutdir(self, tmpdir): + newfile = tmpdir.join("test1file") + t = newfile.ensure() + assert t == newfile + assert newfile.check(file=1) + + def test_ensure_dirpath(self, tmpdir): + newfile = tmpdir.join("test1", "testfile") + t = newfile.ensure(dir=1) + assert t == newfile + assert newfile.check(dir=1) + + def test_ensure_non_ascii_unicode(self, tmpdir): + newfile = tmpdir.join("ação", "ディレクトリ") + t = newfile.ensure(dir=1) + assert t == newfile + assert newfile.check(dir=1) + + @pytest.mark.xfail(run=False, reason="unreliable est for long filenames") + def test_long_filenames(self, tmpdir): + if sys.platform == "win32": + pytest.skip("win32: work around needed for path length limit") + # see http://codespeak.net/pipermail/py-dev/2008q2/000922.html + + # testing paths > 260 chars (which is Windows' limitation, but + # depending on how the paths are used), but > 4096 (which is the + # Linux' limitation) - the behaviour of paths with names > 4096 chars + # is undetermined + newfilename = "/test" * 60 + l1 = tmpdir.join(newfilename) + l1.ensure(file=True) + l1.write("foo") + l2 = tmpdir.join(newfilename) + assert l2.read() == "foo" + + def test_visit_depth_first(self, tmpdir): + tmpdir.ensure("a", "1") + tmpdir.ensure("b", "2") + p3 = tmpdir.ensure("breadth") + lst = list(tmpdir.visit(lambda x: x.check(file=1))) + assert len(lst) == 3 + # check that breadth comes last + assert lst[2] == p3 + + def test_visit_rec_fnmatch(self, tmpdir): + p1 = tmpdir.ensure("a", "123") + tmpdir.ensure(".b", "345") + lst = list(tmpdir.visit("???", rec="[!.]*")) + assert len(lst) == 1 + # check that breadth comes last + assert lst[0] == p1 + + def test_fnmatch_file_abspath(self, tmpdir): + b = tmpdir.join("a", "b") + assert b.fnmatch(os.sep.join("ab")) + pattern = os.sep.join([str(tmpdir), "*", "b"]) + assert b.fnmatch(pattern) + + def test_sysfind(self): + name = sys.platform == "win32" and "cmd" or "test" + x = local.sysfind(name) + assert x.check(file=1) + assert local.sysfind("jaksdkasldqwe") is None + assert local.sysfind(name, paths=[]) is None + x2 = local.sysfind(name, paths=[x.dirpath()]) + assert x2 == x + + def test_fspath_protocol_other_class(self, fake_fspath_obj): + # py.path is always absolute + py_path = local(fake_fspath_obj) + str_path = fake_fspath_obj.__fspath__() + assert py_path.check(endswith=str_path) + assert py_path.join(fake_fspath_obj).strpath == os.path.join( + py_path.strpath, str_path + ) + + def test_make_numbered_dir_multiprocess_safe(self, tmpdir): + # https://github.com/pytest-dev/py/issues/30 + with multiprocessing.Pool() as pool: + results = [ + pool.apply_async(batch_make_numbered_dirs, [tmpdir, 100]) + for _ in range(20) + ] + for r in results: + assert r.get() + + +class TestExecutionOnWindows: + pytestmark = win32only + + def test_sysfind_bat_exe_before(self, tmpdir, monkeypatch): + monkeypatch.setenv("PATH", str(tmpdir), prepend=os.pathsep) + tmpdir.ensure("hello") + h = tmpdir.ensure("hello.bat") + x = local.sysfind("hello") + assert x == h + + +class TestExecution: + pytestmark = skiponwin32 + + def test_sysfind_no_permisson_ignored(self, monkeypatch, tmpdir): + noperm = tmpdir.ensure("noperm", dir=True) + monkeypatch.setenv("PATH", str(noperm), prepend=":") + noperm.chmod(0) + try: + assert local.sysfind("jaksdkasldqwe") is None + finally: + noperm.chmod(0o644) + + def test_sysfind_absolute(self): + x = local.sysfind("test") + assert x.check(file=1) + y = local.sysfind(str(x)) + assert y.check(file=1) + assert y == x + + def test_sysfind_multiple(self, tmpdir, monkeypatch): + monkeypatch.setenv( + "PATH", "{}:{}".format(tmpdir.ensure("a"), tmpdir.join("b")), prepend=":" + ) + tmpdir.ensure("b", "a") + x = local.sysfind("a", checker=lambda x: x.dirpath().basename == "b") + assert x.basename == "a" + assert x.dirpath().basename == "b" + assert local.sysfind("a", checker=lambda x: None) is None + + def test_sysexec(self): + x = local.sysfind("ls") + out = x.sysexec("-a") + for x in local().listdir(): + assert out.find(x.basename) != -1 + + def test_sysexec_failing(self): + x = local.sysfind("false") + with pytest.raises(RuntimeError): + x.sysexec("aksjdkasjd") + + def test_make_numbered_dir(self, tmpdir): + tmpdir.ensure("base.not_an_int", dir=1) + for i in range(10): + numdir = local.make_numbered_dir( + prefix="base.", rootdir=tmpdir, keep=2, lock_timeout=0 + ) + assert numdir.check() + assert numdir.basename == "base.%d" % i + if i >= 1: + assert numdir.new(ext=str(i - 1)).check() + if i >= 2: + assert numdir.new(ext=str(i - 2)).check() + if i >= 3: + assert not numdir.new(ext=str(i - 3)).check() + + def test_make_numbered_dir_case(self, tmpdir): + """make_numbered_dir does not make assumptions on the underlying + filesystem based on the platform and will assume it _could_ be case + insensitive. + + See issues: + - https://github.com/pytest-dev/pytest/issues/708 + - https://github.com/pytest-dev/pytest/issues/3451 + """ + d1 = local.make_numbered_dir( + prefix="CAse.", + rootdir=tmpdir, + keep=2, + lock_timeout=0, + ) + d2 = local.make_numbered_dir( + prefix="caSE.", + rootdir=tmpdir, + keep=2, + lock_timeout=0, + ) + assert str(d1).lower() != str(d2).lower() + assert str(d2).endswith(".1") + + def test_make_numbered_dir_NotImplemented_Error(self, tmpdir, monkeypatch): + def notimpl(x, y): + raise NotImplementedError(42) + + monkeypatch.setattr(os, "symlink", notimpl) + x = tmpdir.make_numbered_dir(rootdir=tmpdir, lock_timeout=0) + assert x.relto(tmpdir) + assert x.check() + + def test_locked_make_numbered_dir(self, tmpdir): + for i in range(10): + numdir = local.make_numbered_dir(prefix="base2.", rootdir=tmpdir, keep=2) + assert numdir.check() + assert numdir.basename == "base2.%d" % i + for j in range(i): + assert numdir.new(ext=str(j)).check() + + def test_error_preservation(self, path1): + pytest.raises(EnvironmentError, path1.join("qwoeqiwe").mtime) + pytest.raises(EnvironmentError, path1.join("qwoeqiwe").read) + + # def test_parentdirmatch(self): + # local.parentdirmatch('std', startmodule=__name__) + # + + +class TestImport: + def test_pyimport(self, path1): + obj = path1.join("execfile.py").pyimport() + assert obj.x == 42 + assert obj.__name__ == "execfile" + + def test_pyimport_renamed_dir_creates_mismatch(self, tmpdir, monkeypatch): + p = tmpdir.ensure("a", "test_x123.py") + p.pyimport() + tmpdir.join("a").move(tmpdir.join("b")) + with pytest.raises(tmpdir.ImportMismatchError): + tmpdir.join("b", "test_x123.py").pyimport() + + # Errors can be ignored. + monkeypatch.setenv("PY_IGNORE_IMPORTMISMATCH", "1") + tmpdir.join("b", "test_x123.py").pyimport() + + # PY_IGNORE_IMPORTMISMATCH=0 does not ignore error. + monkeypatch.setenv("PY_IGNORE_IMPORTMISMATCH", "0") + with pytest.raises(tmpdir.ImportMismatchError): + tmpdir.join("b", "test_x123.py").pyimport() + + def test_pyimport_messy_name(self, tmpdir): + # http://bitbucket.org/hpk42/py-trunk/issue/129 + path = tmpdir.ensure("foo__init__.py") + path.pyimport() + + def test_pyimport_dir(self, tmpdir): + p = tmpdir.join("hello_123") + p_init = p.ensure("__init__.py") + m = p.pyimport() + assert m.__name__ == "hello_123" + m = p_init.pyimport() + assert m.__name__ == "hello_123" + + def test_pyimport_execfile_different_name(self, path1): + obj = path1.join("execfile.py").pyimport(modname="0x.y.z") + assert obj.x == 42 + assert obj.__name__ == "0x.y.z" + + def test_pyimport_a(self, path1): + otherdir = path1.join("otherdir") + mod = otherdir.join("a.py").pyimport() + assert mod.result == "got it" + assert mod.__name__ == "otherdir.a" + + def test_pyimport_b(self, path1): + otherdir = path1.join("otherdir") + mod = otherdir.join("b.py").pyimport() + assert mod.stuff == "got it" + assert mod.__name__ == "otherdir.b" + + def test_pyimport_c(self, path1): + otherdir = path1.join("otherdir") + mod = otherdir.join("c.py").pyimport() + assert mod.value == "got it" + + def test_pyimport_d(self, path1): + otherdir = path1.join("otherdir") + mod = otherdir.join("d.py").pyimport() + assert mod.value2 == "got it" + + def test_pyimport_and_import(self, tmpdir): + tmpdir.ensure("xxxpackage", "__init__.py") + mod1path = tmpdir.ensure("xxxpackage", "module1.py") + mod1 = mod1path.pyimport() + assert mod1.__name__ == "xxxpackage.module1" + from xxxpackage import module1 + + assert module1 is mod1 + + def test_pyimport_check_filepath_consistency(self, monkeypatch, tmpdir): + name = "pointsback123" + ModuleType = type(os) + p = tmpdir.ensure(name + ".py") + for ending in (".pyc", "$py.class", ".pyo"): + mod = ModuleType(name) + pseudopath = tmpdir.ensure(name + ending) + mod.__file__ = str(pseudopath) + monkeypatch.setitem(sys.modules, name, mod) + newmod = p.pyimport() + assert mod == newmod + monkeypatch.undo() + mod = ModuleType(name) + pseudopath = tmpdir.ensure(name + "123.py") + mod.__file__ = str(pseudopath) + monkeypatch.setitem(sys.modules, name, mod) + excinfo = pytest.raises(pseudopath.ImportMismatchError, p.pyimport) + modname, modfile, orig = excinfo.value.args + assert modname == name + assert modfile == pseudopath + assert orig == p + assert issubclass(pseudopath.ImportMismatchError, ImportError) + + def test_issue131_pyimport_on__init__(self, tmpdir): + # __init__.py files may be namespace packages, and thus the + # __file__ of an imported module may not be ourselves + # see issue + p1 = tmpdir.ensure("proja", "__init__.py") + p2 = tmpdir.ensure("sub", "proja", "__init__.py") + m1 = p1.pyimport() + m2 = p2.pyimport() + assert m1 == m2 + + def test_ensuresyspath_append(self, tmpdir): + root1 = tmpdir.mkdir("root1") + file1 = root1.ensure("x123.py") + assert str(root1) not in sys.path + file1.pyimport(ensuresyspath="append") + assert str(root1) == sys.path[-1] + assert str(root1) not in sys.path[:-1] + + +class TestImportlibImport: + OPTS = {"ensuresyspath": "importlib"} + + def test_pyimport(self, path1): + obj = path1.join("execfile.py").pyimport(**self.OPTS) + assert obj.x == 42 + assert obj.__name__ == "execfile" + + def test_pyimport_dir_fails(self, tmpdir): + p = tmpdir.join("hello_123") + p.ensure("__init__.py") + with pytest.raises(ImportError): + p.pyimport(**self.OPTS) + + def test_pyimport_execfile_different_name(self, path1): + obj = path1.join("execfile.py").pyimport(modname="0x.y.z", **self.OPTS) + assert obj.x == 42 + assert obj.__name__ == "0x.y.z" + + def test_pyimport_relative_import_fails(self, path1): + otherdir = path1.join("otherdir") + with pytest.raises(ImportError): + otherdir.join("a.py").pyimport(**self.OPTS) + + def test_pyimport_doesnt_use_sys_modules(self, tmpdir): + p = tmpdir.ensure("file738jsk.py") + mod = p.pyimport(**self.OPTS) + assert mod.__name__ == "file738jsk" + assert "file738jsk" not in sys.modules + + +def test_pypkgdir(tmpdir): + pkg = tmpdir.ensure("pkg1", dir=1) + pkg.ensure("__init__.py") + pkg.ensure("subdir/__init__.py") + assert pkg.pypkgpath() == pkg + assert pkg.join("subdir", "__init__.py").pypkgpath() == pkg + + +def test_pypkgdir_unimportable(tmpdir): + pkg = tmpdir.ensure("pkg1-1", dir=1) # unimportable + pkg.ensure("__init__.py") + subdir = pkg.ensure("subdir/__init__.py").dirpath() + assert subdir.pypkgpath() == subdir + assert subdir.ensure("xyz.py").pypkgpath() == subdir + assert not pkg.pypkgpath() + + +def test_isimportable(): + from py.path import isimportable + + assert not isimportable("") + assert isimportable("x") + assert isimportable("x1") + assert isimportable("x_1") + assert isimportable("_") + assert isimportable("_1") + assert not isimportable("x-1") + assert not isimportable("x:1") + + +def test_homedir_from_HOME(monkeypatch): + path = os.getcwd() + monkeypatch.setenv("HOME", path) + assert local._gethomedir() == local(path) + + +def test_homedir_not_exists(monkeypatch): + monkeypatch.delenv("HOME", raising=False) + monkeypatch.delenv("HOMEDRIVE", raising=False) + homedir = local._gethomedir() + assert homedir is None + + +def test_samefile(tmpdir): + assert tmpdir.samefile(tmpdir) + p = tmpdir.ensure("hello") + assert p.samefile(p) + with p.dirpath().as_cwd(): + assert p.samefile(p.basename) + if sys.platform == "win32": + p1 = p.__class__(str(p).lower()) + p2 = p.__class__(str(p).upper()) + assert p1.samefile(p2) + + +@pytest.mark.skipif(not hasattr(os, "symlink"), reason="os.symlink not available") +def test_samefile_symlink(tmpdir): + p1 = tmpdir.ensure("foo.txt") + p2 = tmpdir.join("linked.txt") + try: + os.symlink(str(p1), str(p2)) + except (OSError, NotImplementedError) as e: + # on Windows this might fail if the user doesn't have special symlink permissions + # pypy3 on Windows doesn't implement os.symlink and raises NotImplementedError + pytest.skip(str(e.args[0])) + + assert p1.samefile(p2) + + +def test_listdir_single_arg(tmpdir): + tmpdir.ensure("hello") + assert tmpdir.listdir("hello")[0].basename == "hello" + + +def test_mkdtemp_rootdir(tmpdir): + dtmp = local.mkdtemp(rootdir=tmpdir) + assert tmpdir.listdir() == [dtmp] + + +class TestWINLocalPath: + pytestmark = win32only + + def test_owner_group_not_implemented(self, path1): + with pytest.raises(NotImplementedError): + path1.stat().owner + with pytest.raises(NotImplementedError): + path1.stat().group + + def test_chmod_simple_int(self, path1): + mode = path1.stat().mode + # Ensure that we actually change the mode to something different. + path1.chmod(mode == 0 and 1 or 0) + try: + print(path1.stat().mode) + print(mode) + assert path1.stat().mode != mode + finally: + path1.chmod(mode) + assert path1.stat().mode == mode + + def test_path_comparison_lowercase_mixed(self, path1): + t1 = path1.join("a_path") + t2 = path1.join("A_path") + assert t1 == t1 + assert t1 == t2 + + def test_relto_with_mixed_case(self, path1): + t1 = path1.join("a_path", "fiLe") + t2 = path1.join("A_path") + assert t1.relto(t2) == "fiLe" + + def test_allow_unix_style_paths(self, path1): + t1 = path1.join("a_path") + assert t1 == str(path1) + "\\a_path" + t1 = path1.join("a_path/") + assert t1 == str(path1) + "\\a_path" + t1 = path1.join("dir/a_path") + assert t1 == str(path1) + "\\dir\\a_path" + + def test_sysfind_in_currentdir(self, path1): + cmd = local.sysfind("cmd") + root = cmd.new(dirname="", basename="") # c:\ in most installations + with root.as_cwd(): + x = local.sysfind(cmd.relto(root)) + assert x.check(file=1) + + def test_fnmatch_file_abspath_posix_pattern_on_win32(self, tmpdir): + # path-matching patterns might contain a posix path separator '/' + # Test that we can match that pattern on windows. + import posixpath + + b = tmpdir.join("a", "b") + assert b.fnmatch(posixpath.sep.join("ab")) + pattern = posixpath.sep.join([str(tmpdir), "*", "b"]) + assert b.fnmatch(pattern) + + +class TestPOSIXLocalPath: + pytestmark = skiponwin32 + + def test_hardlink(self, tmpdir): + linkpath = tmpdir.join("test") + filepath = tmpdir.join("file") + filepath.write("Hello") + nlink = filepath.stat().nlink + linkpath.mklinkto(filepath) + assert filepath.stat().nlink == nlink + 1 + + def test_symlink_are_identical(self, tmpdir): + filepath = tmpdir.join("file") + filepath.write("Hello") + linkpath = tmpdir.join("test") + linkpath.mksymlinkto(filepath) + assert linkpath.readlink() == str(filepath) + + def test_symlink_isfile(self, tmpdir): + linkpath = tmpdir.join("test") + filepath = tmpdir.join("file") + filepath.write("") + linkpath.mksymlinkto(filepath) + assert linkpath.check(file=1) + assert not linkpath.check(link=0, file=1) + assert linkpath.islink() + + def test_symlink_relative(self, tmpdir): + linkpath = tmpdir.join("test") + filepath = tmpdir.join("file") + filepath.write("Hello") + linkpath.mksymlinkto(filepath, absolute=False) + assert linkpath.readlink() == "file" + assert filepath.read() == linkpath.read() + + def test_symlink_not_existing(self, tmpdir): + linkpath = tmpdir.join("testnotexisting") + assert not linkpath.check(link=1) + assert linkpath.check(link=0) + + def test_relto_with_root(self, path1, tmpdir): + y = path1.join("x").relto(local("/")) + assert y[0] == str(path1)[1] + + def test_visit_recursive_symlink(self, tmpdir): + linkpath = tmpdir.join("test") + linkpath.mksymlinkto(tmpdir) + visitor = tmpdir.visit(None, lambda x: x.check(link=0)) + assert list(visitor) == [linkpath] + + def test_symlink_isdir(self, tmpdir): + linkpath = tmpdir.join("test") + linkpath.mksymlinkto(tmpdir) + assert linkpath.check(dir=1) + assert not linkpath.check(link=0, dir=1) + + def test_symlink_remove(self, tmpdir): + linkpath = tmpdir.join("test") + linkpath.mksymlinkto(linkpath) # point to itself + assert linkpath.check(link=1) + linkpath.remove() + assert not linkpath.check() + + def test_realpath_file(self, tmpdir): + linkpath = tmpdir.join("test") + filepath = tmpdir.join("file") + filepath.write("") + linkpath.mksymlinkto(filepath) + realpath = linkpath.realpath() + assert realpath.basename == "file" + + def test_owner(self, path1, tmpdir): + from pwd import getpwuid + from grp import getgrgid + + stat = path1.stat() + assert stat.path == path1 + + uid = stat.uid + gid = stat.gid + owner = getpwuid(uid)[0] + group = getgrgid(gid)[0] + + assert uid == stat.uid + assert owner == stat.owner + assert gid == stat.gid + assert group == stat.group + + def test_stat_helpers(self, tmpdir, monkeypatch): + path1 = tmpdir.ensure("file") + stat1 = path1.stat() + stat2 = tmpdir.stat() + assert stat1.isfile() + assert stat2.isdir() + assert not stat1.islink() + assert not stat2.islink() + + def test_stat_non_raising(self, tmpdir): + path1 = tmpdir.join("file") + pytest.raises(error.ENOENT, lambda: path1.stat()) + res = path1.stat(raising=False) + assert res is None + + def test_atime(self, tmpdir): + import time + + path = tmpdir.ensure("samplefile") + now = time.time() + atime1 = path.atime() + # we could wait here but timer resolution is very + # system dependent + path.read() + time.sleep(ATIME_RESOLUTION) + atime2 = path.atime() + time.sleep(ATIME_RESOLUTION) + duration = time.time() - now + assert (atime2 - atime1) <= duration + + def test_commondir(self, path1): + # XXX This is here in local until we find a way to implement this + # using the subversion command line api. + p1 = path1.join("something") + p2 = path1.join("otherthing") + assert p1.common(p2) == path1 + assert p2.common(p1) == path1 + + def test_commondir_nocommon(self, path1): + # XXX This is here in local until we find a way to implement this + # using the subversion command line api. + p1 = path1.join("something") + p2 = local(path1.sep + "blabla") + assert p1.common(p2) == "/" + + def test_join_to_root(self, path1): + root = path1.parts()[0] + assert len(str(root)) == 1 + assert str(root.join("a")) == "/a" + + def test_join_root_to_root_with_no_abs(self, path1): + nroot = path1.join("/") + assert str(path1) == str(nroot) + assert path1 == nroot + + def test_chmod_simple_int(self, path1): + mode = path1.stat().mode + path1.chmod(int(mode / 2)) + try: + assert path1.stat().mode != mode + finally: + path1.chmod(mode) + assert path1.stat().mode == mode + + def test_chmod_rec_int(self, path1): + # XXX fragile test + def recfilter(x): + return x.check(dotfile=0, link=0) + + oldmodes = {} + for x in path1.visit(rec=recfilter): + oldmodes[x] = x.stat().mode + path1.chmod(int("772", 8), rec=recfilter) + try: + for x in path1.visit(rec=recfilter): + assert x.stat().mode & int("777", 8) == int("772", 8) + finally: + for x, y in oldmodes.items(): + x.chmod(y) + + def test_copy_archiving(self, tmpdir): + unicode_fn = "something-\342\200\223.txt" + f = tmpdir.ensure("a", unicode_fn) + a = f.dirpath() + oldmode = f.stat().mode + newmode = oldmode ^ 1 + f.chmod(newmode) + b = tmpdir.join("b") + a.copy(b, mode=True) + assert b.join(f.basename).stat().mode == newmode + + def test_copy_stat_file(self, tmpdir): + src = tmpdir.ensure("src") + dst = tmpdir.join("dst") + # a small delay before the copy + time.sleep(ATIME_RESOLUTION) + src.copy(dst, stat=True) + oldstat = src.stat() + newstat = dst.stat() + assert oldstat.mode == newstat.mode + assert (dst.atime() - src.atime()) < ATIME_RESOLUTION + assert (dst.mtime() - src.mtime()) < ATIME_RESOLUTION + + def test_copy_stat_dir(self, tmpdir): + test_files = ["a", "b", "c"] + src = tmpdir.join("src") + for f in test_files: + src.join(f).write(f, ensure=True) + dst = tmpdir.join("dst") + # a small delay before the copy + time.sleep(ATIME_RESOLUTION) + src.copy(dst, stat=True) + for f in test_files: + oldstat = src.join(f).stat() + newstat = dst.join(f).stat() + assert (newstat.atime - oldstat.atime) < ATIME_RESOLUTION + assert (newstat.mtime - oldstat.mtime) < ATIME_RESOLUTION + assert oldstat.mode == newstat.mode + + def test_chown_identity(self, path1): + owner = path1.stat().owner + group = path1.stat().group + path1.chown(owner, group) + + def test_chown_dangling_link(self, path1): + owner = path1.stat().owner + group = path1.stat().group + x = path1.join("hello") + x.mksymlinkto("qlwkejqwlek") + try: + path1.chown(owner, group, rec=1) + finally: + x.remove(rec=0) + + def test_chown_identity_rec_mayfail(self, path1): + owner = path1.stat().owner + group = path1.stat().group + path1.chown(owner, group) + + +class TestUnicodePy2Py3: + def test_join_ensure(self, tmpdir, monkeypatch): + if sys.version_info >= (3, 0) and "LANG" not in os.environ: + pytest.skip("cannot run test without locale") + x = local(tmpdir.strpath) + part = "hällo" + y = x.ensure(part) + assert x.join(part) == y + + def test_listdir(self, tmpdir): + if sys.version_info >= (3, 0) and "LANG" not in os.environ: + pytest.skip("cannot run test without locale") + x = local(tmpdir.strpath) + part = "hällo" + y = x.ensure(part) + assert x.listdir(part)[0] == y + + @pytest.mark.xfail(reason="changing read/write might break existing usages") + def test_read_write(self, tmpdir): + x = tmpdir.join("hello") + part = "hällo" + x.write(part) + assert x.read() == part + x.write(part.encode(sys.getdefaultencoding())) + assert x.read() == part.encode(sys.getdefaultencoding()) + + +class TestBinaryAndTextMethods: + def test_read_binwrite(self, tmpdir): + x = tmpdir.join("hello") + part = "hällo" + part_utf8 = part.encode("utf8") + x.write_binary(part_utf8) + assert x.read_binary() == part_utf8 + s = x.read_text(encoding="utf8") + assert s == part + assert isinstance(s, str) + + def test_read_textwrite(self, tmpdir): + x = tmpdir.join("hello") + part = "hällo" + part_utf8 = part.encode("utf8") + x.write_text(part, encoding="utf8") + assert x.read_binary() == part_utf8 + assert x.read_text(encoding="utf8") == part + + def test_default_encoding(self, tmpdir): + x = tmpdir.join("hello") + # Can't use UTF8 as the default encoding (ASCII) doesn't support it + part = "hello" + x.write_text(part, "ascii") + s = x.read_text("ascii") + assert s == part + assert type(s) == type(part) From dc0cb0d149c03767b762c8e80ed2a1337aaf6161 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 22:07:53 -0400 Subject: [PATCH 247/255] fix test pollution of sys.modules --- testing/_py/test_local.py | 7 +++++++ testing/test_pathlib.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index 6e2c44bc2e0..ceacd70ae2e 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -2,6 +2,7 @@ import os import sys import time +from unittest import mock import pytest from py import error @@ -978,6 +979,12 @@ def test_error_preservation(self, path1): class TestImport: + @pytest.fixture(autouse=True) + def preserve_sys(self): + with mock.patch.dict(sys.modules): + with mock.patch.object(sys, "path", list(sys.path)): + yield + def test_pyimport(self, path1): obj = path1.join("execfile.py").pyimport() assert obj.x == 42 diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py index c901dc6f435..577c7749fd9 100644 --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -91,6 +91,12 @@ def path1(self, tmp_path_factory: TempPathFactory) -> Generator[Path, None, None yield path assert path.joinpath("samplefile").exists() + @pytest.fixture(autouse=True) + def preserve_sys(self): + with unittest.mock.patch.dict(sys.modules): + with unittest.mock.patch.object(sys, "path", list(sys.path)): + yield + def setuptestfs(self, path: Path) -> None: # print "setting up test fs for", repr(path) samplefile = path / "samplefile" From 02a9371259f651f17f38fc9f406eb43a0fcf2e2d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 22:28:51 -0400 Subject: [PATCH 248/255] adjust tests if py library is installed --- testing/_py/test_local.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index ceacd70ae2e..31c10b16021 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -909,8 +909,12 @@ def test_sysexec(self): assert out.find(x.basename) != -1 def test_sysexec_failing(self): + try: + from py._process.cmdexec import ExecutionFailed # py library + except ImportError: + ExecutionFailed = RuntimeError # py vendored x = local.sysfind("false") - with pytest.raises(RuntimeError): + with pytest.raises(ExecutionFailed): x.sysexec("aksjdkasjd") def test_make_numbered_dir(self, tmpdir): @@ -1146,7 +1150,10 @@ def test_pypkgdir_unimportable(tmpdir): def test_isimportable(): - from py.path import isimportable + try: + from py.path import isimportable # py vendored version + except ImportError: + from py._path.local import isimportable # py library assert not isimportable("") assert isimportable("x") From 508be0b2bfdafeff31ed33e3d3403aff1252a87f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 20 Oct 2022 17:15:57 -0400 Subject: [PATCH 249/255] add -pylib tox environment --- .github/workflows/test.yml | 4 ++-- tox.ini | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f3e7e535eb..b33c88b9f67 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,7 +66,7 @@ jobs: - name: "windows-py37-pluggy" python: "3.7" os: windows-latest - tox_env: "py37-pluggymain-xdist" + tox_env: "py37-pluggymain-pylib-xdist" - name: "windows-py38" python: "3.8" os: windows-latest @@ -93,7 +93,7 @@ jobs: - name: "ubuntu-py37-pluggy" python: "3.7" os: ubuntu-latest - tox_env: "py37-pluggymain-xdist" + tox_env: "py37-pluggymain-pylib-xdist" - name: "ubuntu-py37-freeze" python: "3.7" os: ubuntu-latest diff --git a/tox.ini b/tox.ini index f1ab4b815a5..f04242c5c43 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ envlist = py310 py311 pypy3 - py37-{pexpect,xdist,unittestextras,numpy,pluggymain} + py37-{pexpect,xdist,unittestextras,numpy,pluggymain,pylib} doctesting plugins py37-freeze @@ -54,6 +54,7 @@ deps = numpy: numpy>=1.19.4 pexpect: pexpect>=4.8.0 pluggymain: pluggy @ git+https://github.com/pytest-dev/pluggy.git + pylib: py>=1.8.2 unittestextras: twisted unittestextras: asynctest xdist: pytest-xdist>=2.1.0 From 6b905ee6dc7301f95714006037f869a15d518d58 Mon Sep 17 00:00:00 2001 From: Nate Meyvis Date: Fri, 21 Oct 2022 11:17:01 -0400 Subject: [PATCH 250/255] Add note on tags to CONTRIBUTING.rst Tags from the main repository are required for testing to work properly, but the current documentation does not reflect this, and at least one new contributor has been tripped up by this. Update the documentation with a short explanation and directions. --- CONTRIBUTING.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 22c3ecefb6c..222e5bd2ee3 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -243,6 +243,11 @@ Here is a simple overview, with pytest-specific bits: Given we have "major.minor.micro" version numbers, bug fixes will usually be released in micro releases whereas features will be released in minor releases and incompatible changes in major releases. + + You will need the tags to test locally, so be sure you have the tags from the main repository. If you suspect you don't, set the main repository as upstream and fetch the tags:: + + $ git remote add upstream https://github.com/pytest-dev/pytest + $ git fetch upstream --tags If you need some help with Git, follow this quick start guide: https://git.wiki.kernel.org/index.php/QuickStart From 1027dc8c091369ff5e67d97d2a9c09cbf7bc921e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 15:18:44 +0000 Subject: [PATCH 251/255] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CONTRIBUTING.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 222e5bd2ee3..e7545ea8c60 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -243,9 +243,9 @@ Here is a simple overview, with pytest-specific bits: Given we have "major.minor.micro" version numbers, bug fixes will usually be released in micro releases whereas features will be released in minor releases and incompatible changes in major releases. - + You will need the tags to test locally, so be sure you have the tags from the main repository. If you suspect you don't, set the main repository as upstream and fetch the tags:: - + $ git remote add upstream https://github.com/pytest-dev/pytest $ git fetch upstream --tags From d543a45a6802defbafcff259bdc235af76f7af3a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 21 Oct 2022 12:46:15 -0400 Subject: [PATCH 252/255] add deprecation changelog for py library vendoring --- changelog/10396.deprecation.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/10396.deprecation.rst diff --git a/changelog/10396.deprecation.rst b/changelog/10396.deprecation.rst new file mode 100644 index 00000000000..84461e82ede --- /dev/null +++ b/changelog/10396.deprecation.rst @@ -0,0 +1 @@ +pytest no longer depends on the ``py`` library. ``pytest`` provides a vendored copy of ``py.error`` and ``py.path`` modules but will use the ``py`` library if it is installed. If you need other ``py.*`` modules, continue to install the deprecated ``py`` library separately, otherwise it can usually be removed as a dependency. From c5c562b645a62a919856d255fd83015cce75014c Mon Sep 17 00:00:00 2001 From: Nate Meyvis Date: Fri, 21 Oct 2022 13:06:44 -0400 Subject: [PATCH 253/255] Fix typos in CONTRIBUTING.rst Fix small grammatical issues in CONTRIBUTING.rst to improve readability. --- CONTRIBUTING.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e7545ea8c60..791f988306f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -385,7 +385,7 @@ them. Backporting bug fixes for the next patch release ------------------------------------------------ -Pytest makes feature release every few weeks or months. In between, patch releases +Pytest makes a feature release every few weeks or months. In between, patch releases are made to the previous feature release, containing bug fixes only. The bug fixes usually fix regressions, but may be any change that should reach users before the next feature release. @@ -394,7 +394,7 @@ Suppose for example that the latest release was 1.2.3, and you want to include a bug fix in 1.2.4 (check https://github.com/pytest-dev/pytest/releases for the actual latest release). The procedure for this is: -#. First, make sure the bug is fixed the ``main`` branch, with a regular pull +#. First, make sure the bug is fixed in the ``main`` branch, with a regular pull request, as described above. An exception to this is if the bug fix is not applicable to ``main`` anymore. From d35209826190c831a338fb2a958215c7e4b5b269 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 21 Oct 2022 13:11:43 -0400 Subject: [PATCH 254/255] allow jobs to pass if codecov.io fails --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f3e7e535eb..1ca7c924e8a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -184,6 +184,7 @@ jobs: - name: Upload coverage to Codecov if: "matrix.use_coverage" uses: codecov/codecov-action@v3 + continue-on-error: true with: fail_ci_if_error: true files: ./coverage.xml From 3af3f569d5394bb1a18426b0d57a04a094800974 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 23 Oct 2022 20:28:15 +0000 Subject: [PATCH 255/255] Prepare release version 7.2.0 --- changelog/10012.deprecation.rst | 1 - changelog/10150.bugfix.rst | 1 - changelog/10196.trivial.rst | 1 - changelog/10218.improvement.rst | 5 - changelog/10313.trivial.rst | 3 - changelog/10344.doc.rst | 1 - changelog/10381.improvement.rst | 1 - changelog/10382.bugfix.rst | 1 - changelog/10396.deprecation.rst | 1 - changelog/3426.improvement.rst | 1 - changelog/4562.deprecation.rst | 4 - changelog/7337.improvement.rst | 1 - changelog/7792.bugfix.rst | 5 - changelog/8508.improvement.rst | 2 - changelog/8646.improvement.rst | 2 - changelog/9159.bugfix.rst | 1 - changelog/9248.doc.rst | 1 - changelog/9291.doc.rst | 1 - changelog/9741.improvement.rst | 3 - changelog/9742.improvement.rst | 1 - changelog/9823.improvement.rst | 1 - changelog/9873.improvement.rst | 1 - changelog/9877.bugfix.rst | 1 - changelog/9883.improvement.rst | 1 - changelog/9886.deprecation.rst | 10 -- changelog/9897.feature.rst | 1 - changelog/9906.trivial.rst | 1 - changelog/9910.trivial.rst | 1 - changelog/9920.improvement.rst | 1 - changelog/9984.trivial.rst | 4 - changelog/9987.improvement.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.2.0.rst | 93 +++++++++++++++++++ doc/en/builtin.rst | 27 +++--- doc/en/changelog.rst | 148 ++++++++++++++++++++++++++++++ doc/en/example/markers.rst | 10 +- doc/en/example/simple.rst | 3 +- doc/en/getting-started.rst | 2 +- doc/en/how-to/cache.rst | 4 +- doc/en/how-to/output.rst | 3 +- doc/en/how-to/unittest.rst | 4 +- doc/en/reference/reference.rst | 69 +++++++------- 42 files changed, 302 insertions(+), 122 deletions(-) delete mode 100644 changelog/10012.deprecation.rst delete mode 100644 changelog/10150.bugfix.rst delete mode 100644 changelog/10196.trivial.rst delete mode 100644 changelog/10218.improvement.rst delete mode 100644 changelog/10313.trivial.rst delete mode 100644 changelog/10344.doc.rst delete mode 100644 changelog/10381.improvement.rst delete mode 100644 changelog/10382.bugfix.rst delete mode 100644 changelog/10396.deprecation.rst delete mode 100644 changelog/3426.improvement.rst delete mode 100644 changelog/4562.deprecation.rst delete mode 100644 changelog/7337.improvement.rst delete mode 100644 changelog/7792.bugfix.rst delete mode 100644 changelog/8508.improvement.rst delete mode 100644 changelog/8646.improvement.rst delete mode 100644 changelog/9159.bugfix.rst delete mode 100644 changelog/9248.doc.rst delete mode 100644 changelog/9291.doc.rst delete mode 100644 changelog/9741.improvement.rst delete mode 100644 changelog/9742.improvement.rst delete mode 100644 changelog/9823.improvement.rst delete mode 100644 changelog/9873.improvement.rst delete mode 100644 changelog/9877.bugfix.rst delete mode 100644 changelog/9883.improvement.rst delete mode 100644 changelog/9886.deprecation.rst delete mode 100644 changelog/9897.feature.rst delete mode 100644 changelog/9906.trivial.rst delete mode 100644 changelog/9910.trivial.rst delete mode 100644 changelog/9920.improvement.rst delete mode 100644 changelog/9984.trivial.rst delete mode 100644 changelog/9987.improvement.rst create mode 100644 doc/en/announce/release-7.2.0.rst diff --git a/changelog/10012.deprecation.rst b/changelog/10012.deprecation.rst deleted file mode 100644 index 66681263e32..00000000000 --- a/changelog/10012.deprecation.rst +++ /dev/null @@ -1 +0,0 @@ -Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. diff --git a/changelog/10150.bugfix.rst b/changelog/10150.bugfix.rst deleted file mode 100644 index 24c7ccd355a..00000000000 --- a/changelog/10150.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -:data:`sys.stdin` now contains all expected methods of a file-like object when capture is enabled. diff --git a/changelog/10196.trivial.rst b/changelog/10196.trivial.rst deleted file mode 100644 index edf458f84c5..00000000000 --- a/changelog/10196.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -:class:`~pytest.PytestReturnNotNoneWarning` is now a subclass of :class:`~pytest.PytestRemovedIn8Warning`: the plan is to make returning non-``None`` from tests an error in the future. diff --git a/changelog/10218.improvement.rst b/changelog/10218.improvement.rst deleted file mode 100644 index e00325e2567..00000000000 --- a/changelog/10218.improvement.rst +++ /dev/null @@ -1,5 +0,0 @@ -``@pytest.mark.parametrize()`` (and similar functions) now accepts any ``Sequence[str]`` for the argument names, -instead of just ``list[str]`` and ``tuple[str, ...]``. - -(Note that ``str``, which is itself a ``Sequence[str]``, is still treated as a -comma-delimited name list, as before). diff --git a/changelog/10313.trivial.rst b/changelog/10313.trivial.rst deleted file mode 100644 index 8203b580211..00000000000 --- a/changelog/10313.trivial.rst +++ /dev/null @@ -1,3 +0,0 @@ -Made ``_pytest.doctest.DoctestItem`` export ``pytest.DoctestItem`` for -type check and runtime purposes. Made `_pytest.doctest` use internal APIs -to avoid circular imports. diff --git a/changelog/10344.doc.rst b/changelog/10344.doc.rst deleted file mode 100644 index 1c7885edc20..00000000000 --- a/changelog/10344.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Update information on writing plugins to use ``pyproject.toml`` instead of ``setup.py``. diff --git a/changelog/10381.improvement.rst b/changelog/10381.improvement.rst deleted file mode 100644 index f979a83b132..00000000000 --- a/changelog/10381.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -The ``--no-showlocals`` flag has been added. This can be passed directly to tests to override ``--showlocals`` declared through ``addopts``. diff --git a/changelog/10382.bugfix.rst b/changelog/10382.bugfix.rst deleted file mode 100644 index 5876a9a43c2..00000000000 --- a/changelog/10382.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Do not break into pdb when ``raise unittest.SkipTest()`` appears top-level in a file. diff --git a/changelog/10396.deprecation.rst b/changelog/10396.deprecation.rst deleted file mode 100644 index 84461e82ede..00000000000 --- a/changelog/10396.deprecation.rst +++ /dev/null @@ -1 +0,0 @@ -pytest no longer depends on the ``py`` library. ``pytest`` provides a vendored copy of ``py.error`` and ``py.path`` modules but will use the ``py`` library if it is installed. If you need other ``py.*`` modules, continue to install the deprecated ``py`` library separately, otherwise it can usually be removed as a dependency. diff --git a/changelog/3426.improvement.rst b/changelog/3426.improvement.rst deleted file mode 100644 index e232d56aa6a..00000000000 --- a/changelog/3426.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Assertion failures with strings in NFC and NFD forms that normalize to the same string now have a dedicated error message detailing the issue, and their utf-8 representation is expresed instead. diff --git a/changelog/4562.deprecation.rst b/changelog/4562.deprecation.rst deleted file mode 100644 index d459801d4a6..00000000000 --- a/changelog/4562.deprecation.rst +++ /dev/null @@ -1,4 +0,0 @@ -Deprecate configuring hook specs/impls using attributes/marks. - -Instead use :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec`. -For more details, see the :ref:`docs `. diff --git a/changelog/7337.improvement.rst b/changelog/7337.improvement.rst deleted file mode 100644 index 74d98d9b6c9..00000000000 --- a/changelog/7337.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -A warning 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` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`. diff --git a/changelog/7792.bugfix.rst b/changelog/7792.bugfix.rst deleted file mode 100644 index 8f65637896d..00000000000 --- a/changelog/7792.bugfix.rst +++ /dev/null @@ -1,5 +0,0 @@ -Marks are now inherited according to the full MRO in test classes. Previously, if a test class inherited from two or more classes, only marks from the first super-class would apply. - -When inheriting marks from super-classes, marks from the sub-classes are now ordered before marks from the super-classes, in MRO order. Previously it was the reverse. - -When inheriting marks from super-classes, the `pytestmark` attribute of the sub-class now only contains the marks directly applied to it. Previously, it also contained marks from its super-classes. Please note that this attribute should not normally be accessed directly; use :func:`pytest.Node.iter_markers` instead. diff --git a/changelog/8508.improvement.rst b/changelog/8508.improvement.rst deleted file mode 100644 index 36fb945829c..00000000000 --- a/changelog/8508.improvement.rst +++ /dev/null @@ -1,2 +0,0 @@ -Introduce multiline display for warning matching via :py:func:`pytest.warns` and -enhance match comparison for :py:func:`_pytest._code.ExceptionInfo.match` as returned by :py:func:`pytest.raises`. diff --git a/changelog/8646.improvement.rst b/changelog/8646.improvement.rst deleted file mode 100644 index 9691c143429..00000000000 --- a/changelog/8646.improvement.rst +++ /dev/null @@ -1,2 +0,0 @@ -Improve :py:func:`pytest.raises`. Previously passing an empty tuple would give a confusing -error. We now raise immediately with a more helpful message. diff --git a/changelog/9159.bugfix.rst b/changelog/9159.bugfix.rst deleted file mode 100644 index 5e7f0a3014d..00000000000 --- a/changelog/9159.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Showing inner exceptions by forcing native display in ``ExceptionGroups`` even when using display options other than ``--tb=native``. A temporary step before full implementation of pytest-native display for inner exceptions in ``ExceptionGroups``. diff --git a/changelog/9248.doc.rst b/changelog/9248.doc.rst deleted file mode 100644 index 755e7b0f1af..00000000000 --- a/changelog/9248.doc.rst +++ /dev/null @@ -1 +0,0 @@ -The documentation is now built using Sphinx 5.x (up from 3.x previously). diff --git a/changelog/9291.doc.rst b/changelog/9291.doc.rst deleted file mode 100644 index fad8467dc90..00000000000 --- a/changelog/9291.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Update documentation on how :func:`pytest.warns` affects :class:`DeprecationWarning`. diff --git a/changelog/9741.improvement.rst b/changelog/9741.improvement.rst deleted file mode 100644 index 1f9ab3eadf2..00000000000 --- a/changelog/9741.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -On Python 3.11, use the standard library's :mod:`tomllib` to parse TOML. - -:mod:`tomli`` is no longer a dependency on Python 3.11. diff --git a/changelog/9742.improvement.rst b/changelog/9742.improvement.rst deleted file mode 100644 index a1abfc27469..00000000000 --- a/changelog/9742.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Display assertion message without escaped newline characters with ``-vv``. diff --git a/changelog/9823.improvement.rst b/changelog/9823.improvement.rst deleted file mode 100644 index 0a14cab6743..00000000000 --- a/changelog/9823.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Improved error message that is shown when no collector is found for a given file. diff --git a/changelog/9873.improvement.rst b/changelog/9873.improvement.rst deleted file mode 100644 index 431f9861b62..00000000000 --- a/changelog/9873.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Some coloring has been added to the short test summary. diff --git a/changelog/9877.bugfix.rst b/changelog/9877.bugfix.rst deleted file mode 100644 index 1d2264c6157..00000000000 --- a/changelog/9877.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()``. diff --git a/changelog/9883.improvement.rst b/changelog/9883.improvement.rst deleted file mode 100644 index 180784b5dba..00000000000 --- a/changelog/9883.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Normalize the help description of all command-line options. diff --git a/changelog/9886.deprecation.rst b/changelog/9886.deprecation.rst deleted file mode 100644 index 94f51decfda..00000000000 --- a/changelog/9886.deprecation.rst +++ /dev/null @@ -1,10 +0,0 @@ -The functionality for running tests written for ``nose`` has been officially deprecated. - -This includes: - -* Plain ``setup`` and ``teardown`` functions and methods: this might catch users by surprise, as ``setup()`` and ``teardown()`` are not pytest idioms, but part of the ``nose`` support. -* Setup/teardown using the `@with_setup `_ decorator. - -For more details, consult the :ref:`deprecation docs `. - -.. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup diff --git a/changelog/9897.feature.rst b/changelog/9897.feature.rst deleted file mode 100644 index 7464067bfcd..00000000000 --- a/changelog/9897.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added shell-style wildcard support to ``testpaths``. diff --git a/changelog/9906.trivial.rst b/changelog/9906.trivial.rst deleted file mode 100644 index 8911b7190f6..00000000000 --- a/changelog/9906.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers. diff --git a/changelog/9910.trivial.rst b/changelog/9910.trivial.rst deleted file mode 100644 index 4b1a4683c1e..00000000000 --- a/changelog/9910.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Fix default encoding warning (``EncodingWarning``) in ``cacheprovider`` diff --git a/changelog/9920.improvement.rst b/changelog/9920.improvement.rst deleted file mode 100644 index ed47e872cac..00000000000 --- a/changelog/9920.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Display full crash messages in ``short test summary info``, when runng in a CI environment. diff --git a/changelog/9984.trivial.rst b/changelog/9984.trivial.rst deleted file mode 100644 index cca8170629c..00000000000 --- a/changelog/9984.trivial.rst +++ /dev/null @@ -1,4 +0,0 @@ -Improve the error message when we attempt to access a fixture that has been -torn down. -Add an additional sentence to the docstring explaining when it's not a good -idea to call getfixturevalue. diff --git a/changelog/9987.improvement.rst b/changelog/9987.improvement.rst deleted file mode 100644 index cb1ae17ad2c..00000000000 --- a/changelog/9987.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Added support for hidden configuration file by allowing ``.pytest.ini`` as an alternative to ``pytest.ini``. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 142425cdee7..021cbd1af39 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.2.0 release-7.1.3 release-7.1.2 release-7.1.1 diff --git a/doc/en/announce/release-7.2.0.rst b/doc/en/announce/release-7.2.0.rst new file mode 100644 index 00000000000..eca84aeb669 --- /dev/null +++ b/doc/en/announce/release-7.2.0.rst @@ -0,0 +1,93 @@ +pytest-7.2.0 +======================================= + +The pytest team is proud to announce the 7.2.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: + +* Aaron Berdy +* Adam Turner +* Albert Villanova del Moral +* Alice Purcell +* Anthony Sottile +* Anton Yakutovich +* Babak Keyvani +* Brandon Chinn +* Bruno Oliveira +* Chanvin Xiao +* Cheuk Ting Ho +* Chris Wheeler +* EmptyRabbit +* Ezio Melotti +* Florian Best +* Florian Bruhin +* Fredrik Berndtsson +* Gabriel Landau +* Gergely Kalmár +* Hugo van Kemenade +* James Gerity +* John Litborn +* Jon Parise +* Kevin C +* Kian Eliasi +* MatthewFlamm +* Miro Hrončok +* Nate Meyvis +* Neil Girdhar +* Nhieuvu1802 +* Nipunn Koorapati +* Ofek Lev +* Paul Müller +* Paul Reece +* Pax +* Pete Baughman +* Peyman Salehi +* Philipp A +* Ran Benita +* Robert O'Shea +* Ronny Pfannschmidt +* Rowin +* Ruth Comer +* Samuel Colvin +* Samuel Gaist +* Sandro Tosi +* Shantanu +* Simon K +* Stephen Rosen +* Sviatoslav Sydorenko +* Tatiana Ovary +* Thierry Moisan +* Thomas Grainger +* Tim Hoffmann +* Tobias Diez +* Tony Narlock +* Vivaan Verma +* Wolfremium +* Zac Hatfield-Dodds +* Zach OBrien +* aizpurua23a +* gresm +* holesch +* itxasos23 +* johnkangw +* skhomuti +* sommersoft +* wodny +* zx.qiu + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 7e22002245d..1f55ea156fc 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -33,7 +33,7 @@ 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. - capsys -- .../_pytest/capture.py:878 + capsys -- .../_pytest/capture.py:905 Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsys.readouterr()`` method @@ -51,7 +51,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capsys.readouterr() assert captured.out == "hello\n" - capsysbinary -- .../_pytest/capture.py:906 + capsysbinary -- .../_pytest/capture.py:933 Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` @@ -69,7 +69,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:934 + capfd -- .../_pytest/capture.py:961 Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -87,7 +87,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:962 + capfdbinary -- .../_pytest/capture.py:989 Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -105,7 +105,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfdbinary.readouterr() assert captured.out == b"hello\n" - doctest_namespace [session scope] -- .../_pytest/doctest.py:735 + doctest_namespace [session scope] -- .../_pytest/doctest.py:738 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. @@ -119,7 +119,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:1344 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1351 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -163,7 +163,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a record_testsuite_property("ARCH", "PPC") record_testsuite_property("STORAGE_TYPE", "CEPH") - ``name`` must be a string, ``value`` will be converted to a string and properly xml-escaped. + :param name: + The property name. + :param value: + The property value. Will be converted to a string. .. warning:: @@ -193,7 +196,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:487 + caplog -- .../_pytest/logging.py:491 Access and control log capturing. Captured logs are available through the following properties/methods:: @@ -228,16 +231,16 @@ 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:29 + recwarn -- .../_pytest/recwarn.py:30 Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. - See https://docs.python.org/library/how-to/capture-warnings.html for information + See https://docs.pytest.org/en/latest/how-to/capture-warnings.html for information on warning categories. - tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:184 + tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:188 Return a :class:`pytest.TempPathFactory` instance for the test session. - tmp_path -- .../_pytest/tmpdir.py:199 + tmp_path -- .../_pytest/tmpdir.py:203 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index ef3a241cdb1..53ddafc52e7 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,154 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.2.0 (2022-10-23) +========================= + +Deprecations +------------ + +- `#10012 `_: Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. + + +- `#10396 `_: pytest no longer depends on the ``py`` library. ``pytest`` provides a vendored copy of ``py.error`` and ``py.path`` modules but will use the ``py`` library if it is installed. If you need other ``py.*`` modules, continue to install the deprecated ``py`` library separately, otherwise it can usually be removed as a dependency. + + +- `#4562 `_: Deprecate configuring hook specs/impls using attributes/marks. + + Instead use :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec`. + For more details, see the :ref:`docs `. + + +- `#9886 `_: The functionality for running tests written for ``nose`` has been officially deprecated. + + This includes: + + * Plain ``setup`` and ``teardown`` functions and methods: this might catch users by surprise, as ``setup()`` and ``teardown()`` are not pytest idioms, but part of the ``nose`` support. + * Setup/teardown using the `@with_setup `_ decorator. + + For more details, consult the :ref:`deprecation docs `. + + .. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup + + + +Features +-------- + +- `#9897 `_: Added shell-style wildcard support to ``testpaths``. + + + +Improvements +------------ + +- `#10218 `_: ``@pytest.mark.parametrize()`` (and similar functions) now accepts any ``Sequence[str]`` for the argument names, + instead of just ``list[str]`` and ``tuple[str, ...]``. + + (Note that ``str``, which is itself a ``Sequence[str]``, is still treated as a + comma-delimited name list, as before). + + +- `#10381 `_: The ``--no-showlocals`` flag has been added. This can be passed directly to tests to override ``--showlocals`` declared through ``addopts``. + + +- `#3426 `_: Assertion failures with strings in NFC and NFD forms that normalize to the same string now have a dedicated error message detailing the issue, and their utf-8 representation is expresed instead. + + +- `#7337 `_: A warning 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` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`. + + +- `#8508 `_: Introduce multiline display for warning matching via :py:func:`pytest.warns` and + enhance match comparison for :py:func:`_pytest._code.ExceptionInfo.match` as returned by :py:func:`pytest.raises`. + + +- `#8646 `_: Improve :py:func:`pytest.raises`. Previously passing an empty tuple would give a confusing + error. We now raise immediately with a more helpful message. + + +- `#9741 `_: On Python 3.11, use the standard library's :mod:`tomllib` to parse TOML. + + :mod:`tomli`` is no longer a dependency on Python 3.11. + + +- `#9742 `_: Display assertion message without escaped newline characters with ``-vv``. + + +- `#9823 `_: Improved error message that is shown when no collector is found for a given file. + + +- `#9873 `_: Some coloring has been added to the short test summary. + + +- `#9883 `_: Normalize the help description of all command-line options. + + +- `#9920 `_: Display full crash messages in ``short test summary info``, when runng in a CI environment. + + +- `#9987 `_: Added support for hidden configuration file by allowing ``.pytest.ini`` as an alternative to ``pytest.ini``. + + + +Bug Fixes +--------- + +- `#10150 `_: :data:`sys.stdin` now contains all expected methods of a file-like object when capture is enabled. + + +- `#10382 `_: Do not break into pdb when ``raise unittest.SkipTest()`` appears top-level in a file. + + +- `#7792 `_: Marks are now inherited according to the full MRO in test classes. Previously, if a test class inherited from two or more classes, only marks from the first super-class would apply. + + When inheriting marks from super-classes, marks from the sub-classes are now ordered before marks from the super-classes, in MRO order. Previously it was the reverse. + + When inheriting marks from super-classes, the `pytestmark` attribute of the sub-class now only contains the marks directly applied to it. Previously, it also contained marks from its super-classes. Please note that this attribute should not normally be accessed directly; use :func:`pytest.Node.iter_markers` instead. + + +- `#9159 `_: Showing inner exceptions by forcing native display in ``ExceptionGroups`` even when using display options other than ``--tb=native``. A temporary step before full implementation of pytest-native display for inner exceptions in ``ExceptionGroups``. + + +- `#9877 `_: Ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()``. + + + +Improved Documentation +---------------------- + +- `#10344 `_: Update information on writing plugins to use ``pyproject.toml`` instead of ``setup.py``. + + +- `#9248 `_: The documentation is now built using Sphinx 5.x (up from 3.x previously). + + +- `#9291 `_: Update documentation on how :func:`pytest.warns` affects :class:`DeprecationWarning`. + + + +Trivial/Internal Changes +------------------------ + +- `#10196 `_: :class:`~pytest.PytestReturnNotNoneWarning` is now a subclass of :class:`~pytest.PytestRemovedIn8Warning`: the plan is to make returning non-``None`` from tests an error in the future. + + +- `#10313 `_: Made ``_pytest.doctest.DoctestItem`` export ``pytest.DoctestItem`` for + type check and runtime purposes. Made `_pytest.doctest` use internal APIs + to avoid circular imports. + + +- `#9906 `_: Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers. + + +- `#9910 `_: Fix default encoding warning (``EncodingWarning``) in ``cacheprovider`` + + +- `#9984 `_: Improve the error message when we attempt to access a fixture that has been + torn down. + Add an additional sentence to the docstring explaining when it's not a good + idea to call getfixturevalue. + + pytest 7.1.3 (2022-08-31) ========================= diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 34d96c2bc00..55fd1f576cf 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -246,9 +246,9 @@ You can ask which markers exist for your test suite - the list includes our just @pytest.mark.usefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/stable/explanation/fixtures.html#usefixtures - @pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. + @pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead. - @pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. + @pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. DEPRECATED, use @pytest.hookimpl(trylast=True) instead. For an example on how to add and work with markers from a plugin, see @@ -438,9 +438,9 @@ The ``--markers`` option always gives you a list of available markers: @pytest.mark.usefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/stable/explanation/fixtures.html#usefixtures - @pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. + @pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead. - @pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. + @pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. DEPRECATED, use @pytest.hookimpl(trylast=True) instead. .. _`passing callables to custom markers`: @@ -611,7 +611,7 @@ then you will see two tests skipped and two executed tests as expected: test_plat.py s.s. [100%] ========================= short test summary info ========================== - SKIPPED [2] conftest.py:12: cannot run on platform linux + SKIPPED [2] conftest.py:13: cannot run on platform linux ======================= 2 passed, 2 skipped in 0.12s ======================= Note that if you specify a platform via the marker-command line option like this: diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index ba1acdfd164..e62060f191c 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -661,8 +661,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 - reason: 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`` diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index ce8ce815260..971982c2ce8 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 7.1.3 + pytest 7.2.0 .. _`simpletest`: diff --git a/doc/en/how-to/cache.rst b/doc/en/how-to/cache.rst index 529d97d53fb..8554a984c72 100644 --- a/doc/en/how-to/cache.rst +++ b/doc/en/how-to/cache.rst @@ -233,7 +233,7 @@ If you run this command for the first time, you can see the print statement: > assert mydata == 23 E assert 42 == 23 - test_caching.py:20: AssertionError + test_caching.py:19: AssertionError -------------------------- Captured stdout setup --------------------------- running expensive computation... ========================= short test summary info ========================== @@ -256,7 +256,7 @@ the cache and nothing will be printed: > assert mydata == 23 E assert 42 == 23 - test_caching.py:20: AssertionError + test_caching.py:19: AssertionError ========================= short test summary info ========================== FAILED test_caching.py::test_function - assert 42 == 23 1 failed in 0.12s diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index 85081a47c61..7d900ce3fdb 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -349,8 +349,7 @@ Example: test_example.py:14: AssertionError ========================= 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 - reason: 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/unittest.rst b/doc/en/how-to/unittest.rst index 658c69a14fd..37caf6e9fb7 100644 --- a/doc/en/how-to/unittest.rst +++ b/doc/en/how-to/unittest.rst @@ -157,7 +157,7 @@ the ``self.db`` values in the traceback: E AssertionError: .DummyDB object at 0xdeadbeef0001> E assert 0 - test_unittest_db.py:10: AssertionError + test_unittest_db.py:11: AssertionError ___________________________ MyTest.test_method2 ____________________________ self = @@ -167,7 +167,7 @@ the ``self.db`` values in the traceback: E AssertionError: .DummyDB object at 0xdeadbeef0001> E assert 0 - test_unittest_db.py:13: AssertionError + test_unittest_db.py:14: AssertionError ========================= short test summary info ========================== FAILED test_unittest_db.py::MyTest::test_method1 - AssertionError: