Registry / testing / tap-py

tap-py

JSON →
library3.2.1pypypi✓ verified 85d ago

tappy (installed as `tap-py`) is a set of Python tools designed for working with the Test Anything Protocol (TAP). It enables Python's unittest framework to produce TAP-formatted output, facilitating integration with other testing systems that consume TAP. The library is currently at version 3.2.1 and maintains an active, though irregular, release cadence to support new Python versions and address bug fixes.

pip install tap-py
INSTALL
IMPORT
SIG · TAP-PY
T
tap-py
testingpythonv3.2.1
Install
1.7s avg
Import
215ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.228s · 20.6MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 1.7s · import 0.202s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TAPTestRunner
from tap.runner import TAPTestRunner
from tap import TAPTestRunner
TAPTestRunner is located within the 'runner' submodule, not directly under the top-level 'tap' package.

This quickstart demonstrates how to use `TAPTestRunner` with a standard `unittest.TestCase` to produce TAP output. The `python -m tap` command provides a convenient way to run tests and output TAP directly to the console, similar to `python -m unittest discover`.

import unittest from tap.runner import TAPTestRunner class MyTests(unittest.TestCase): def test_example_success(self): self.assertTrue(True) def test_example_failure(self): self.assertEqual(1, 2) if __name__ == '__main__': # Using the TAPTestRunner to get TAP output suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(MyTests)) runner = TAPTestRunner() runner.run(suite) # Alternatively, for discovery (similar to 'python -m unittest discover') # and direct TAP output to console from tests in current directory: # import os # os.system('python -m tap')
Debug
Known issues
breakingVersion 3.0 dropped support for Python 2. This was a significant change, requiring users to migrate to Python 3.
fix
Ensure your project is running on Python 3.9 or newer. Upgrade your code to be Python 3 compatible if necessary.
affects: >=3.0.0
breakingIn version 2.0, the `nose` and `pytest` plugins were removed from `tap-py` and moved to separate distributions (`nose-tap` and `pytest-tap`).
fix
If you relied on `tap-py` for `nose` or `pytest` integration, install `nose-tap` or `pytest-tap` separately (e.g., `pip install pytest-tap`).
affects: >=2.0.0
gotchaOlder Python versions are routinely dropped. As of version 3.2, Python 3.6, 3.7, and 3.8 are no longer supported.
fix
Always check the `requires_python` metadata on PyPI or the official documentation. For version 3.2.1, Python 3.9+ is required.
affects: >=3.2.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tap.yaml'
Attempting to use TAP version 13 features (like YAML blocks) without installing the optional 'yaml' dependencies.
fix
Install `tap-py` with the `yaml` extra: `pip install tap-py[yaml]`.
AttributeError: module 'tap' has no attribute 'TAPTestRunner'
Incorrect import path for `TAPTestRunner`. It resides in the `tap.runner` submodule.
fix
Change your import statement from `from tap import TAPTestRunner` to `from tap.runner import TAPTestRunner`.
My tests run, but I don't see any TAP output.
The default `unittest.TextTestRunner` is being used, or the `python -m tap` command-line entry point was not utilized. `tap-py` provides specific runners to generate TAP output.
fix
To get TAP output, either use `from tap.runner import TAPTestRunner` in your test runner setup, or simply execute your tests using `python -m tap` in the directory containing your tests.
Upgrade
Version history
3.2.1latest on PyPI · released Jan 26, 2025
Audit
Dependencies
PyYAMLoptionalRequired for parsing and producing YAML blocks in TAP version 13.
Agent activity
29 hits · last 30 days
node
28
Resources
tap-py — pip install tap-py · libregistry