Skip to main content

A single aggregated tqdm progress bar for pytest, xdist-aware, with failures printed above the bar. Interactive-only.

Project description

pytest-tqdm

CI PyPI Python versions License: MIT

One tqdm progress bar for your whole pytest run — even under pytest-xdist. Failures print above the bar with full tracebacks; everything else stays quiet. Interactive-only, so it never pollutes CI logs or AI-agent output.

 42%|███████▉           | 512/1210 [00:37<00:48, 14.3test/s, ✓510 ✗2 s0 ▸ test_bar]

…and a one-line summary when the run finishes:

pytest-tqdm ▸ 1210 tests in 01:25  ·  14.2 tests/s  ·  ✓1180 ✗2 s28  ·  8 workers

Why

Under pytest-xdist the usual pretty progress plugins render a bar per file or per worker, and the output interleaves into noise. pytest-tqdm collapses the whole session into a single aggregated bar driven on the xdist controller (which receives every worker's report), so you get one clean line with ETA and throughput — plus failures surfaced immediately, above the bar.

Install

pip install pytest-tqdm

The plugin auto-registers via pytest's pytest11 entry-point. Its only runtime dependency is tqdm.

Usage

By default the bar turns on automatically whenever standard error is an interactive terminal (and you are on the xdist controller, not a worker). In CI, when output is piped, or under an AI coding agent, standard error is not a TTY, so the plugin stays completely silent — your existing reporter is untouched.

pytest -n auto            # bar appears in your terminal, nothing changes in CI

Options

Flag pytest.ini / env Effect
(none) Auto-on in a TTY; failures print above the bar with a full traceback.
--tqdm PYTEST_TQDM=1 Force the bar on even without a TTY.
--no-tqdm PYTEST_TQDM=0 Force the bar off.
--tqdm-names tqdm_names (ini) Also stream every finished test name above the bar.
--tqdm-tb=full|line|no tqdm_tb (ini) Traceback verbosity above the bar for failures (default full).

Resolution order for activation: --tqdm / --no-tqdmPYTEST_TQDM → TTY auto-detection.

The bar

 42%|███████▉    | 512/1210 [00:37<00:48, 14.3test/s, ✓510 ✗2 s0 ▸ test_bar]

percentage · bar · done/total · elapsed<eta · throughput · live ✓/✗/skip tally · current test.

The end-of-run line

When the session finishes the bar is replaced by a single totals line: number of tests, wall time, tests/second, the pass/fail/skip tally, and how many xdist workers ran (serial if you ran without -n).

How it works

  • Controller-only. pytest-xdist forwards every worker's pytest_runtest_logreport to the controller, so one reporter there sees all results and drives a single bar. Workers render nothing.
  • Summary preserved. The plugin subclasses pytest's TerminalReporter and merely mutes its live per-test writes — all bookkeeping still runs, so the native end-of-run summary, --durations, the failures recap, etc. are untouched.
  • stderr. The bar and above-bar text go to standard error; the normal reporter's summary goes to standard out, so they never fight.

Compatibility

  • Python 3.9+
  • pytest 8 and 9
  • Works with and without pytest-xdist; disables pytest-sugar while active (one bar only).

License

MIT © Michał Pasternak

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_tqdm-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_tqdm-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest_tqdm-0.1.0.tar.gz.

File metadata

  • Download URL: pytest_tqdm-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for pytest_tqdm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3284aaacdcbf38506ddc3ebd21d1d3199e213165bd2e38ed890d8555f13f992f
MD5 35cf8149da8f298a5bb39a5b5c5bbb9d
BLAKE2b-256 1a22a28542ed25e65b1c494051bd2f691d65372eaced9049db501e8f0cde8550

See more details on using hashes here.

File details

Details for the file pytest_tqdm-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_tqdm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c0c30d4ac37f72f6caa68a2c3ae7d40f03cac8cd18cb7323fa66c3c74a271f9
MD5 ca67205710c0b6a9318855475ad6b1ad
BLAKE2b-256 900ee8d762491303693693442ec490c7c40a7e41baf51bde0e000af95124a91d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page