| 1 |
Metadata-Version: 2.4 |
| 2 |
Name: pytest |
| 3 |
Version: 9.0.3 |
| 4 |
Summary: pytest: simple powerful testing with Python |
| 5 |
Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Freya Bruhin, Others (See AUTHORS) |
| 6 |
License-Expression: MIT |
| 7 |
Project-URL: Changelog, https://docs.pytest.org/en/stable/changelog.html |
| 8 |
Project-URL: Contact, https://docs.pytest.org/en/stable/contact.html |
| 9 |
Project-URL: Funding, https://docs.pytest.org/en/stable/sponsor.html |
| 10 |
Project-URL: Homepage, https://docs.pytest.org/en/latest/ |
| 11 |
Project-URL: Source, https://github.com/pytest-dev/pytest |
| 12 |
Project-URL: Tracker, https://github.com/pytest-dev/pytest/issues |
| 13 |
Keywords: test,unittest |
| 14 |
Classifier: Development Status :: 6 - Mature |
| 15 |
Classifier: Intended Audience :: Developers |
| 16 |
Classifier: Operating System :: MacOS |
| 17 |
Classifier: Operating System :: Microsoft :: Windows |
| 18 |
Classifier: Operating System :: POSIX |
| 19 |
Classifier: Operating System :: Unix |
| 20 |
Classifier: Programming Language :: Python :: 3 :: Only |
| 21 |
Classifier: Programming Language :: Python :: 3.10 |
| 22 |
Classifier: Programming Language :: Python :: 3.11 |
| 23 |
Classifier: Programming Language :: Python :: 3.12 |
| 24 |
Classifier: Programming Language :: Python :: 3.13 |
| 25 |
Classifier: Programming Language :: Python :: 3.14 |
| 26 |
Classifier: Topic :: Software Development :: Libraries |
| 27 |
Classifier: Topic :: Software Development :: Testing |
| 28 |
Classifier: Topic :: Utilities |
| 29 |
Requires-Python: >=3.10 |
| 30 |
Description-Content-Type: text/x-rst |
| 31 |
License-File: LICENSE |
| 32 |
Requires-Dist: colorama>=0.4; sys_platform == "win32" |
| 33 |
Requires-Dist: exceptiongroup>=1; python_version < "3.11" |
| 34 |
Requires-Dist: iniconfig>=1.0.1 |
| 35 |
Requires-Dist: packaging>=22 |
| 36 |
Requires-Dist: pluggy<2,>=1.5 |
| 37 |
Requires-Dist: pygments>=2.7.2 |
| 38 |
Requires-Dist: tomli>=1; python_version < "3.11" |
| 39 |
Provides-Extra: dev |
| 40 |
Requires-Dist: argcomplete; extra == "dev" |
| 41 |
Requires-Dist: attrs>=19.2; extra == "dev" |
| 42 |
Requires-Dist: hypothesis>=3.56; extra == "dev" |
| 43 |
Requires-Dist: mock; extra == "dev" |
| 44 |
Requires-Dist: requests; extra == "dev" |
| 45 |
Requires-Dist: setuptools; extra == "dev" |
| 46 |
Requires-Dist: xmlschema; extra == "dev" |
| 47 |
Dynamic: license-file |
| 48 |
|
| 49 |
.. image:: https://github.com/pytest-dev/pytest/raw/main/doc/en/img/pytest_logo_curves.svg |
| 50 |
:target: https://docs.pytest.org/en/stable/ |
| 51 |
:align: center |
| 52 |
:height: 200 |
| 53 |
:alt: pytest |
| 54 |
|
| 55 |
|
| 56 |
------ |
| 57 |
|
| 58 |
.. image:: https://img.shields.io/pypi/v/pytest.svg |
| 59 |
:target: https://pypi.org/project/pytest/ |
| 60 |
|
| 61 |
.. image:: https://img.shields.io/conda/vn/conda-forge/pytest.svg |
| 62 |
:target: https://anaconda.org/conda-forge/pytest |
| 63 |
|
| 64 |
.. image:: https://img.shields.io/pypi/pyversions/pytest.svg |
| 65 |
:target: https://pypi.org/project/pytest/ |
| 66 |
|
| 67 |
.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/main/graph/badge.svg |
| 68 |
:target: https://codecov.io/gh/pytest-dev/pytest |
| 69 |
:alt: Code coverage Status |
| 70 |
|
| 71 |
.. image:: https://github.com/pytest-dev/pytest/actions/workflows/test.yml/badge.svg |
| 72 |
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest |
| 73 |
|
| 74 |
.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg |
| 75 |
:target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main |
| 76 |
:alt: pre-commit.ci status |
| 77 |
|
| 78 |
.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg |
| 79 |
:target: https://www.codetriage.com/pytest-dev/pytest |
| 80 |
|
| 81 |
.. image:: https://readthedocs.org/projects/pytest/badge/?version=latest |
| 82 |
:target: https://pytest.readthedocs.io/en/latest/?badge=latest |
| 83 |
:alt: Documentation Status |
| 84 |
|
| 85 |
.. image:: https://img.shields.io/badge/Discord-pytest--dev-blue |
| 86 |
:target: https://discord.com/invite/pytest-dev |
| 87 |
:alt: Discord |
| 88 |
|
| 89 |
.. image:: https://img.shields.io/badge/Libera%20chat-%23pytest-orange |
| 90 |
:target: https://web.libera.chat/#pytest |
| 91 |
:alt: Libera chat |
| 92 |
|
| 93 |
|
| 94 |
The ``pytest`` framework makes it easy to write small tests, yet |
| 95 |
scales to support complex functional testing for applications and libraries. |
| 96 |
|
| 97 |
An example of a simple test: |
| 98 |
|
| 99 |
.. code-block:: python |
| 100 |
|
| 101 |
# content of test_sample.py |
| 102 |
def inc(x): |
| 103 |
return x + 1 |
| 104 |
|
| 105 |
|
| 106 |
def test_answer(): |
| 107 |
assert inc(3) == 5 |
| 108 |
|
| 109 |
|
| 110 |
To execute it:: |
| 111 |
|
| 112 |
$ pytest |
| 113 |
============================= test session starts ============================= |
| 114 |
collected 1 items |
| 115 |
|
| 116 |
test_sample.py F |
| 117 |
|
| 118 |
================================== FAILURES =================================== |
| 119 |
_________________________________ test_answer _________________________________ |
| 120 |
|
| 121 |
def test_answer(): |
| 122 |
> assert inc(3) == 5 |
| 123 |
E assert 4 == 5 |
| 124 |
E + where 4 = inc(3) |
| 125 |
|
| 126 |
test_sample.py:5: AssertionError |
| 127 |
========================== 1 failed in 0.04 seconds =========================== |
| 128 |
|
| 129 |
|
| 130 |
Thanks to ``pytest``'s detailed assertion introspection, you can simply use plain ``assert`` statements. See `getting-started <https://docs.pytest.org/en/stable/getting-started.html#our-first-test-run>`_ for more examples. |
| 131 |
|
| 132 |
|
| 133 |
Features |
| 134 |
-------- |
| 135 |
|
| 136 |
- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/how-to/assert.html>`_ (no need to remember ``self.assert*`` names) |
| 137 |
|
| 138 |
- `Auto-discovery |
| 139 |
<https://docs.pytest.org/en/stable/explanation/goodpractices.html#python-test-discovery>`_ |
| 140 |
of test modules and functions |
| 141 |
|
| 142 |
- `Modular fixtures <https://docs.pytest.org/en/stable/explanation/fixtures.html>`_ for |
| 143 |
managing small or parametrized long-lived test resources |
| 144 |
|
| 145 |
- Can run `unittest <https://docs.pytest.org/en/stable/how-to/unittest.html>`_ (or trial) |
| 146 |
test suites out of the box |
| 147 |
|
| 148 |
- Python 3.10+ or PyPy3 |
| 149 |
|
| 150 |
- Rich plugin architecture, with over 1300+ `external plugins <https://docs.pytest.org/en/latest/reference/plugin_list.html>`_ and thriving community |
| 151 |
|
| 152 |
|
| 153 |
Documentation |
| 154 |
------------- |
| 155 |
|
| 156 |
For full documentation, including installation, tutorials and PDF documents, please see https://docs.pytest.org/en/stable/. |
| 157 |
|
| 158 |
|
| 159 |
Bugs/Requests |
| 160 |
------------- |
| 161 |
|
| 162 |
Please use the `GitHub issue tracker <https://github.com/pytest-dev/pytest/issues>`_ to submit bugs or request features. |
| 163 |
|
| 164 |
|
| 165 |
Changelog |
| 166 |
--------- |
| 167 |
|
| 168 |
Consult the `Changelog <https://docs.pytest.org/en/stable/changelog.html>`__ page for fixes and enhancements of each version. |
| 169 |
|
| 170 |
|
| 171 |
Support pytest |
| 172 |
-------------- |
| 173 |
|
| 174 |
`Open Collective`_ is an online funding platform for open and transparent communities. |
| 175 |
It provides tools to raise money and share your finances in full transparency. |
| 176 |
|
| 177 |
It is the platform of choice for individuals and companies that want to make one-time or |
| 178 |
monthly donations directly to the project. |
| 179 |
|
| 180 |
See more details in the `pytest collective`_. |
| 181 |
|
| 182 |
.. _Open Collective: https://opencollective.com |
| 183 |
.. _pytest collective: https://opencollective.com/pytest |
| 184 |
|
| 185 |
|
| 186 |
pytest for enterprise |
| 187 |
--------------------- |
| 188 |
|
| 189 |
Available as part of the Tidelift Subscription. |
| 190 |
|
| 191 |
The maintainers of pytest and thousands of other packages are working with Tidelift to deliver commercial support and |
| 192 |
maintenance for the open source dependencies you use to build your applications. |
| 193 |
Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. |
| 194 |
|
| 195 |
`Learn more. <https://tidelift.com/subscription/pkg/pypi-pytest?utm_source=pypi-pytest&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_ |
| 196 |
|
| 197 |
Security |
| 198 |
^^^^^^^^ |
| 199 |
|
| 200 |
pytest has never been associated with a security vulnerability, but in any case, to report a |
| 201 |
security vulnerability please use the `Tidelift security contact <https://tidelift.com/security>`_. |
| 202 |
Tidelift will coordinate the fix and disclosure. |
| 203 |
|
| 204 |
|
| 205 |
License |
| 206 |
------- |
| 207 |
|
| 208 |
Copyright Holger Krekel and others, 2004. |
| 209 |
|
| 210 |
Distributed under the terms of the `MIT`_ license, pytest is free and open source software. |
| 211 |
|
| 212 |
.. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE |