Repolode
pytest-dev

pytest-dev/pytest

A Python testing framework that makes it easy to write small tests and scales to complex functional testing of applications and libraries.

Stars
14,609
Forks
3,510
Open issues
865
Last commit
5 hours ago

What is it?

pytest is a testing framework for Python. Tests are plain functions that use ordinary assert statements, and pytest rewrites assertions to show detailed information about why a check failed, so there is no need to learn special assertion methods.

Beyond simple test functions, pytest provides modular fixtures for setting up and sharing test resources, including parametrized ones, and it can discover test modules and functions automatically. It can also run existing unittest test suites out of the box.

The framework has a plugin architecture, and the project cites over 1300 external plugins. It supports Python 3.10 and later, as well as PyPy3.

Key features

  • 01Detailed failure output from plain assert statements, with no special assertion methods to learn.
  • 02Automatic discovery of test modules and functions.
  • 03Modular fixtures for managing small or parametrized test resources.
  • 04Can run unittest and trial test suites without modification.
  • 05Extensible through a large plugin ecosystem.

Use cases

  • Writing unit tests for a Python library or application.
  • Building functional test suites that need shared setup and parametrized inputs.
  • Migrating an existing unittest suite incrementally to a more concise style.

Topics

FAQ

What is pytest?
A Python testing framework that makes it easy to write small tests and scales to complex functional testing of applications and libraries. pytest is a testing framework for Python. Tests are plain functions that use ordinary assert statements, and pytest rewrites assertions to show detailed information about why a check failed, so there is no need to learn special assertion methods.
Is pytest free to use? What license does it have?
pytest is open source under the MIT license. Check the license terms before using it in commercial products.
Is pytest still maintained?
Actively maintained. The last commit to pytest was on Oct 18, 2026.
What can I use pytest for?
Writing unit tests for a Python library or application. Building functional test suites that need shared setup and parametrized inputs. Migrating an existing unittest suite incrementally to a more concise style.
Where can I get pytest?
The source code and installation instructions are on GitHub: https://github.com/pytest-dev/pytest

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects