Registry / testing / pytest-tap

pytest-tap

JSON →
library3.5pypypiunverified

pytest-tap is a reporting plugin for pytest that outputs Test Anything Protocol (TAP) data. TAP is a line-based test protocol for recording test data in a standard way. The current version is 3.5, and it regularly releases new versions to maintain compatibility with updated Python and pytest versions, typically on an irregular cadence.

pip install pytest-tap
INSTALL
IMPORT
SIG · PYTEST-TAP
P
pytest-tap
testingpythonv3.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Create a test file (e.g., `test_example.py`) and run pytest with the `--tap` flag to see TAP output. The plugin integrates directly with pytest's command-line interface.

import pytest # test_example.py def test_passing_example(): assert 1 + 1 == 2 def test_failing_example(): assert 'hello'.upper() == 'WORLD' def test_skipped_example(): pytest.skip("This test is intentionally skipped") # To run: pytest --tap test_example.py # This will output TAP data to stdout.
Debug
Known issues
deprecatedThe `--tap-stream` command-line flag was deprecated in version 3.4 in favor of the simpler `--tap` flag for streaming TAP output.
fix
Replace `--tap-stream` with `--tap` when running pytest.
affects: >=3.4
gotchaThe `pytest-tap` plugin is automatically activated upon installation, but it does not produce any output by default. You must explicitly enable a TAP output mode using one of the command-line flags.
fix
Always include a TAP output mode flag when running pytest, such as `--tap` (for streaming), `--tap-files` (for individual files), or `--tap-combined` (for a single combined file).
affects: All versions
breakingSupport for older Python versions is regularly dropped to align with Python's end-of-life schedule and pytest's support. For example, Python 3.8 support was dropped in `pytest-tap` v3.5, and Python 3.7/3.6 were dropped in v3.4.
fix
Ensure your Python environment meets the `requires_python` specification (currently `>=3.9`) and use a compatible version of `pytest`.
affects: >=3.4
Errors
Common errors & fixes
DeprecationWarning: '--tap-stream' is deprecated, use '--tap' instead.
Using the `--tap-stream` flag, which was deprecated in `pytest-tap` version 3.4.
fix
Update your pytest command to use `--tap` instead of `--tap-stream` for streaming TAP output.
No TAP output is generated to stdout or in files, even though pytest runs successfully.
The `pytest-tap` plugin is installed, but no explicit TAP output mode was specified on the command line.
fix
Add a TAP output flag to your pytest command, such as `pytest --tap`, `pytest --tap-files`, or `pytest --tap-combined`.
ModuleNotFoundError: No module named 'pytest_tap'
The `pytest-tap` library is not installed in the active Python environment, or the environment where `pytest` is running cannot find it.
fix
Run `pip install pytest-tap` in your Python environment. Also, ensure your test files follow pytest's discovery conventions (e.g., `test_*.py` files, `test_*` functions).
Upgrade
Version history
3.5latest on PyPI · released Jan 30, 2025
Audit
Dependencies
pytestrequiredRequired testing framework as pytest-tap is a plugin for pytest.
Agent activity
6 hits · last 30 days
node
6
Resources
pytest-tap — pip install pytest-tap · libregistry