Compare commits
26 Commits
graingert-
...
report_xfa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0de126848e | ||
|
|
b247f574a3 | ||
|
|
0cd183dc0a | ||
|
|
1ce234dc78 | ||
|
|
8fb7e8b31e | ||
|
|
0d74a1c8a0 | ||
|
|
730c7ca0b1 | ||
|
|
4ecf313604 | ||
|
|
d0a09d8627 | ||
|
|
738ae2da9d | ||
|
|
7156a97f9a | ||
|
|
ed8701a57f | ||
|
|
247436819a | ||
|
|
c1728948ac | ||
|
|
dcd8b145d9 | ||
|
|
c7e9b22f37 | ||
|
|
fbe3e29a55 | ||
|
|
667b9fd7fd | ||
|
|
38f7c1e346 | ||
|
|
bcd9664370 | ||
|
|
7e69ce7449 | ||
|
|
395bbae8a2 | ||
|
|
ee53433542 | ||
|
|
304ab8495e | ||
|
|
40e9abd66b | ||
|
|
cac1eed0ea |
6
.github/workflows/deploy.yml
vendored
6
.github/workflows/deploy.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build and Check Package
|
||||
uses: hynek/build-and-inspect-python-package@v1.5
|
||||
uses: hynek/build-and-inspect-python-package@v1.5.3
|
||||
|
||||
deploy:
|
||||
if: github.repository == 'pytest-dev/pytest'
|
||||
@@ -53,8 +53,8 @@ jobs:
|
||||
run: |
|
||||
git config user.name "pytest bot"
|
||||
git config user.email "pytestbot@gmail.com"
|
||||
git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }}
|
||||
git push origin v${{ github.event.inputs.version }}
|
||||
git tag --annotate --message=v${{ github.event.inputs.version }} ${{ github.event.inputs.version }} ${{ github.sha }}
|
||||
git push origin ${{ github.event.inputs.version }}
|
||||
|
||||
release-notes:
|
||||
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- name: Build and Check Package
|
||||
uses: hynek/build-and-inspect-python-package@v1.5
|
||||
uses: hynek/build-and-inspect-python-package@v1.5.3
|
||||
|
||||
build:
|
||||
needs: [package]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.9.1
|
||||
rev: 23.10.1
|
||||
hooks:
|
||||
- id: black
|
||||
args: [--safe, --quiet]
|
||||
@@ -56,7 +56,7 @@ repos:
|
||||
hooks:
|
||||
- id: python-use-type-annotations
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.5.1
|
||||
rev: v1.6.1
|
||||
hooks:
|
||||
- id: mypy
|
||||
files: ^(src/|testing/)
|
||||
|
||||
@@ -9,6 +9,10 @@ python:
|
||||
path: .
|
||||
- requirements: doc/en/requirements.txt
|
||||
|
||||
sphinx:
|
||||
configuration: doc/en/conf.py
|
||||
fail_on_warning: true
|
||||
|
||||
build:
|
||||
os: ubuntu-20.04
|
||||
tools:
|
||||
|
||||
1
AUTHORS
1
AUTHORS
@@ -56,6 +56,7 @@ Barney Gale
|
||||
Ben Gartner
|
||||
Ben Webb
|
||||
Benjamin Peterson
|
||||
Benjamin Schubert
|
||||
Bernard Pratz
|
||||
Bo Wu
|
||||
Bob Ippolito
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
markers are now considered in the reverse mro order to ensure base class markers are considered first
|
||||
this resolves a regression.
|
||||
3
changelog/11065.doc.rst
Normal file
3
changelog/11065.doc.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
Use pytestconfig instead of request.config in cache example
|
||||
|
||||
to be consistent with the API documentation.
|
||||
@@ -1 +0,0 @@
|
||||
Fixed ``:=`` in asserts impacting unrelated test cases.
|
||||
@@ -1 +0,0 @@
|
||||
Handle an edge case where :data:`sys.stderr` might already be closed when :ref:`faulthandler` is tearing down.
|
||||
1
changelog/11520.improvement.rst
Normal file
1
changelog/11520.improvement.rst
Normal file
@@ -0,0 +1 @@
|
||||
Improved very verbose diff output to color it as a diff instead of only red.
|
||||
1
changelog/11563.bugfix.rst
Normal file
1
changelog/11563.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
||||
Fixed crash when using an empty string for the same parametrized value more than once.
|
||||
@@ -6,6 +6,7 @@ Release announcements
|
||||
:maxdepth: 2
|
||||
|
||||
|
||||
release-7.4.3
|
||||
release-7.4.2
|
||||
release-7.4.1
|
||||
release-7.4.0
|
||||
|
||||
19
doc/en/announce/release-7.4.3.rst
Normal file
19
doc/en/announce/release-7.4.3.rst
Normal file
@@ -0,0 +1,19 @@
|
||||
pytest-7.4.3
|
||||
=======================================
|
||||
|
||||
pytest 7.4.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:
|
||||
|
||||
* Bruno Oliveira
|
||||
* Marc Mueller
|
||||
|
||||
|
||||
Happy testing,
|
||||
The pytest Development Team
|
||||
@@ -28,6 +28,21 @@ with advance notice in the **Deprecations** section of releases.
|
||||
|
||||
.. towncrier release notes start
|
||||
|
||||
pytest 7.4.3 (2023-10-24)
|
||||
=========================
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
- `#10447 <https://github.com/pytest-dev/pytest/issues/10447>`_: Markers are now considered in the reverse mro order to ensure base class markers are considered first -- this resolves a regression.
|
||||
|
||||
|
||||
- `#11239 <https://github.com/pytest-dev/pytest/issues/11239>`_: Fixed ``:=`` in asserts impacting unrelated test cases.
|
||||
|
||||
|
||||
- `#11439 <https://github.com/pytest-dev/pytest/issues/11439>`_: Handled an edge case where :data:`sys.stderr` might already be closed when :ref:`faulthandler` is tearing down.
|
||||
|
||||
|
||||
pytest 7.4.2 (2023-09-07)
|
||||
=========================
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Install ``pytest``
|
||||
.. code-block:: bash
|
||||
|
||||
$ pytest --version
|
||||
pytest 7.4.2
|
||||
pytest 7.4.3
|
||||
|
||||
.. _`simpletest`:
|
||||
|
||||
|
||||
@@ -213,12 +213,12 @@ across pytest invocations:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mydata(request):
|
||||
val = request.config.cache.get("example/value", None)
|
||||
def mydata(pytestconfig):
|
||||
val = pytestconfig.cache.get("example/value", None)
|
||||
if val is None:
|
||||
expensive_computation()
|
||||
val = 42
|
||||
request.config.cache.set("example/value", val)
|
||||
pytestconfig.cache.set("example/value", val)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,12 @@ Examples for modifying traceback printing:
|
||||
pytest -l # show local variables (shortcut)
|
||||
pytest --no-showlocals # hide local variables (if addopts enables them)
|
||||
|
||||
pytest --capture=fd # default, capture at the file descriptor level
|
||||
pytest --capture=sys # capture at the sys level
|
||||
pytest --capture=no # don't capture
|
||||
pytest -s # don't capture (shortcut)
|
||||
pytest --capture=tee-sys # capture to logs but also output to sys level streams
|
||||
|
||||
pytest --tb=auto # (default) 'long' tracebacks for the first and last
|
||||
# entry, but 'short' style for the other entries
|
||||
pytest --tb=long # exhaustive, informative traceback formatting
|
||||
@@ -36,6 +42,16 @@ option you make sure a trace is shown.
|
||||
Verbosity
|
||||
--------------------------------------------------
|
||||
|
||||
Examples for modifying printing verbosity:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pytest --quiet # quiet - less verbose - mode
|
||||
pytest -q # quiet - less verbose - mode (shortcut)
|
||||
pytest -v # increase verbosity, display individual test names
|
||||
pytest -vv # more verbose, display more details from the test output
|
||||
pytest -vvv # not a standard , but may be used for even more detail in certain setups
|
||||
|
||||
The ``-v`` flag controls the verbosity of pytest output in various aspects: test session progress, assertion
|
||||
details when tests fail, fixtures details with ``--fixtures``, etc.
|
||||
|
||||
|
||||
@@ -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 <python:distutils/configfile>`, and can also be used to hold pytest configuration
|
||||
``setup.cfg`` files are general purpose configuration files, used originally by ``distutils`` (now deprecated) and `setuptools <https://setuptools.pypa.io/en/latest/userguide/declarative_config.html>`__, and can also be used to hold pytest configuration
|
||||
if they have a ``[tool:pytest]`` section.
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
@@ -27,7 +27,7 @@ please refer to `the update script <https://github.com/pytest-dev/pytest/blob/ma
|
||||
creating a PDF, because otherwise the table gets far too wide for the
|
||||
page.
|
||||
|
||||
This list contains 1329 plugins.
|
||||
This list contains 1337 plugins.
|
||||
|
||||
.. only:: not latex
|
||||
|
||||
@@ -67,7 +67,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-allure-intersection` Oct 27, 2022 N/A pytest (<5)
|
||||
:pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest
|
||||
:pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0)
|
||||
:pypi:`pytest-analyzer` this plugin allows to analyze tests in pytest project, collect test metadata and sync it with testomat.io TCM system Sep 05, 2023 N/A pytest >=7.3.1
|
||||
:pypi:`pytest-analyzer` this plugin allows to analyze tests in pytest project, collect test metadata and sync it with testomat.io TCM system Oct 21, 2023 N/A pytest >=7.3.1
|
||||
:pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest
|
||||
:pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jul 31, 2022 4 - Beta pytest (>=3.5.0)
|
||||
:pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0)
|
||||
@@ -91,6 +91,7 @@ This list contains 1329 plugins.
|
||||
: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-aspec` A rspec format reporter for pytest Oct 23, 2023 4 - Beta N/A
|
||||
:pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A
|
||||
:pypi:`pytest-assertcount` Plugin to count actual number of asserts in pytest Oct 23, 2022 N/A pytest (>=5.0.0)
|
||||
:pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A
|
||||
@@ -109,7 +110,7 @@ This list contains 1329 plugins.
|
||||
: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-atf-allure` 基于allure-pytest进行自定义 Sep 14, 2023 N/A pytest (>=7.4.2,<8.0.0)
|
||||
:pypi:`pytest-atf-allure` 基于allure-pytest进行自定义 Oct 22, 2023 N/A pytest (>=7.4.2,<8.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
|
||||
@@ -206,6 +207,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest
|
||||
:pypi:`pytest-check-requirements` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A
|
||||
:pypi:`pytest-chic-report` A pytest plugin to send a report and printing summary of tests. Jan 31, 2023 5 - Production/Stable N/A
|
||||
:pypi:`pytest-choose` Provide the pytest with the ability to collect use cases based on rules in text files Oct 17, 2023 N/A pytest >=7.0.0
|
||||
: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. Oct 20, 2022 N/A N/A
|
||||
@@ -329,7 +331,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-dir-equal` pytest-dir-equals is a pytest plugin providing helpers to assert directories equality allowing golden testing Jun 23, 2023 4 - Beta pytest>=7.1.2
|
||||
: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. Jul 16, 2023 4 - Beta pytest (!=6.0.0,<8,>=3.3.2)
|
||||
:pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Oct 18, 2023 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. May 19, 2023 4 - Beta pytest
|
||||
@@ -382,6 +384,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-donde` record pytest session characteristics per test item (coverage and duration) into a persistent file and use them in your own plugin or script. Oct 01, 2023 4 - Beta pytest >=7.3.1
|
||||
:pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0)
|
||||
:pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0)
|
||||
:pypi:`pytest-dot-only-pkcopley` A Pytest marker for only running a single test Oct 27, 2023 N/A N/A
|
||||
:pypi:`pytest-draw` Pytest plugin for randomly selecting a specific number of tests Mar 21, 2023 3 - Alpha pytest
|
||||
:pypi:`pytest-drf` A Django REST framework plugin for pytest. Jul 12, 2022 5 - Production/Stable pytest (>=3.7)
|
||||
:pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A
|
||||
@@ -423,7 +426,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-encoding` set your encoding and logger Aug 11, 2023 N/A pytest
|
||||
:pypi:`pytest-enhanced-reports` Enhanced test reports for pytest Dec 15, 2022 N/A N/A
|
||||
:pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A
|
||||
:pypi:`pytest-env` py.test plugin that allows you to add environment variables. Aug 24, 2023 5 - Production/Stable pytest>=7.3.1
|
||||
:pypi:`pytest-env` pytest plugin that allows you to add environment variables. Oct 24, 2023 5 - Production/Stable pytest>=7.4.2
|
||||
:pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A
|
||||
:pypi:`pytest-env-info` Push information about the running pytest into envvars Nov 25, 2017 4 - Beta pytest (>=3.1.1)
|
||||
:pypi:`pytest-envraw` py.test plugin that allows you to add environment variables. Aug 27, 2020 4 - Beta pytest (>=2.6.0)
|
||||
@@ -463,7 +466,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-failed-screen-record` Create a video of the screen when pytest fails Jan 05, 2023 4 - Beta pytest (>=7.1.2d,<8.0.0)
|
||||
: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 Aug 13, 2022 4 - Beta pytest (>=6.0)
|
||||
:pypi:`pytest-fail-slow` Fail tests that take too long to run Oct 21, 2023 N/A 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
|
||||
@@ -500,7 +503,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Oct 26, 2022 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` A set of py.test fixtures to test Flask applications. Oct 23, 2023 5 - Production/Stable pytest >=5.2
|
||||
:pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Apr 25, 2023 4 - Beta pytest (~=7.3)
|
||||
: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)
|
||||
@@ -530,9 +533,9 @@ This list contains 1329 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. Oct 09, 2023 N/A N/A
|
||||
:pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Oct 26, 2023 N/A N/A
|
||||
:pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest
|
||||
:pypi:`pytest-gitconfig` Provide a gitconfig sandbox for testing Oct 14, 2023 4 - Beta pytest>=7.1.2
|
||||
:pypi:`pytest-gitconfig` Provide a gitconfig sandbox for testing Oct 15, 2023 4 - Beta pytest>=7.1.2
|
||||
:pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A
|
||||
:pypi:`pytest-git-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
|
||||
@@ -567,7 +570,7 @@ This list contains 1329 plugins.
|
||||
: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-home` Home directory fixtures Oct 09, 2023 5 - Production/Stable pytest
|
||||
:pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A
|
||||
:pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 14, 2023 3 - Alpha pytest ==7.3.1
|
||||
:pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Oct 28, 2023 3 - Alpha pytest ==7.4.3
|
||||
:pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0)
|
||||
:pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A
|
||||
:pypi:`pytest-hot-reloading` Jun 23, 2023 N/A N/A
|
||||
@@ -583,7 +586,7 @@ This list contains 1329 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-report-merger` Oct 23, 2023 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 May 08, 2023 5 - Production/Stable pytest ; extra == 'test'
|
||||
@@ -613,7 +616,7 @@ This list contains 1329 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-inline` A pytest plugin for writing inline tests. Oct 10, 2023 4 - Beta pytest >=7.0.0
|
||||
:pypi:`pytest-inline` A pytest plugin for writing inline tests. Oct 19, 2023 4 - Beta pytest >=7.0.0
|
||||
:pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Aug 03, 2023 5 - Production/Stable N/A
|
||||
:pypi:`pytest-inmanta-extensions` Inmanta tests package Oct 13, 2023 5 - Production/Stable N/A
|
||||
:pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules May 17, 2023 5 - Production/Stable N/A
|
||||
@@ -692,7 +695,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-litter` Pytest plugin which verifies that tests do not modify file trees. Aug 08, 2023 4 - Beta pytest >=6.1
|
||||
:pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest
|
||||
:pypi:`pytest-local-badge` Generate local badges (shields) reporting your test suite status. Jan 15, 2023 N/A pytest (>=6.1.0)
|
||||
:pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Oct 04, 2022 5 - Production/Stable pytest
|
||||
:pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Oct 14, 2023 5 - Production/Stable pytest
|
||||
:pypi:`pytest-localserver` pytest plugin to test server connections locally. Oct 12, 2023 4 - Beta N/A
|
||||
:pypi:`pytest-localstack` Pytest plugin for AWS integration tests Jun 07, 2023 4 - Beta pytest (>=6.0.0,<7.0.0)
|
||||
:pypi:`pytest-lockable` lockable resource plugin for pytest Aug 09, 2023 5 - Production/Stable pytest
|
||||
@@ -745,7 +748,7 @@ This list contains 1329 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 15, 2023 5 - Production/Stable pytest (>=5.0)
|
||||
:pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Oct 19, 2023 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
|
||||
@@ -784,10 +787,10 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0
|
||||
:pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Feb 25, 2023 N/A pytest>=7,<8
|
||||
:pypi:`pytest-mysql` MySQL process and client fixtures for pytest Mar 27, 2023 5 - Production/Stable pytest (>=6.2)
|
||||
:pypi:`pytest-ndb` Open Source Software Health Report Jul 19, 2023 N/A pytest
|
||||
:pypi:`pytest-ndb` pytest notebook debugger Oct 15, 2023 N/A pytest
|
||||
:pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0)
|
||||
:pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0)
|
||||
:pypi:`pytest-netdut` "Automated software testing for switches using pytest" Sep 21, 2023 N/A pytest <7.3,>=3.5.0
|
||||
:pypi:`pytest-netdut` "Automated software testing for switches using pytest" Oct 26, 2023 N/A pytest <7.3,>=3.5.0
|
||||
:pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A
|
||||
:pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest
|
||||
:pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1)
|
||||
@@ -846,6 +849,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2)
|
||||
:pypi:`pytest-parametrized` Pytest decorator for parametrizing tests with default iterables. Sep 13, 2022 5 - Production/Stable pytest
|
||||
:pypi:`pytest-parametrize-suite` A simple pytest extension for creating a named test suite. Jan 19, 2023 5 - Production/Stable pytest
|
||||
:pypi:`pytest-param-scope` pytest parametrize scope fixture workaround Oct 18, 2023 N/A 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)
|
||||
@@ -885,10 +889,10 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-plone` Pytest plugin to test Plone addons Jan 05, 2023 3 - Alpha pytest
|
||||
: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 Dec 24, 2022 5 - Production/Stable pytest (>=6.0.1)
|
||||
:pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Oct 18, 2023 5 - Production/Stable pytest >=7.4.2
|
||||
: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 Dec 26, 2022 N/A N/A
|
||||
:pypi:`pytest-pokie` Pokie plugin for pytest May 22, 2023 5 - Production/Stable N/A
|
||||
:pypi:`pytest-pokie` Pokie plugin for pytest Oct 19, 2023 5 - Production/Stable 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
|
||||
@@ -935,7 +939,7 @@ This list contains 1329 plugins.
|
||||
: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 11, 2023 5 - Production/Stable pytest
|
||||
:pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest
|
||||
:pypi:`pytest-pyreport` PyReport is a lightweight reporting plugin for Pytest that provides concise HTML report Aug 27, 2023 N/A pytest
|
||||
:pypi:`pytest-pyreport` PyReport is a lightweight reporting plugin for Pytest that provides concise HTML report Oct 21, 2023 N/A pytest
|
||||
:pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Aug 20, 2023 4 - Beta pytest >=7.0.0
|
||||
:pypi:`pytest-pyspec` A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". Mar 12, 2023 5 - Production/Stable pytest (>=7.2.1,<8.0.0)
|
||||
:pypi:`pytest-pystack` Plugin to run pystack after a timeout for a test suite. May 07, 2023 N/A pytest (>=3.5.0)
|
||||
@@ -999,8 +1003,9 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility May 22, 2023 3 - Alpha pytest
|
||||
:pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest
|
||||
:pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2)
|
||||
:pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Sep 25, 2023 N/A pytest >=3.8.0
|
||||
:pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Oct 17, 2023 N/A pytest >=3.8.0
|
||||
:pypi:`pytest-reports` An interesting python package Jun 07, 2023 N/A N/A
|
||||
:pypi:`pytest-report-stream` A pytest plugin which allows to stream test reports at runtime Oct 22, 2023 4 - Beta N/A
|
||||
: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
|
||||
@@ -1019,7 +1024,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5)
|
||||
:pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0)
|
||||
:pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jul 10, 2023 5 - Production/Stable pytest
|
||||
:pypi:`pytest-result-log` Write the execution result of the case to the log Apr 17, 2023 N/A pytest>=7.2.0
|
||||
:pypi:`pytest-result-log` A pytest plugin that records the start, end, and result information of each use case in a log file Oct 15, 2023 N/A pytest>=7.2.0
|
||||
:pypi:`pytest-result-sender` Apr 20, 2023 N/A pytest>=7.3.1
|
||||
:pypi:`pytest-resume` A Pytest plugin to resuming from the last run test Apr 22, 2023 4 - Beta pytest (>=7.0)
|
||||
:pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A
|
||||
@@ -1028,6 +1033,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-reusable-testcases` Apr 28, 2023 N/A N/A
|
||||
:pypi:`pytest-reverse` Pytest plugin to reverse test order. Jul 10, 2023 5 - Production/Stable pytest
|
||||
:pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0)
|
||||
:pypi:`pytest-richer` Pytest plugin providing a Rich based reporter. Oct 27, 2023 3 - Alpha pytest
|
||||
:pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0)
|
||||
:pypi:`pytest-richtrace` A pytest plugin that displays the names and information of the pytest hook functions as they are executed. Jun 20, 2023 N/A N/A
|
||||
:pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A
|
||||
@@ -1057,7 +1063,7 @@ This list contains 1329 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. Oct 13, 2023 5 - Production/Stable N/A
|
||||
:pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Oct 27, 2023 5 - Production/Stable N/A
|
||||
:pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A
|
||||
:pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable 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)
|
||||
@@ -1065,8 +1071,8 @@ This list contains 1329 plugins.
|
||||
: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 May 28, 2023 5 - Production/Stable pytest>=6.0.0
|
||||
:pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Oct 03, 2023 N/A pytest >= 7.0.0
|
||||
:pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 13, 2023 5 - Production/Stable N/A
|
||||
:pypi:`pytest-selenium-auto` pytest plugin to automatically capture screenshots upon selenium webdriver events Oct 18, 2023 N/A pytest >= 7.0.0
|
||||
:pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Oct 27, 2023 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-selenium-screenshot` pytest plugin to automatically capture screenshots upon selenium webdriver events Aug 22, 2023 N/A pytest >= 7.0.0
|
||||
@@ -1095,7 +1101,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A
|
||||
:pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest
|
||||
:pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1)
|
||||
:pypi:`pytest-skip-markers` Pytest Salt Plugin Jul 31, 2023 5 - Production/Stable pytest (>=7.1.0)
|
||||
:pypi:`pytest-skip-markers` Pytest Salt Plugin Oct 20, 2023 5 - Production/Stable pytest >=7.1.0
|
||||
:pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6)
|
||||
:pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4)
|
||||
:pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Feb 09, 2023 N/A pytest>=6.2.0
|
||||
@@ -1138,8 +1144,8 @@ This list contains 1329 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 Sep 06, 2023 N/A pytest (>5.4.0,<8)
|
||||
:pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Oct 02, 2023 N/A N/A
|
||||
:pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Oct 23, 2023 N/A pytest (>5.4.0,<8)
|
||||
:pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Oct 27, 2023 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
|
||||
@@ -1204,7 +1210,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-testinfra-jpic` Test infrastructures Sep 21, 2023 5 - Production/Stable N/A
|
||||
:pypi:`pytest-testinfra-winrm-transport` Test infrastructures Sep 21, 2023 5 - Production/Stable N/A
|
||||
: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 13, 2023 4 - Beta pytest (<8,>=5)
|
||||
:pypi:`pytest-testmon` selects tests affected by changed files and methods Oct 17, 2023 4 - Beta pytest <8,>=5
|
||||
:pypi:`pytest-testmon-dev` selects tests affected by changed files and methods Mar 30, 2023 4 - Beta pytest (<8,>=5)
|
||||
:pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5)
|
||||
:pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Mar 03, 2023 4 - Beta pytest (<8,>=5)
|
||||
@@ -1306,6 +1312,7 @@ This list contains 1329 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-visual` Oct 24, 2023 3 - Alpha pytest >=7.0.0
|
||||
:pypi:`pytest-vnc` VNC client for Pytest Feb 25, 2023 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
|
||||
@@ -1322,6 +1329,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-web3-data` A pytest plugin to fetch test data from IPFS HTTP gateways during pytest execution. Oct 04, 2023 4 - Beta pytest
|
||||
:pypi:`pytest-webdriver` Selenium webdriver fixture for py.test 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-when` Utility which makes mocking more readable and controllable Oct 18, 2023 N/A pytest>=7.3.1
|
||||
:pypi:`pytest-whirlwind` Testing Tornado. Jun 12, 2020 N/A N/A
|
||||
:pypi:`pytest-wholenodeid` pytest addon for displaying the whole node id for failures Aug 26, 2015 4 - Beta pytest (>=2.0)
|
||||
:pypi:`pytest-win32consoletitle` Pytest progress in console title (Win32 only) Aug 08, 2021 N/A N/A
|
||||
@@ -1359,7 +1367,7 @@ This list contains 1329 plugins.
|
||||
:pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0
|
||||
:pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1)
|
||||
:pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A
|
||||
:pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Dec 12, 2022 5 - Production/Stable pytest (>=4.5.0)
|
||||
:pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Oct 27, 2023 5 - Production/Stable pytest (>=4.5.0)
|
||||
:pypi:`pytest-zest` Zesty additions to pytest. Nov 17, 2022 N/A N/A
|
||||
: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
|
||||
@@ -1600,7 +1608,7 @@ This list contains 1329 plugins.
|
||||
Static code checks used at Alphamoon
|
||||
|
||||
:pypi:`pytest-analyzer`
|
||||
*last release*: Sep 05, 2023,
|
||||
*last release*: Oct 21, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest >=7.3.1
|
||||
|
||||
@@ -1767,6 +1775,13 @@ This list contains 1329 plugins.
|
||||
|
||||
Convenient ASGI client/server fixtures for Pytest
|
||||
|
||||
:pypi:`pytest-aspec`
|
||||
*last release*: Oct 23, 2023,
|
||||
*status*: 4 - Beta,
|
||||
*requires*: N/A
|
||||
|
||||
A rspec format reporter for pytest
|
||||
|
||||
:pypi:`pytest-asptest`
|
||||
*last release*: Apr 28, 2018,
|
||||
*status*: 4 - Beta,
|
||||
@@ -1894,7 +1909,7 @@ This list contains 1329 plugins.
|
||||
Database testing fixtures using the SQLAlchemy asyncio API
|
||||
|
||||
:pypi:`pytest-atf-allure`
|
||||
*last release*: Sep 14, 2023,
|
||||
*last release*: Oct 22, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest (>=7.4.2,<8.0.0)
|
||||
|
||||
@@ -2572,6 +2587,13 @@ This list contains 1329 plugins.
|
||||
|
||||
A pytest plugin to send a report and printing summary of tests.
|
||||
|
||||
:pypi:`pytest-choose`
|
||||
*last release*: Oct 17, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest >=7.0.0
|
||||
|
||||
Provide the pytest with the ability to collect use cases based on rules in text files
|
||||
|
||||
:pypi:`pytest-chunks`
|
||||
*last release*: Jul 05, 2022,
|
||||
*status*: N/A,
|
||||
@@ -3434,9 +3456,9 @@ This list contains 1329 plugins.
|
||||
Disable plugins per test
|
||||
|
||||
:pypi:`pytest-discord`
|
||||
*last release*: Jul 16, 2023,
|
||||
*last release*: Oct 18, 2023,
|
||||
*status*: 4 - Beta,
|
||||
*requires*: pytest (!=6.0.0,<8,>=3.3.2)
|
||||
*requires*: pytest !=6.0.0,<8,>=3.3.2
|
||||
|
||||
A pytest plugin to notify test results to a Discord channel.
|
||||
|
||||
@@ -3804,6 +3826,13 @@ This list contains 1329 plugins.
|
||||
|
||||
A py.test plugin that parses environment files before running tests
|
||||
|
||||
:pypi:`pytest-dot-only-pkcopley`
|
||||
*last release*: Oct 27, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: N/A
|
||||
|
||||
A Pytest marker for only running a single test
|
||||
|
||||
:pypi:`pytest-draw`
|
||||
*last release*: Mar 21, 2023,
|
||||
*status*: 3 - Alpha,
|
||||
@@ -4092,11 +4121,11 @@ This list contains 1329 plugins.
|
||||
Improvements for pytest (rejected upstream)
|
||||
|
||||
:pypi:`pytest-env`
|
||||
*last release*: Aug 24, 2023,
|
||||
*last release*: Oct 24, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: pytest>=7.3.1
|
||||
*requires*: pytest>=7.4.2
|
||||
|
||||
py.test plugin that allows you to add environment variables.
|
||||
pytest plugin that allows you to add environment variables.
|
||||
|
||||
:pypi:`pytest-envfiles`
|
||||
*last release*: Oct 08, 2015,
|
||||
@@ -4372,9 +4401,9 @@ This list contains 1329 plugins.
|
||||
A pytest plugin that helps better distinguishing real test failures from setup flakiness.
|
||||
|
||||
:pypi:`pytest-fail-slow`
|
||||
*last release*: Aug 13, 2022,
|
||||
*status*: 4 - Beta,
|
||||
*requires*: pytest (>=6.0)
|
||||
*last release*: Oct 21, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest >=6.0
|
||||
|
||||
Fail tests that take too long to run
|
||||
|
||||
@@ -4631,9 +4660,9 @@ This list contains 1329 plugins.
|
||||
Flaptastic py.test plugin
|
||||
|
||||
:pypi:`pytest-flask`
|
||||
*last release*: Feb 27, 2021,
|
||||
*last release*: Oct 23, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: pytest (>=5.2)
|
||||
*requires*: pytest >=5.2
|
||||
|
||||
A set of py.test fixtures to test Flask applications.
|
||||
|
||||
@@ -4841,7 +4870,7 @@ This list contains 1329 plugins.
|
||||
For finding/executing Ghost Inspector tests
|
||||
|
||||
:pypi:`pytest-girder`
|
||||
*last release*: Oct 09, 2023,
|
||||
*last release*: Oct 26, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: N/A
|
||||
|
||||
@@ -4855,7 +4884,7 @@ This list contains 1329 plugins.
|
||||
Git repository fixture for py.test
|
||||
|
||||
:pypi:`pytest-gitconfig`
|
||||
*last release*: Oct 14, 2023,
|
||||
*last release*: Oct 15, 2023,
|
||||
*status*: 4 - Beta,
|
||||
*requires*: pytest>=7.1.2
|
||||
|
||||
@@ -5100,9 +5129,9 @@ This list contains 1329 plugins.
|
||||
A pytest plugin for use with homeassistant custom components.
|
||||
|
||||
:pypi:`pytest-homeassistant-custom-component`
|
||||
*last release*: Oct 14, 2023,
|
||||
*last release*: Oct 28, 2023,
|
||||
*status*: 3 - Alpha,
|
||||
*requires*: pytest ==7.3.1
|
||||
*requires*: pytest ==7.4.3
|
||||
|
||||
Experimental package to automatically extract test plugins for Home Assistant custom components
|
||||
|
||||
@@ -5212,7 +5241,7 @@ This list contains 1329 plugins.
|
||||
Generates a static html report based on pytest framework
|
||||
|
||||
:pypi:`pytest-html-report-merger`
|
||||
*last release*: Aug 31, 2022,
|
||||
*last release*: Oct 23, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: N/A
|
||||
|
||||
@@ -5422,7 +5451,7 @@ This list contains 1329 plugins.
|
||||
Reuse pytest.ini to store env variables
|
||||
|
||||
:pypi:`pytest-inline`
|
||||
*last release*: Oct 10, 2023,
|
||||
*last release*: Oct 19, 2023,
|
||||
*status*: 4 - Beta,
|
||||
*requires*: pytest >=7.0.0
|
||||
|
||||
@@ -5975,7 +6004,7 @@ This list contains 1329 plugins.
|
||||
Generate local badges (shields) reporting your test suite status.
|
||||
|
||||
:pypi:`pytest-localftpserver`
|
||||
*last release*: Oct 04, 2022,
|
||||
*last release*: Oct 14, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: pytest
|
||||
|
||||
@@ -6346,9 +6375,9 @@ This list contains 1329 plugins.
|
||||
pytest plugin to display test execution output like a mochajs
|
||||
|
||||
:pypi:`pytest-mock`
|
||||
*last release*: Jun 15, 2023,
|
||||
*last release*: Oct 19, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: pytest (>=5.0)
|
||||
*requires*: pytest >=5.0
|
||||
|
||||
Thin-wrapper around the mock package for easier use with pytest
|
||||
|
||||
@@ -6619,11 +6648,11 @@ This list contains 1329 plugins.
|
||||
MySQL process and client fixtures for pytest
|
||||
|
||||
:pypi:`pytest-ndb`
|
||||
*last release*: Jul 19, 2023,
|
||||
*last release*: Oct 15, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest
|
||||
|
||||
Open Source Software Health Report
|
||||
pytest notebook debugger
|
||||
|
||||
:pypi:`pytest-needle`
|
||||
*last release*: Dec 10, 2018,
|
||||
@@ -6640,7 +6669,7 @@ This list contains 1329 plugins.
|
||||
pytest-neo is a plugin for pytest that shows tests like screen of Matrix.
|
||||
|
||||
:pypi:`pytest-netdut`
|
||||
*last release*: Sep 21, 2023,
|
||||
*last release*: Oct 26, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest <7.3,>=3.5.0
|
||||
|
||||
@@ -7052,6 +7081,13 @@ This list contains 1329 plugins.
|
||||
|
||||
A simple pytest extension for creating a named test suite.
|
||||
|
||||
:pypi:`pytest-param-scope`
|
||||
*last release*: Oct 18, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest
|
||||
|
||||
pytest parametrize scope fixture workaround
|
||||
|
||||
:pypi:`pytest-parawtf`
|
||||
*last release*: Dec 03, 2018,
|
||||
*status*: 4 - Beta,
|
||||
@@ -7326,9 +7362,9 @@ This list contains 1329 plugins.
|
||||
A plugin to help developing and testing other plugins
|
||||
|
||||
:pypi:`pytest-plus`
|
||||
*last release*: Dec 24, 2022,
|
||||
*last release*: Oct 18, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: pytest (>=6.0.1)
|
||||
*requires*: pytest >=7.4.2
|
||||
|
||||
PyTest Plus Plugin :: extends pytest functionality
|
||||
|
||||
@@ -7347,7 +7383,7 @@ This list contains 1329 plugins.
|
||||
Pytest plugin to define functions you test with special marks for better navigation and reports
|
||||
|
||||
:pypi:`pytest-pokie`
|
||||
*last release*: May 22, 2023,
|
||||
*last release*: Oct 19, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: N/A
|
||||
|
||||
@@ -7676,7 +7712,7 @@ This list contains 1329 plugins.
|
||||
Pyramid server fixture for py.test
|
||||
|
||||
:pypi:`pytest-pyreport`
|
||||
*last release*: Aug 27, 2023,
|
||||
*last release*: Oct 21, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest
|
||||
|
||||
@@ -8124,7 +8160,7 @@ This list contains 1329 plugins.
|
||||
pytest plugin for adding tests' parameters to junit report
|
||||
|
||||
:pypi:`pytest-reportportal`
|
||||
*last release*: Sep 25, 2023,
|
||||
*last release*: Oct 17, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest >=3.8.0
|
||||
|
||||
@@ -8137,6 +8173,13 @@ This list contains 1329 plugins.
|
||||
|
||||
An interesting python package
|
||||
|
||||
:pypi:`pytest-report-stream`
|
||||
*last release*: Oct 22, 2023,
|
||||
*status*: 4 - Beta,
|
||||
*requires*: N/A
|
||||
|
||||
A pytest plugin which allows to stream test reports at runtime
|
||||
|
||||
:pypi:`pytest-reqs`
|
||||
*last release*: May 12, 2019,
|
||||
*status*: N/A,
|
||||
@@ -8264,11 +8307,11 @@ This list contains 1329 plugins.
|
||||
Pytest plugin to restrict the test types allowed
|
||||
|
||||
:pypi:`pytest-result-log`
|
||||
*last release*: Apr 17, 2023,
|
||||
*last release*: Oct 15, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest>=7.2.0
|
||||
|
||||
Write the execution result of the case to the log
|
||||
A pytest plugin that records the start, end, and result information of each use case in a log file
|
||||
|
||||
:pypi:`pytest-result-sender`
|
||||
*last release*: Apr 20, 2023,
|
||||
@@ -8326,6 +8369,13 @@ This list contains 1329 plugins.
|
||||
|
||||
Leverage rich for richer test session output
|
||||
|
||||
:pypi:`pytest-richer`
|
||||
*last release*: Oct 27, 2023,
|
||||
*status*: 3 - Alpha,
|
||||
*requires*: pytest
|
||||
|
||||
Pytest plugin providing a Rich based reporter.
|
||||
|
||||
:pypi:`pytest-rich-reporter`
|
||||
*last release*: Feb 17, 2022,
|
||||
*status*: 1 - Planning,
|
||||
@@ -8530,7 +8580,7 @@ This list contains 1329 plugins.
|
||||
|
||||
|
||||
:pypi:`pytest-sbase`
|
||||
*last release*: Oct 13, 2023,
|
||||
*last release*: Oct 27, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: N/A
|
||||
|
||||
@@ -8586,14 +8636,14 @@ This list contains 1329 plugins.
|
||||
pytest plugin for Selenium
|
||||
|
||||
:pypi:`pytest-selenium-auto`
|
||||
*last release*: Oct 03, 2023,
|
||||
*last release*: Oct 18, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest >= 7.0.0
|
||||
|
||||
pytest plugin to automatically capture screenshots upon selenium webdriver events
|
||||
|
||||
:pypi:`pytest-seleniumbase`
|
||||
*last release*: Oct 13, 2023,
|
||||
*last release*: Oct 27, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: N/A
|
||||
|
||||
@@ -8796,9 +8846,9 @@ This list contains 1329 plugins.
|
||||
Allow for multiple processes to log to a single file
|
||||
|
||||
:pypi:`pytest-skip-markers`
|
||||
*last release*: Jul 31, 2023,
|
||||
*last release*: Oct 20, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: pytest (>=7.1.0)
|
||||
*requires*: pytest >=7.1.0
|
||||
|
||||
Pytest Salt Plugin
|
||||
|
||||
@@ -9097,14 +9147,14 @@ This list contains 1329 plugins.
|
||||
|
||||
|
||||
:pypi:`pytest-splunk-addon`
|
||||
*last release*: Sep 06, 2023,
|
||||
*last release*: Oct 23, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest (>5.4.0,<8)
|
||||
|
||||
A Dynamic test tool for Splunk Apps and Add-ons
|
||||
|
||||
:pypi:`pytest-splunk-addon-ui-smartx`
|
||||
*last release*: Oct 02, 2023,
|
||||
*last release*: Oct 27, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: N/A
|
||||
|
||||
@@ -9559,9 +9609,9 @@ This list contains 1329 plugins.
|
||||
pytest reporting plugin for testlink
|
||||
|
||||
:pypi:`pytest-testmon`
|
||||
*last release*: Jul 13, 2023,
|
||||
*last release*: Oct 17, 2023,
|
||||
*status*: 4 - Beta,
|
||||
*requires*: pytest (<8,>=5)
|
||||
*requires*: pytest <8,>=5
|
||||
|
||||
selects tests affected by changed files and methods
|
||||
|
||||
@@ -10272,6 +10322,13 @@ This list contains 1329 plugins.
|
||||
|
||||
Virtualenv fixture for py.test
|
||||
|
||||
:pypi:`pytest-visual`
|
||||
*last release*: Oct 24, 2023,
|
||||
*status*: 3 - Alpha,
|
||||
*requires*: pytest >=7.0.0
|
||||
|
||||
|
||||
|
||||
:pypi:`pytest-vnc`
|
||||
*last release*: Feb 25, 2023,
|
||||
*status*: N/A,
|
||||
@@ -10384,6 +10441,13 @@ This list contains 1329 plugins.
|
||||
|
||||
Welian API Automation test framework pytest plugin
|
||||
|
||||
:pypi:`pytest-when`
|
||||
*last release*: Oct 18, 2023,
|
||||
*status*: N/A,
|
||||
*requires*: pytest>=7.3.1
|
||||
|
||||
Utility which makes mocking more readable and controllable
|
||||
|
||||
:pypi:`pytest-whirlwind`
|
||||
*last release*: Jun 12, 2020,
|
||||
*status*: N/A,
|
||||
@@ -10644,7 +10708,7 @@ This list contains 1329 plugins.
|
||||
OWASP ZAP plugin for py.test.
|
||||
|
||||
:pypi:`pytest-zebrunner`
|
||||
*last release*: Dec 12, 2022,
|
||||
*last release*: Oct 27, 2023,
|
||||
*status*: 5 - Production/Stable,
|
||||
*requires*: pytest (>=4.5.0)
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
:tocdepth: 3
|
||||
|
||||
.. _`api-reference`:
|
||||
|
||||
API Reference
|
||||
|
||||
@@ -2,7 +2,7 @@ pallets-sphinx-themes
|
||||
pluggy>=1.2.0
|
||||
pygments-pytest>=2.3.0
|
||||
sphinx-removed-in>=0.2.0
|
||||
sphinx>=5,<6
|
||||
sphinx>=5,<8
|
||||
sphinxcontrib-trio
|
||||
sphinxcontrib-svg2pdfconverter
|
||||
# Pin packaging because it no longer handles 'latest' version, which
|
||||
|
||||
@@ -31,16 +31,22 @@ class InvalidFeatureRelease(Exception):
|
||||
SLUG = "pytest-dev/pytest"
|
||||
|
||||
PR_BODY = """\
|
||||
Created by the [prepare release pr](https://github.com/pytest-dev/pytest/actions/workflows/prepare-release-pr.yml)
|
||||
workflow.
|
||||
Created by the [prepare release pr]\
|
||||
(https://github.com/pytest-dev/pytest/actions/workflows/prepare-release-pr.yml) workflow.
|
||||
|
||||
Once all builds pass and it has been **approved** by one or more maintainers,
|
||||
start the [deploy](https://github.com/pytest-dev/pytest/actions/workflows/deploy.yml) workflow, using these parameters:
|
||||
Once all builds pass and it has been **approved** by one or more maintainers, start the \
|
||||
[deploy](https://github.com/pytest-dev/pytest/actions/workflows/deploy.yml) workflow, using these parameters:
|
||||
|
||||
* `Use workflow from`: `release-{version}`.
|
||||
* `Release version`: `{version}`.
|
||||
|
||||
After the `deploy` workflow has been approved by a core maintainer, the package will be uploaded to PyPI automatically.
|
||||
Or execute on the command line:
|
||||
|
||||
```console
|
||||
gh workflow run deploy.yml -r release-{version} -f version={version}
|
||||
```
|
||||
|
||||
After the workflow has been approved by a core maintainer, the package will be uploaded to PyPI automatically.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import os
|
||||
import shutil
|
||||
import sys
|
||||
from typing import final
|
||||
from typing import Literal
|
||||
from typing import Optional
|
||||
from typing import Sequence
|
||||
from typing import TextIO
|
||||
@@ -193,15 +194,21 @@ class TerminalWriter:
|
||||
for indent, new_line in zip(indents, new_lines):
|
||||
self.line(indent + new_line)
|
||||
|
||||
def _highlight(self, source: str) -> str:
|
||||
"""Highlight the given source code if we have markup support."""
|
||||
def _highlight(
|
||||
self, source: str, lexer: Literal["diff", "python"] = "python"
|
||||
) -> str:
|
||||
"""Highlight the given source if we have markup support."""
|
||||
from _pytest.config.exceptions import UsageError
|
||||
|
||||
if not self.hasmarkup or not self.code_highlight:
|
||||
return source
|
||||
try:
|
||||
from pygments.formatters.terminal import TerminalFormatter
|
||||
from pygments.lexers.python import PythonLexer
|
||||
|
||||
if lexer == "python":
|
||||
from pygments.lexers.python import PythonLexer as Lexer
|
||||
elif lexer == "diff":
|
||||
from pygments.lexers.diff import DiffLexer as Lexer
|
||||
from pygments import highlight
|
||||
import pygments.util
|
||||
except ImportError:
|
||||
@@ -210,7 +217,7 @@ class TerminalWriter:
|
||||
try:
|
||||
highlighted: str = highlight(
|
||||
source,
|
||||
PythonLexer(),
|
||||
Lexer(),
|
||||
TerminalFormatter(
|
||||
bg=os.getenv("PYTEST_THEME_MODE", "dark"),
|
||||
style=os.getenv("PYTEST_THEME"),
|
||||
|
||||
@@ -755,7 +755,13 @@ class LocalPath:
|
||||
if ensure:
|
||||
self.dirpath().ensure(dir=1)
|
||||
if encoding:
|
||||
return error.checked_call(io.open, self.strpath, mode, encoding=encoding)
|
||||
# Using type ignore here because of this error:
|
||||
# error: Argument 1 has incompatible type overloaded function;
|
||||
# expected "Callable[[str, Any, Any], TextIOWrapper]" [arg-type]
|
||||
# Which seems incorrect, given io.open supports the given argument types.
|
||||
return error.checked_call(
|
||||
io.open, self.strpath, mode, encoding=encoding # type:ignore[arg-type]
|
||||
)
|
||||
return error.checked_call(open, self.strpath, mode)
|
||||
|
||||
def _fastjoin(self, name):
|
||||
@@ -1261,13 +1267,19 @@ class LocalPath:
|
||||
@classmethod
|
||||
def mkdtemp(cls, rootdir=None):
|
||||
"""Return a Path object pointing to a fresh new temporary directory
|
||||
(which we created ourself).
|
||||
(which we created ourselves).
|
||||
"""
|
||||
import tempfile
|
||||
|
||||
if rootdir is None:
|
||||
rootdir = cls.get_temproot()
|
||||
return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir)))
|
||||
# Using type ignore here because of this error:
|
||||
# error: Argument 1 has incompatible type overloaded function; expected "Callable[[str], str]" [arg-type]
|
||||
# Which seems incorrect, given tempfile.mkdtemp supports the given argument types.
|
||||
path = error.checked_call(
|
||||
tempfile.mkdtemp, dir=str(rootdir) # type:ignore[arg-type]
|
||||
)
|
||||
return cls(path)
|
||||
|
||||
@classmethod
|
||||
def make_numbered_dir(
|
||||
|
||||
@@ -7,8 +7,10 @@ from typing import Any
|
||||
from typing import Callable
|
||||
from typing import Iterable
|
||||
from typing import List
|
||||
from typing import Literal
|
||||
from typing import Mapping
|
||||
from typing import Optional
|
||||
from typing import Protocol
|
||||
from typing import Sequence
|
||||
from unicodedata import normalize
|
||||
|
||||
@@ -33,6 +35,11 @@ _assertion_pass: Optional[Callable[[int, str, str], None]] = None
|
||||
_config: Optional[Config] = None
|
||||
|
||||
|
||||
class _HighlightFunc(Protocol):
|
||||
def __call__(self, source: str, lexer: Literal["diff", "python"] = "python") -> str:
|
||||
"""Apply highlighting to the given source."""
|
||||
|
||||
|
||||
def format_explanation(explanation: str) -> str:
|
||||
r"""Format an explanation.
|
||||
|
||||
@@ -189,7 +196,8 @@ def assertrepr_compare(
|
||||
explanation = None
|
||||
try:
|
||||
if op == "==":
|
||||
explanation = _compare_eq_any(left, right, verbose)
|
||||
writer = config.get_terminal_writer()
|
||||
explanation = _compare_eq_any(left, right, writer._highlight, verbose)
|
||||
elif op == "not in":
|
||||
if istext(left) and istext(right):
|
||||
explanation = _notin_text(left, right, verbose)
|
||||
@@ -225,7 +233,9 @@ def assertrepr_compare(
|
||||
return [summary] + explanation
|
||||
|
||||
|
||||
def _compare_eq_any(left: Any, right: Any, verbose: int = 0) -> List[str]:
|
||||
def _compare_eq_any(
|
||||
left: Any, right: Any, highlighter: _HighlightFunc, verbose: int = 0
|
||||
) -> List[str]:
|
||||
explanation = []
|
||||
if istext(left) and istext(right):
|
||||
explanation = _diff_text(left, right, verbose)
|
||||
@@ -245,7 +255,7 @@ def _compare_eq_any(left: Any, right: Any, verbose: int = 0) -> List[str]:
|
||||
# field values, not the type or field names. But this branch
|
||||
# intentionally only handles the same-type case, which was often
|
||||
# used in older code bases before dataclasses/attrs were available.
|
||||
explanation = _compare_eq_cls(left, right, verbose)
|
||||
explanation = _compare_eq_cls(left, right, highlighter, verbose)
|
||||
elif issequence(left) and issequence(right):
|
||||
explanation = _compare_eq_sequence(left, right, verbose)
|
||||
elif isset(left) and isset(right):
|
||||
@@ -254,7 +264,7 @@ def _compare_eq_any(left: Any, right: Any, verbose: int = 0) -> List[str]:
|
||||
explanation = _compare_eq_dict(left, right, verbose)
|
||||
|
||||
if isiterable(left) and isiterable(right):
|
||||
expl = _compare_eq_iterable(left, right, verbose)
|
||||
expl = _compare_eq_iterable(left, right, highlighter, verbose)
|
||||
explanation.extend(expl)
|
||||
|
||||
return explanation
|
||||
@@ -321,7 +331,10 @@ def _surrounding_parens_on_own_lines(lines: List[str]) -> None:
|
||||
|
||||
|
||||
def _compare_eq_iterable(
|
||||
left: Iterable[Any], right: Iterable[Any], verbose: int = 0
|
||||
left: Iterable[Any],
|
||||
right: Iterable[Any],
|
||||
highligher: _HighlightFunc,
|
||||
verbose: int = 0,
|
||||
) -> List[str]:
|
||||
if verbose <= 0 and not running_on_ci():
|
||||
return ["Use -v to get more diff"]
|
||||
@@ -346,7 +359,13 @@ def _compare_eq_iterable(
|
||||
# "right" is the expected base against which we compare "left",
|
||||
# see https://github.com/pytest-dev/pytest/issues/3333
|
||||
explanation.extend(
|
||||
line.rstrip() for line in difflib.ndiff(right_formatting, left_formatting)
|
||||
highligher(
|
||||
"\n".join(
|
||||
line.rstrip()
|
||||
for line in difflib.ndiff(right_formatting, left_formatting)
|
||||
),
|
||||
lexer="diff",
|
||||
).splitlines()
|
||||
)
|
||||
return explanation
|
||||
|
||||
@@ -496,7 +515,9 @@ def _compare_eq_dict(
|
||||
return explanation
|
||||
|
||||
|
||||
def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]:
|
||||
def _compare_eq_cls(
|
||||
left: Any, right: Any, highlighter: _HighlightFunc, verbose: int
|
||||
) -> List[str]:
|
||||
if not has_default_eq(left):
|
||||
return []
|
||||
if isdatacls(left):
|
||||
@@ -542,7 +563,9 @@ def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]:
|
||||
]
|
||||
explanation += [
|
||||
indent + line
|
||||
for line in _compare_eq_any(field_left, field_right, verbose)
|
||||
for line in _compare_eq_any(
|
||||
field_left, field_right, highlighter, verbose
|
||||
)
|
||||
]
|
||||
return explanation
|
||||
|
||||
|
||||
@@ -1003,7 +1003,7 @@ class IdMaker:
|
||||
for index, id in enumerate(resolved_ids):
|
||||
if id_counts[id] > 1:
|
||||
suffix = ""
|
||||
if id[-1].isdigit():
|
||||
if id and id[-1].isdigit():
|
||||
suffix = "_"
|
||||
new_id = f"{id}{suffix}{id_suffixes[id]}"
|
||||
while new_id in set(resolved_ids):
|
||||
|
||||
@@ -878,8 +878,10 @@ class TerminalReporter:
|
||||
def pytest_terminal_summary(self) -> Generator[None, None, None]:
|
||||
self.summary_errors()
|
||||
self.summary_failures()
|
||||
self.summary_xfailures()
|
||||
self.summary_warnings()
|
||||
self.summary_passes()
|
||||
self.summary_xpasses()
|
||||
try:
|
||||
return (yield)
|
||||
finally:
|
||||
@@ -1022,6 +1024,20 @@ class TerminalReporter:
|
||||
self._outrep_summary(rep)
|
||||
self._handle_teardown_sections(rep.nodeid)
|
||||
|
||||
def summary_xpasses(self) -> None:
|
||||
if self.config.option.tbstyle != "no":
|
||||
if self.hasopt("X"):
|
||||
reports: List[TestReport] = self.getreports("xpassed")
|
||||
if not reports:
|
||||
return
|
||||
self.write_sep("=", "XPASSES")
|
||||
for rep in reports:
|
||||
if rep.sections:
|
||||
msg = self._getfailureheadline(rep)
|
||||
self.write_sep("_", msg, green=True, bold=True)
|
||||
self._outrep_summary(rep)
|
||||
self._handle_teardown_sections(rep.nodeid)
|
||||
|
||||
def _get_teardown_reports(self, nodeid: str) -> List[TestReport]:
|
||||
reports = self.getreports("")
|
||||
return [
|
||||
@@ -1064,6 +1080,24 @@ class TerminalReporter:
|
||||
self._outrep_summary(rep)
|
||||
self._handle_teardown_sections(rep.nodeid)
|
||||
|
||||
def summary_xfailures(self) -> None:
|
||||
if self.config.option.tbstyle != "no":
|
||||
if self.hasopt("x"):
|
||||
reports: List[BaseReport] = self.getreports("xfailed")
|
||||
if not reports:
|
||||
return
|
||||
self.write_sep("=", "XFAILURES")
|
||||
if self.config.option.tbstyle == "line":
|
||||
for rep in reports:
|
||||
line = self._getcrashline(rep)
|
||||
self.write_line(line)
|
||||
else:
|
||||
for rep in reports:
|
||||
msg = self._getfailureheadline(rep)
|
||||
self.write_sep("_", msg, red=True, bold=True)
|
||||
self._outrep_summary(rep)
|
||||
self._handle_teardown_sections(rep.nodeid)
|
||||
|
||||
def summary_errors(self) -> None:
|
||||
if self.config.option.tbstyle != "no":
|
||||
reports: List[BaseReport] = self.getreports("error")
|
||||
@@ -1152,12 +1186,13 @@ class TerminalReporter:
|
||||
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}"
|
||||
color = _color_for_type.get("xfailed", _color_for_type_default)
|
||||
line = _get_line_with_reprcrash_message(
|
||||
self.config, rep, self._tw, {color: True}
|
||||
)
|
||||
reason = rep.wasxfail
|
||||
if reason:
|
||||
line += " - " + str(reason)
|
||||
|
||||
lines.append(line)
|
||||
|
||||
def show_xpassed(lines: List[str]) -> None:
|
||||
@@ -1168,8 +1203,11 @@ class TerminalReporter:
|
||||
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
|
||||
lines.append(f"{markup_word} {nodeid} {reason}")
|
||||
if reason:
|
||||
line += " - " + str(reason)
|
||||
lines.append(line)
|
||||
|
||||
def show_skipped(lines: List[str]) -> None:
|
||||
skipped: List[CollectReport] = self.stats.get("skipped", [])
|
||||
|
||||
21
test_xfail.py
Normal file
21
test_xfail.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import pytest
|
||||
|
||||
def test_pass():
|
||||
...
|
||||
|
||||
|
||||
def test_fail():
|
||||
a,b = 1,2
|
||||
assert a == b
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_xfail():
|
||||
a,b = 1,2
|
||||
assert a == b
|
||||
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_xpass():
|
||||
a,b = 1,1
|
||||
assert a == b
|
||||
|
||||
@@ -160,6 +160,9 @@ def color_mapping():
|
||||
"red": "\x1b[31m",
|
||||
"green": "\x1b[32m",
|
||||
"yellow": "\x1b[33m",
|
||||
"light-gray": "\x1b[90m",
|
||||
"light-red": "\x1b[91m",
|
||||
"light-green": "\x1b[92m",
|
||||
"bold": "\x1b[1m",
|
||||
"reset": "\x1b[0m",
|
||||
"kw": "\x1b[94m",
|
||||
@@ -171,6 +174,7 @@ def color_mapping():
|
||||
"endline": "\x1b[90m\x1b[39;49;00m",
|
||||
}
|
||||
RE_COLORS = {k: re.escape(v) for k, v in COLORS.items()}
|
||||
NO_COLORS = {k: "" for k in COLORS.keys()}
|
||||
|
||||
@classmethod
|
||||
def format(cls, lines: List[str]) -> List[str]:
|
||||
@@ -187,6 +191,11 @@ def color_mapping():
|
||||
"""Replace color names for use with LineMatcher.re_match_lines"""
|
||||
return [line.format(**cls.RE_COLORS) for line in lines]
|
||||
|
||||
@classmethod
|
||||
def strip_colors(cls, lines: List[str]) -> List[str]:
|
||||
"""Entirely remove every color code"""
|
||||
return [line.format(**cls.NO_COLORS) for line in lines]
|
||||
|
||||
return ColorMapping
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# mypy: disable-error-code="attr-defined"
|
||||
# mypy: disallow-untyped-defs
|
||||
import logging
|
||||
from typing import Iterator
|
||||
|
||||
import pytest
|
||||
from _pytest.logging import caplog_records_key
|
||||
@@ -9,8 +11,8 @@ logger = logging.getLogger(__name__)
|
||||
sublogger = logging.getLogger(__name__ + ".baz")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def cleanup_disabled_logging():
|
||||
@pytest.fixture(autouse=True)
|
||||
def cleanup_disabled_logging() -> Iterator[None]:
|
||||
"""Simple fixture that ensures that a test doesn't disable logging.
|
||||
|
||||
This is necessary because ``logging.disable()`` is global, so a test disabling logging
|
||||
@@ -27,7 +29,7 @@ def test_fixture_help(pytester: Pytester) -> None:
|
||||
result.stdout.fnmatch_lines(["*caplog*"])
|
||||
|
||||
|
||||
def test_change_level(caplog):
|
||||
def test_change_level(caplog: pytest.LogCaptureFixture) -> None:
|
||||
caplog.set_level(logging.INFO)
|
||||
logger.debug("handler DEBUG level")
|
||||
logger.info("handler INFO level")
|
||||
@@ -42,7 +44,7 @@ def test_change_level(caplog):
|
||||
assert "CRITICAL" in caplog.text
|
||||
|
||||
|
||||
def test_change_level_logging_disabled(caplog, cleanup_disabled_logging):
|
||||
def test_change_level_logging_disabled(caplog: pytest.LogCaptureFixture) -> None:
|
||||
logging.disable(logging.CRITICAL)
|
||||
assert logging.root.manager.disable == logging.CRITICAL
|
||||
caplog.set_level(logging.WARNING)
|
||||
@@ -85,9 +87,7 @@ def test_change_level_undo(pytester: Pytester) -> None:
|
||||
result.stdout.no_fnmatch_line("*log from test2*")
|
||||
|
||||
|
||||
def test_change_disabled_level_undo(
|
||||
pytester: Pytester, cleanup_disabled_logging
|
||||
) -> None:
|
||||
def test_change_disabled_level_undo(pytester: Pytester) -> None:
|
||||
"""Ensure that '_force_enable_logging' in 'set_level' is undone after the end of the test.
|
||||
|
||||
Tests the logging output themselves (affected by disabled logging level).
|
||||
@@ -144,7 +144,7 @@ def test_change_level_undos_handler_level(pytester: Pytester) -> None:
|
||||
result.assert_outcomes(passed=3)
|
||||
|
||||
|
||||
def test_with_statement(caplog):
|
||||
def test_with_statement(caplog: pytest.LogCaptureFixture) -> None:
|
||||
with caplog.at_level(logging.INFO):
|
||||
logger.debug("handler DEBUG level")
|
||||
logger.info("handler INFO level")
|
||||
@@ -159,7 +159,7 @@ def test_with_statement(caplog):
|
||||
assert "CRITICAL" in caplog.text
|
||||
|
||||
|
||||
def test_with_statement_logging_disabled(caplog, cleanup_disabled_logging):
|
||||
def test_with_statement_logging_disabled(caplog: pytest.LogCaptureFixture) -> None:
|
||||
logging.disable(logging.CRITICAL)
|
||||
assert logging.root.manager.disable == logging.CRITICAL
|
||||
with caplog.at_level(logging.WARNING):
|
||||
@@ -198,8 +198,8 @@ def test_with_statement_logging_disabled(caplog, cleanup_disabled_logging):
|
||||
],
|
||||
)
|
||||
def test_force_enable_logging_level_string(
|
||||
caplog, cleanup_disabled_logging, level_str, expected_disable_level
|
||||
):
|
||||
caplog: pytest.LogCaptureFixture, level_str: str, expected_disable_level: int
|
||||
) -> None:
|
||||
"""Test _force_enable_logging using a level string.
|
||||
|
||||
``expected_disable_level`` is one level below ``level_str`` because the disabled log level
|
||||
@@ -218,7 +218,7 @@ def test_force_enable_logging_level_string(
|
||||
assert test_logger.manager.disable == expected_disable_level
|
||||
|
||||
|
||||
def test_log_access(caplog):
|
||||
def test_log_access(caplog: pytest.LogCaptureFixture) -> None:
|
||||
caplog.set_level(logging.INFO)
|
||||
logger.info("boo %s", "arg")
|
||||
assert caplog.records[0].levelname == "INFO"
|
||||
@@ -226,7 +226,7 @@ def test_log_access(caplog):
|
||||
assert "boo arg" in caplog.text
|
||||
|
||||
|
||||
def test_messages(caplog):
|
||||
def test_messages(caplog: pytest.LogCaptureFixture) -> None:
|
||||
caplog.set_level(logging.INFO)
|
||||
logger.info("boo %s", "arg")
|
||||
logger.info("bar %s\nbaz %s", "arg1", "arg2")
|
||||
@@ -247,14 +247,14 @@ def test_messages(caplog):
|
||||
assert "Exception" not in caplog.messages[-1]
|
||||
|
||||
|
||||
def test_record_tuples(caplog):
|
||||
def test_record_tuples(caplog: pytest.LogCaptureFixture) -> None:
|
||||
caplog.set_level(logging.INFO)
|
||||
logger.info("boo %s", "arg")
|
||||
|
||||
assert caplog.record_tuples == [(__name__, logging.INFO, "boo arg")]
|
||||
|
||||
|
||||
def test_unicode(caplog):
|
||||
def test_unicode(caplog: pytest.LogCaptureFixture) -> None:
|
||||
caplog.set_level(logging.INFO)
|
||||
logger.info("bū")
|
||||
assert caplog.records[0].levelname == "INFO"
|
||||
@@ -262,7 +262,7 @@ def test_unicode(caplog):
|
||||
assert "bū" in caplog.text
|
||||
|
||||
|
||||
def test_clear(caplog):
|
||||
def test_clear(caplog: pytest.LogCaptureFixture) -> None:
|
||||
caplog.set_level(logging.INFO)
|
||||
logger.info("bū")
|
||||
assert len(caplog.records)
|
||||
@@ -273,7 +273,9 @@ def test_clear(caplog):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def logging_during_setup_and_teardown(caplog):
|
||||
def logging_during_setup_and_teardown(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> Iterator[None]:
|
||||
caplog.set_level("INFO")
|
||||
logger.info("a_setup_log")
|
||||
yield
|
||||
@@ -281,7 +283,9 @@ def logging_during_setup_and_teardown(caplog):
|
||||
assert [x.message for x in caplog.get_records("teardown")] == ["a_teardown_log"]
|
||||
|
||||
|
||||
def test_caplog_captures_for_all_stages(caplog, logging_during_setup_and_teardown):
|
||||
def test_caplog_captures_for_all_stages(
|
||||
caplog: pytest.LogCaptureFixture, logging_during_setup_and_teardown: None
|
||||
) -> None:
|
||||
assert not caplog.records
|
||||
assert not caplog.get_records("call")
|
||||
logger.info("a_call_log")
|
||||
@@ -290,25 +294,31 @@ def test_caplog_captures_for_all_stages(caplog, logging_during_setup_and_teardow
|
||||
assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"]
|
||||
|
||||
# This reaches into private API, don't use this type of thing in real tests!
|
||||
assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"}
|
||||
caplog_records = caplog._item.stash[caplog_records_key]
|
||||
assert set(caplog_records) == {"setup", "call"}
|
||||
|
||||
|
||||
def test_clear_for_call_stage(caplog, logging_during_setup_and_teardown):
|
||||
def test_clear_for_call_stage(
|
||||
caplog: pytest.LogCaptureFixture, logging_during_setup_and_teardown: None
|
||||
) -> None:
|
||||
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_records = caplog._item.stash[caplog_records_key]
|
||||
assert set(caplog_records) == {"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"}
|
||||
caplog_records = caplog._item.stash[caplog_records_key]
|
||||
assert set(caplog_records) == {"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"}
|
||||
caplog_records = caplog._item.stash[caplog_records_key]
|
||||
assert set(caplog_records) == {"setup", "call"}
|
||||
|
||||
|
||||
def test_ini_controls_global_log_level(pytester: Pytester) -> None:
|
||||
|
||||
@@ -6,7 +6,7 @@ pytest-cov==4.1.0
|
||||
pytest-django==4.5.2
|
||||
pytest-flakes==4.0.5
|
||||
pytest-html==4.0.2
|
||||
pytest-mock==3.11.1
|
||||
pytest-mock==3.12.0
|
||||
pytest-rerunfailures==12.0
|
||||
pytest-sugar==0.9.7
|
||||
pytest-trio==0.7.0
|
||||
|
||||
@@ -626,6 +626,13 @@ class TestMetafunc:
|
||||
).make_unique_parameterset_ids()
|
||||
assert result == [expected]
|
||||
|
||||
def test_idmaker_duplicated_empty_str(self) -> None:
|
||||
"""Regression test for empty strings parametrized more than once (#11563)."""
|
||||
result = IdMaker(
|
||||
("a",), [pytest.param(""), pytest.param("")], None, None, None, None, None
|
||||
).make_unique_parameterset_ids()
|
||||
assert result == ["0", "1"]
|
||||
|
||||
def test_parametrize_ids_exception(self, pytester: Pytester) -> None:
|
||||
"""
|
||||
:param pytester: the instance of Pytester class, a temporary
|
||||
|
||||
@@ -18,12 +18,19 @@ from _pytest.pytester import Pytester
|
||||
|
||||
|
||||
def mock_config(verbose=0):
|
||||
class TerminalWriter:
|
||||
def _highlight(self, source, lexer):
|
||||
return source
|
||||
|
||||
class Config:
|
||||
def getoption(self, name):
|
||||
if name == "verbose":
|
||||
return verbose
|
||||
raise KeyError("Not mocked out: %s" % name)
|
||||
|
||||
def get_terminal_writer(self):
|
||||
return TerminalWriter()
|
||||
|
||||
return Config()
|
||||
|
||||
|
||||
@@ -1784,3 +1791,48 @@ def test_reprcompare_verbose_long() -> None:
|
||||
"{'v0': 0, 'v1': 1, 'v2': 12, 'v3': 3, 'v4': 4, 'v5': 5, "
|
||||
"'v6': 6, 'v7': 7, 'v8': 8, 'v9': 9, 'v10': 10}"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("enable_colors", [True, False])
|
||||
@pytest.mark.parametrize(
|
||||
("test_code", "expected_lines"),
|
||||
(
|
||||
(
|
||||
"""
|
||||
def test():
|
||||
assert [0, 1] == [0, 2]
|
||||
""",
|
||||
[
|
||||
"{bold}{red}E {light-red}- [0, 2]{hl-reset}{endline}{reset}",
|
||||
"{bold}{red}E {light-green}+ [0, 1]{hl-reset}{endline}{reset}",
|
||||
],
|
||||
),
|
||||
(
|
||||
"""
|
||||
def test():
|
||||
assert {f"number-is-{i}": i for i in range(1, 6)} == {
|
||||
f"number-is-{i}": i for i in range(5)
|
||||
}
|
||||
""",
|
||||
[
|
||||
"{bold}{red}E {light-gray} {hl-reset} {{{endline}{reset}",
|
||||
"{bold}{red}E {light-gray} {hl-reset} 'number-is-1': 1,{endline}{reset}",
|
||||
"{bold}{red}E {light-green}+ 'number-is-5': 5,{hl-reset}{endline}{reset}",
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
def test_comparisons_handle_colors(
|
||||
pytester: Pytester, color_mapping, enable_colors, test_code, expected_lines
|
||||
) -> None:
|
||||
p = pytester.makepyfile(test_code)
|
||||
result = pytester.runpytest(
|
||||
f"--color={'yes' if enable_colors else 'no'}", "-vv", str(p)
|
||||
)
|
||||
formatter = (
|
||||
color_mapping.format_for_fnmatch
|
||||
if enable_colors
|
||||
else color_mapping.strip_colors
|
||||
)
|
||||
|
||||
result.stdout.fnmatch_lines(formatter(expected_lines), consecutive=False)
|
||||
|
||||
@@ -2614,3 +2614,117 @@ def test_format_trimmed() -> None:
|
||||
|
||||
assert _format_trimmed(" ({}) ", msg, len(msg) + 4) == " (unconditional skip) "
|
||||
assert _format_trimmed(" ({}) ", msg, len(msg) + 3) == " (unconditional ...) "
|
||||
|
||||
|
||||
def test_summary_xfail_reason(pytester: Pytester) -> None:
|
||||
pytester.makepyfile(
|
||||
"""
|
||||
import pytest
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_xfail():
|
||||
assert False
|
||||
|
||||
@pytest.mark.xfail(reason="foo")
|
||||
def test_xfail_reason():
|
||||
assert False
|
||||
"""
|
||||
)
|
||||
result = pytester.runpytest("-rx")
|
||||
expect1 = "XFAIL test_summary_xfail_reason.py::test_xfail - assert False"
|
||||
expect2 = "XFAIL test_summary_xfail_reason.py::test_xfail_reason - assert False - foo"
|
||||
result.stdout.fnmatch_lines([expect1, expect2])
|
||||
assert result.stdout.lines.count(expect1) == 1
|
||||
assert result.stdout.lines.count(expect2) == 1
|
||||
|
||||
|
||||
def test_summary_xfail_tb(pytester: Pytester) -> None:
|
||||
pytester.makepyfile(
|
||||
"""
|
||||
import pytest
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_xfail():
|
||||
a, b = 1, 2
|
||||
assert a == b
|
||||
"""
|
||||
)
|
||||
result = pytester.runpytest("-rx")
|
||||
result.stdout.fnmatch_lines( [
|
||||
"*= XFAILURES =*",
|
||||
"*_ test_xfail _*",
|
||||
"* @pytest.mark.xfail*",
|
||||
"* def test_xfail():*",
|
||||
"* a, b = 1, 2*",
|
||||
"> *assert a == b*",
|
||||
"E *assert 1 == 2*",
|
||||
"test_summary_xfail_tb.py:6: AssertionError*",
|
||||
"*= short test summary info =*",
|
||||
"XFAIL test_summary_xfail_tb.py::test_xfail - assert 1 == 2",
|
||||
"*= 1 xfailed in * =*"
|
||||
])
|
||||
|
||||
|
||||
def test_xfail_tb_line(pytester: Pytester) -> None:
|
||||
pytester.makepyfile(
|
||||
"""
|
||||
import pytest
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_xfail():
|
||||
a, b = 1, 2
|
||||
assert a == b
|
||||
"""
|
||||
)
|
||||
result = pytester.runpytest("-rx", "--tb=line")
|
||||
result.stdout.fnmatch_lines( [
|
||||
"*= XFAILURES =*",
|
||||
"*test_xfail_tb_line.py:6: assert 1 == 2",
|
||||
"*= short test summary info =*",
|
||||
"XFAIL test_xfail_tb_line.py::test_xfail - assert 1 == 2",
|
||||
"*= 1 xfailed in * =*"
|
||||
])
|
||||
|
||||
|
||||
def test_summary_xpass_reason(pytester: Pytester) -> None:
|
||||
pytester.makepyfile(
|
||||
"""
|
||||
import pytest
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_pass():
|
||||
...
|
||||
|
||||
@pytest.mark.xfail(reason="foo")
|
||||
def test_reason():
|
||||
...
|
||||
"""
|
||||
)
|
||||
result = pytester.runpytest("-rX")
|
||||
expect1 = "XPASS test_summary_xpass_reason.py::test_pass"
|
||||
expect2 = "XPASS test_summary_xpass_reason.py::test_reason - foo"
|
||||
result.stdout.fnmatch_lines([expect1, expect2])
|
||||
assert result.stdout.lines.count(expect1) == 1
|
||||
assert result.stdout.lines.count(expect2) == 1
|
||||
|
||||
|
||||
def test_xpass_output(pytester: Pytester) -> None:
|
||||
pytester.makepyfile(
|
||||
"""
|
||||
import pytest
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_pass():
|
||||
print('hi there')
|
||||
"""
|
||||
)
|
||||
result = pytester.runpytest("-rX")
|
||||
result.stdout.fnmatch_lines( [
|
||||
"*= XPASSES =*",
|
||||
"*_ test_pass _*",
|
||||
"*- Captured stdout call -*",
|
||||
"*= short test summary info =*",
|
||||
"XPASS test_xpass_output.py::test_pass",
|
||||
"*= 1 xpassed in * =*"
|
||||
])
|
||||
|
||||
|
||||
6
venv/pyvenv.cfg
Normal file
6
venv/pyvenv.cfg
Normal file
@@ -0,0 +1,6 @@
|
||||
home = /Library/Frameworks/Python.framework/Versions/3.11/bin
|
||||
include-system-site-packages = false
|
||||
version = 3.11.5
|
||||
prompt = 'pytest'
|
||||
executable = /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
|
||||
command = /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m venv --prompt="." /Users/okken/projects/pytest/venv
|
||||
3
xfail/pyproject.toml
Normal file
3
xfail/pyproject.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "-ra --strict-markers"
|
||||
#xfail_strict = true
|
||||
30
xfail/test_xfail.py
Normal file
30
xfail/test_xfail.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import pytest
|
||||
|
||||
def test_pass():
|
||||
print('in test_pass')
|
||||
|
||||
|
||||
def test_fail():
|
||||
print('in test_fail')
|
||||
a,b = 1,2
|
||||
assert a == b
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_xfail():
|
||||
print('in test_xfail')
|
||||
a,b = 1,2
|
||||
assert a == b
|
||||
|
||||
@pytest.mark.xfail(reason="reason 1")
|
||||
def test_xfail_reason():
|
||||
print('in test_xfail')
|
||||
a,b = 1,2
|
||||
assert a == b
|
||||
|
||||
|
||||
@pytest.mark.xfail(reason="reason 2")
|
||||
def test_xpass():
|
||||
print('in test_xpass')
|
||||
a,b = 1,1
|
||||
assert a == b
|
||||
|
||||
Reference in New Issue
Block a user