{"id":8541,"library":"pytest-tap","title":"pytest-tap","description":"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.","status":"active","version":"3.5","language":"en","source_language":"en","source_url":"https://github.com/python-tap/pytest-tap","tags":["pytest","tap","testing","plugin","test-anything-protocol"],"install":[{"cmd":"pip install pytest-tap","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required testing framework as pytest-tap is a plugin for pytest.","package":"pytest","optional":false}],"imports":[],"quickstart":{"code":"import pytest\n\n# test_example.py\ndef test_passing_example():\n    assert 1 + 1 == 2\n\ndef test_failing_example():\n    assert 'hello'.upper() == 'WORLD'\n\ndef test_skipped_example():\n    pytest.skip(\"This test is intentionally skipped\")\n\n# To run: pytest --tap test_example.py\n# This will output TAP data to stdout.","lang":"python","description":"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."},"warnings":[{"fix":"Replace `--tap-stream` with `--tap` when running pytest.","message":"The `--tap-stream` command-line flag was deprecated in version 3.4 in favor of the simpler `--tap` flag for streaming TAP output.","severity":"deprecated","affected_versions":">=3.4"},{"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).","message":"The `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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your Python environment meets the `requires_python` specification (currently `>=3.9`) and use a compatible version of `pytest`.","message":"Support 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.","severity":"breaking","affected_versions":">=3.4"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Update your pytest command to use `--tap` instead of `--tap-stream` for streaming TAP output.","cause":"Using the `--tap-stream` flag, which was deprecated in `pytest-tap` version 3.4.","error":"DeprecationWarning: '--tap-stream' is deprecated, use '--tap' instead."},{"fix":"Add a TAP output flag to your pytest command, such as `pytest --tap`, `pytest --tap-files`, or `pytest --tap-combined`.","cause":"The `pytest-tap` plugin is installed, but no explicit TAP output mode was specified on the command line.","error":"No TAP output is generated to stdout or in files, even though pytest runs successfully."},{"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).","cause":"The `pytest-tap` library is not installed in the active Python environment, or the environment where `pytest` is running cannot find it.","error":"ModuleNotFoundError: No module named 'pytest_tap'"}]}