pytest 8.4.0


pip install pytest

  Latest version

Released: Jun 02, 2025


Meta
Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin, Others (See AUTHORS)
Requires Python: >=3.9

Classifiers

Development Status
  • 6 - Mature

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Operating System
  • MacOS
  • Microsoft :: Windows
  • POSIX
  • Unix

Programming Language
  • Python :: 3 :: Only
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Software Development :: Libraries
  • Software Development :: Testing
  • Utilities
pytest
https://img.shields.io/pypi/v/pytest.svg https://img.shields.io/conda/vn/conda-forge/pytest.svg https://img.shields.io/pypi/pyversions/pytest.svg Code coverage Status https://github.com/pytest-dev/pytest/actions/workflows/test.yml/badge.svg pre-commit.ci status https://www.codetriage.com/pytest-dev/pytest/badges/users.svg Documentation Status Discord Libera chat

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries.

An example of a simple test:

# content of test_sample.py
def inc(x):
    return x + 1


def test_answer():
    assert inc(3) == 5

To execute it:

$ pytest
============================= test session starts =============================
collected 1 items

test_sample.py F

================================== FAILURES ===================================
_________________________________ test_answer _________________________________

    def test_answer():
>       assert inc(3) == 5
E       assert 4 == 5
E        +  where 4 = inc(3)

test_sample.py:5: AssertionError
========================== 1 failed in 0.04 seconds ===========================

Due to pytest’s detailed assertion introspection, only plain assert statements are used. See getting-started for more examples.

Features

  • Detailed info on failing assert statements (no need to remember self.assert* names)

  • Auto-discovery of test modules and functions

  • Modular fixtures for managing small or parametrized long-lived test resources

  • Can run unittest (or trial) test suites out of the box

  • Python 3.9+ or PyPy3

  • Rich plugin architecture, with over 1300+ external plugins and thriving community

Documentation

For full documentation, including installation, tutorials and PDF documents, please see https://docs.pytest.org/en/stable/.

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features.

Changelog

Consult the Changelog page for fixes and enhancements of each version.

Support pytest

Open Collective is an online funding platform for open and transparent communities. It provides tools to raise money and share your finances in full transparency.

It is the platform of choice for individuals and companies that want to make one-time or monthly donations directly to the project.

See more details in the pytest collective.

pytest for enterprise

Available as part of the Tidelift Subscription.

The maintainers of pytest and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.

Learn more.

Security

pytest has never been associated with a security vulnerability, but in any case, to report a security vulnerability please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

License

Copyright Holger Krekel and others, 2004.

Distributed under the terms of the MIT license, pytest is free and open source software.

8.4.0 Jun 02, 2025
8.3.5 Mar 02, 2025
8.3.4 Dec 01, 2024
8.3.3 Sep 10, 2024
8.3.2 Jul 25, 2024
8.3.1 Jul 20, 2024
8.3.0 Jul 20, 2024
8.2.2 Jun 04, 2024
8.2.1 May 19, 2024
8.2.0 Apr 27, 2024
8.1.2 Apr 26, 2024
8.1.1 Mar 09, 2024
8.1.0 Mar 03, 2024
8.0.2 Feb 24, 2024
8.0.1 Feb 16, 2024
8.0.0 Jan 27, 2024
8.0.0rc2 Jan 17, 2024
8.0.0rc1 Jan 02, 2024
7.4.4 Dec 31, 2023
7.4.3 Oct 24, 2023
7.4.2 Sep 07, 2023
7.4.1 Sep 02, 2023
7.4.0 Jun 23, 2023
7.3.2 Jun 10, 2023
7.3.1 Apr 14, 2023
7.3.0 Apr 08, 2023
7.2.2 Mar 03, 2023
7.2.1 Jan 14, 2023
7.2.0 Oct 25, 2022
7.1.3 Sep 02, 2022
7.1.2 Apr 23, 2022
7.1.1 Mar 17, 2022
7.1.0 Mar 13, 2022
7.0.1 Feb 11, 2022
7.0.0 Feb 04, 2022
7.0.0rc1 Dec 07, 2021
6.2.5 Aug 30, 2021
6.2.4 May 04, 2021
6.2.3 Apr 03, 2021
6.2.2 Jan 25, 2021
6.2.1 Dec 15, 2020
6.2.0 Dec 12, 2020
6.1.2 Oct 28, 2020
6.1.1 Oct 03, 2020
6.1.0 Sep 26, 2020
6.0.2 Sep 11, 2020
6.0.1 Jul 30, 2020
6.0.0 Jul 28, 2020
6.0.0rc1 Jul 10, 2020
5.4.3 Jun 02, 2020
5.4.2 May 08, 2020
5.4.1 Mar 13, 2020
5.4.0 Mar 12, 2020
5.3.5 Jan 29, 2020
5.3.4 Jan 20, 2020
5.3.3 Jan 17, 2020
5.3.2 Dec 14, 2019
5.3.1 Nov 26, 2019
5.3.0 Nov 19, 2019
5.2.4 Nov 15, 2019
5.2.3 Nov 14, 2019
5.2.2 Oct 25, 2019
5.2.1 Oct 06, 2019
5.2.0 Sep 29, 2019
5.1.3 Sep 21, 2019
5.1.2 Aug 30, 2019
5.1.1 Aug 20, 2019
5.1.0 Aug 16, 2019
5.0.1 Jul 05, 2019
5.0.0 Jun 29, 2019
4.6.11 Jun 05, 2020
4.6.10 May 08, 2020
4.6.9 Jan 04, 2020
4.6.8 Dec 19, 2019
4.6.7 Dec 06, 2019
4.6.6 Oct 13, 2019
4.6.5 Aug 05, 2019
4.6.4 Jun 29, 2019
4.6.3 Jun 11, 2019
4.6.2 Jun 03, 2019
4.6.1 Jun 02, 2019
4.6.0 Jun 01, 2019
4.5.0 May 11, 2019
4.4.2 May 08, 2019
4.4.1 Apr 15, 2019
4.4.0 Mar 31, 2019
4.3.1 Mar 12, 2019
4.3.0 Feb 18, 2019
4.2.1 Feb 13, 2019
4.2.0 Jan 30, 2019
4.1.1 Jan 12, 2019
4.1.0 Jan 06, 2019
4.0.2 Dec 14, 2018
4.0.1 Nov 24, 2018
4.0.0 Nov 14, 2018
3.10.1 Nov 11, 2018
3.10.0 Nov 04, 2018
3.9.3 Oct 27, 2018
3.9.2 Oct 23, 2018
3.9.1 Oct 16, 2018
3.8.2 Oct 02, 2018
3.8.1 Sep 22, 2018
3.8.0 Sep 06, 2018
3.7.4 Aug 29, 2018
3.7.3 Aug 26, 2018
3.7.2 Aug 18, 2018
3.7.1 Aug 02, 2018
3.7.0 Jul 30, 2018
3.6.4 Jul 28, 2018
3.6.3 Jul 04, 2018
3.6.2 Jun 20, 2018
3.6.1 Jun 05, 2018
3.6.0 May 23, 2018
3.5.1 Apr 24, 2018
3.5.0 Mar 22, 2018
3.4.2 Mar 05, 2018
3.4.1 Feb 20, 2018
3.4.0 Jan 30, 2018
3.3.2 Jan 04, 2018
3.3.1 Dec 06, 2017
3.3.0 Nov 27, 2017
3.2.5 Nov 15, 2017
3.2.4 Nov 14, 2017
3.2.3 Oct 04, 2017
3.2.2 Sep 07, 2017
3.2.1 Aug 09, 2017
3.2.0 Aug 01, 2017
3.1.3 Jul 04, 2017
3.1.2 Jun 09, 2017
3.1.1 May 31, 2017
3.1.0 May 22, 2017
3.0.7 Mar 14, 2017
3.0.6 Jan 22, 2017
3.0.5 Dec 05, 2016
3.0.4 Nov 11, 2016
3.0.3 Sep 29, 2016
3.0.2 Sep 02, 2016
3.0.1 Aug 24, 2016
3.0.0 Aug 19, 2016
2.9.2 May 31, 2016
2.9.1 Mar 18, 2016
2.9.0 Mar 01, 2016
2.8.7 Jan 24, 2016
2.8.6 Jan 22, 2016
2.8.5 Dec 12, 2015
2.8.4 Dec 06, 2015
2.8.3 Nov 19, 2015
2.8.2 Oct 07, 2015
2.8.1 Sep 29, 2015
2.8.0 Sep 18, 2015
2.7.3 Sep 15, 2015
2.7.2 Jun 23, 2015
2.7.1 May 19, 2015
2.7.0 Mar 26, 2015
2.6.4 Oct 24, 2014
2.6.3 Sep 24, 2014
2.6.2 Sep 05, 2014
2.6.1 Aug 07, 2014
2.6.0 Jul 20, 2014
2.5.2 Jan 29, 2014
2.5.1 Dec 17, 2013
2.5.0 Dec 12, 2013
2.4.2 Oct 04, 2013
2.4.1 Oct 02, 2013
2.4.0 Oct 01, 2013
2.3.5 Apr 30, 2013
2.3.4 Nov 20, 2012
2.3.3 Nov 06, 2012
2.3.2 Oct 25, 2012
2.3.1 Oct 20, 2012
2.3.0 Oct 19, 2012
2.2.4 May 22, 2012
2.2.3 Feb 06, 2012
2.2.2 Feb 06, 2012
2.2.1 Dec 16, 2011
2.2.0 Nov 18, 2011
2.1.3 Oct 18, 2011
2.1.2 Sep 24, 2011
2.1.1 Aug 20, 2011
2.1.0 Jul 09, 2011
2.0.3 Apr 17, 2011
2.0.2 Mar 09, 2011
2.0.1 Feb 07, 2011
2.0.0 Nov 25, 2010

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
colorama (>=0.4)
exceptiongroup (>=1)
iniconfig (>=1)
packaging (>=20)
pluggy (<2,>=1.5)
pygments (>=2.7.2)
tomli (>=1)