Skip to main content

pytest-step-logger

Live, colour-coded step trees in your pytest terminal — powered by Rich.

⟳ test_checkout
├── ✔ Create booking   3.01s
├── ▶ Call API         1.24s   ← running right now
└── ○ Validate response        ← pending

Steps transition in real time:

Symbol Colour Meaning
○ grey Not yet reached
▶ yellow Currently running
✔ green Passed
✘ red Failed

Features

  • Allure support — step labels come from @allure.step("label") when available.
  • Plain-function fallback — when there is no allure, function names are used automatically (via sys.settrace).
  • Ahead-of-time tree — all steps appear as grey nodes before execution starts, so you see the full plan upfront.
  • Soft-assertion aware — failures from pytest-check are detected and colour the step red even though no exception propagates.
  • Caught-exception fix — a step that catches and swallows an exception is correctly left green.
  • pytest-xdist parallel support — a single persistent spinner panel shows every currently-running test with elapsed times; completed trees print above the panel without flicker.

Installation

pip install pytest-step-logger

With optional integrations:

# allure + pytest-check + xdist all at once
pip install "pytest-step-logger[all]"

# individual extras
pip install "pytest-step-logger[allure]"
pip install "pytest-step-logger[check]"
pip install "pytest-step-logger[xdist]"

Usage

Add --step-log to your pytest invocation:

pytest --step-log

Or make it permanent in pyproject.toml / pytest.ini:

[tool.pytest.ini_options]
addopts = "--step-log"

With allure steps

import allure

@allure.step("Create booking")
def create_booking():
    ...

@allure.step("Call API")
def call_api():
    ...

def test_checkout():
    create_booking()
    call_api()

With plain functions (no allure)

def create_booking():
    ...

def call_api():
    ...

def test_checkout():
    create_booking()
    call_api()

The plugin automatically detects the absence of allure and falls back to function names.

Parallel execution (pytest-xdist)

pytest --step-log -n auto

While tests run in parallel you see a live spinner panel:

  ⠋ test_checkout        2.3s
  ⠙ test_cancel_booking  1.1s
  ⠹ test_search          0.4s

As each test finishes its full step tree is printed above the panel.


How it works

Scenario Step source Live display
Sequential, allure @allure.step hook via allure_commons.plugin_manager Per-test Live tree
Sequential, no allure sys.settrace call/return events Per-test Live tree
xdist worker Same as above (no TTY needed) None — serialised to report
xdist controller Deserialises worker reports Persistent spinner + printed trees

Step records are serialised as JSON into report.user_properties and survive xdist's wire protocol transparently.


Requirements

  • Python ≥ 3.11
  • pytest ≥ 7.0
  • rich ≥ 13.0

Optional:

  • allure-pytest ≥ 2.13
  • pytest-check ≥ 2.7.4
  • pytest-xdist ≥ 3.8.0

License

MIT

Metadata

Release files for pytest-step-logger 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-step-logger 0.1.0
File Size Uploaded
pytest_step_logger-0.1.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-step-logger 0.1.0
File Interpreter ABI Platform
pytest_step_logger-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / pytest_step_logger-0.1.0.tar.gz

Download URL pytest_step_logger-0.1.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3b03f63229157c4fb223d226e27c60e43b31c67da463c375ce6341c76016c0c6
BLAKE2b-256 checksum
How to use checksums
fc8177015803ebe609e42ea03122ebb802387a5c024e42b8506611d3ea389c3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2026.

Transparency log

Release files / pytest_step_logger-0.1.0-py3-none-any.whl

Download URL pytest_step_logger-0.1.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58030843bab28ded3fba520b22163add0900ea54f8c7ae0a418b13bb0b6d05cb
BLAKE2b-256 checksum
How to use checksums
1df35c3ed0998565f74f5602799f47948b0aa20cc5ff601107bca46430c8699e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page