skillfed

python-subunit

Python implementation of subunit test streaming protocol

python-subunit v1.4.6 1.3M downloads/30d#4,115 on PyPI31
Permissive license Apache-2.0 or BSD Active released

What it is and what it does

Subunit is a Python implementation of a streaming protocol for test results designed to handle distributed, parallel, and cross-language test execution. It models xUnit-style test outcomes (start, pass/fail, finish) and extends them with test enumeration, tagging, file attachments, and timestamps. The protocol comes in two versions: Version 1 (human-readable but with buffering and corruption issues in parallel scenarios) and Version 2 (binary, packet-based, designed for multiplexing without excessive buffering and with recovery mechanisms for corrupted streams).

The package provides Python bindings to emit and consume subunit streams, making it useful for aggregating test results from separate processes, languages, or machines into a single unified stream. It includes filters and tools to convert between subunit and other formats (CSV, JUnit XML, TAP), and integrates with Python's unittest framework via the subunit.run module. Dependencies on iso8601, PyYAML, and testtools keep the core lightweight while supporting timestamp parsing, configuration, and test result modeling.

Use it for:

  • Aggregate test results from multiple test runners or languages into a single stream for centralized reporting.
  • Run isolated test suites in separate processes and combine their results without interference using subunit's multiplexing.
  • Archive and replay test runs by recording subunit streams and replaying them later for analysis or debugging.
  • Distribute test execution across multiple machines and collect results in real time via a subunit stream.
  • Convert test results between formats (e.g., TAP to subunit, subunit to JUnit XML) using the protocol's filters.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Subunit is a streaming protocol library for test results that aggregates, serializes, and multiplexes test execution across languages and machines into a unified stream.

Yes. Subunit is actively maintained, has no known vulnerabilities, installs with low friction, and is licensed permissively. Install it if you need to aggregate, multiplex, or serialize test results across distributed or parallel test runs, or if you're integrating tests from multiple languages or frameworks. Skip it if your testing stays within a single process or framework without cross-language aggregation needs.

Install

python-subunit on PyPI

pip

pip install python-subunit

uv

uv add python-subunit

poetry

poetry add python-subunit

Installing python-subunit

Before you install

Low friction install with a pure-Python wheel. Active maintenance with recent commits and support for current Python versions (3.10–3.14). Three lightweight runtime dependencies (iso8601, PyYAML, testtools) are all stable, widely-used libraries.

License in practice

Dual-licensed under Apache-2.0 or BSD (user's choice), both permissive licenses with no copyleft obligations. You may use, modify, and distribute freely under either license terms.

Quickstart

pip install python-subunit

import subunit
from subunit import StreamResultToDict

# Parse a subunit stream
result_dict = StreamResultToDict()
# Feed stream data to result_dict and extract test results

Requires Python 3.10 or later; depends on iso8601, PyYAML, and testtools at runtime.

Verify before relying

  • Whether the package includes command-line filters (tap2subunit, subunit2csv, etc.) mentioned in the description or if those are separate tools.
  • Whether GTK and JUnit XML conversion features are available in the Python bindings or require additional setup.
  • Current state of protocol version 2 implementation and stability relative to version 1.

Package facts

License Apache-2.0 or BSD (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — iso8601, PyYAML, testtools
Maintenance actively maintained — 102 days since the last release
Last repo commit
First released
Downloads 1,282,582/month — #4,115 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_subunit-1.4.6-py3-none-any.whl

Keywords: python, streaming, test

Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Testing

Tags

test result streaming protocoltest aggregation and multiplexingdistributed test reportingxunit test serializationparallel test result collectioncross-language test integrationtest stream filtering and conversion
test-infrastructuredistributed-testingprotocol-implementation

More Testing packages