pytest-print
pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout)
What it is and what it does
pytest-print is a pytest plugin that provides fixtures for printing messages directly to test output without being captured by pytest's output suppression. It solves the problem of communicating test progress or debug information when you cannot attach a debugger—letting end users see that a test is still running rather than appearing frozen.
The package offers three main fixtures: a basic printer for simple messages, a pretty_printer with hierarchical formatting and elapsed-time display, and a factory for custom formatters. Messages appear in pytest's standard output even when tests pass, and the plugin can be controlled via CLI flags (`--print`, `--print-relative-time`) to show output at different verbosity levels.
Use it for:
- Report sub-steps in long-running tests to show progress and prevent timeout confusion.
- Print debug information when you cannot use a debugger, helping users confirm tests are not deadlocked.
- Create hierarchical, indented output for nested test operations with custom icons and timing.
- Add elapsed-time tracking to test output to identify performance bottlenecks.
- Customize message formatting with different indentation, icons, and timer formats per test.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds fixtures to pytest that print messages directly to test output, bypassing pytest's output capture, with optional formatting and elapsed-time tracking.
Yes. Low install friction, active maintenance, permissive license, no known vulnerabilities, and a single stable dependency (pytest). Useful for any test suite that needs visible progress reporting or debug output during long-running or hard-to-debug tests.
Install
pytest-print on PyPI
pip
pip install pytest-printuv
uv add pytest-printpoetry
poetry add pytest-printInstalling pytest-print
Before you install
Low friction: pure Python wheel with only pytest as a runtime dependency. Actively maintained with a recent release 24 days ago and steady repository activity.
License in practice
MIT license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install pytest-print
import pytest
def test_example(printer):
printer("Test step 1")
printer("Test step 2")
Requires Python 3.10 or later.
Verify before relying
- Whether the package works with pytest versions older than the minimum tested version in the classifiers.
- Performance impact when printing large volumes of messages in long-running test suites.
Package facts
| License | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pytest |
| Maintenance | actively maintained — 24 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 196,546/month — #9,782 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_print-1.3.0-py3-none-any.whl
Keywords: env, pytest
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pytest-lazy-fixturesAllows you to reference pytest fixtures…
permissive · top 5,000 on PyPI
pytest-unused-fixturesA pytest plugin that identifies and reports…
permissive · top 15,000 on PyPI
pytest-lazy-fixtureAllows you to use pytest fixtures directly as…
permissive · top 15,000 on PyPI
pytest-harvestpytest-harvest captures and stores data…
permissive · top 15,000 on PyPI
pytest-deadfixturesA pytest plugin that identifies unused and…
permissive · top 5,000 on PyPI
pytest-dockerpytest-docker provides pytest fixtures that…
permissive · top 5,000 on PyPI
pytest-casespytest-cases lets you separate test case data…
permissive · top 5,000 on PyPI
pytest-redisA pytest plugin that provides fixtures for…
copyleft · top 15,000 on PyPI
pylint-pytestA Pylint plugin that suppresses false-positive…
permissive · top 15,000 on PyPI
pytest-rngProvides pytest fixtures that make random…
permissive · top 15,000 on PyPI