pytest-tap

3.5 · active · verified Thu Apr 16

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.

Common errors

Warnings

Install

Quickstart

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.

view raw JSON →