skillfed

pytest-print

pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout)

pytest-print v1.3.0 196.5K downloads/30d#9,782 on PyPI81
Permissive 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) Active released

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-print

uv

uv add pytest-print

poetry

poetry add pytest-print

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules

Tags

pytest output capture bypassprint during pytest testspytest test logging fixturesdebug output in pytestpytest formatted test outputpytest progress reportingpytest sub-step printing
pytest-plugintest-outputdebugging

More Python Modules packages