pytest

Installation
SKILL.md

Pytest

Pytest is the dominant testing framework for Python. It is loved for its no-boilerplate syntax (assert x == y), powerful fixture system, and rich plugin ecosystem.

When to Use

  • Python Standard Testing Framework: The most widely adopted, powerful testing framework for Python web backends, data science, and ML.
  • Clean Fixture Dependency Injection: Managing test setup, database connections, and teardown cleanly with @pytest.fixture.
  • Parameterized Testing: Running test functions across multi-dimensional input sets with @pytest.mark.parametrize.
  • Rich Plugin Ecosystem: Extending capabilities via pytest-asyncio, pytest-cov, pytest-xdist, and pytest-mock.

Quick Start

# content of test_sample.py
def inc(x):
    return x + 1
Installs
8
GitHub Stars
15
First Seen
Feb 10, 2026