--- id: pytest-print version: "1.3.0" 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) license_treatment: permissive maintenance: active --- # pytest-print — pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) License: permissive · Maintenance: active · Downloads: 196.5K/mo ## 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 above — 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 pip install pytest-print uv add pytest-print 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_current - Install friction: low - Maintenance: active - Downloads: 196.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest output capture bypass, print during pytest tests, pytest test logging fixtures, debug output in pytest, pytest formatted test output, pytest progress reporting, pytest sub-step printing, pytest-plugin, test-output, debugging [View on SkillFed](https://skillfed.io/packages/pytest-print) · [View on PyPI](https://pypi.org/project/pytest-print/)