skillfed

pytest-github-actions-annotate-failures

pytest plugin to annotate failed tests with a workflow command for GitHub Actions

pytest-github-actions-annotate-failures v0.4.2 3.7M downloads/30d#2,531 on PyPI178
Permissive license MIT Active released

What it is and what it does

This is a pytest plugin designed to integrate test results directly into GitHub Actions workflows. When tests fail, it uses GitHub Actions workflow commands to create annotations that appear in the Actions UI, pull request checks, and job summaries, making failures immediately visible without requiring developers to dig through logs.

The plugin works by hooking into pytest's test execution and capturing failures, then emitting GitHub workflow annotation commands that the Actions runner interprets. It requires only pytest as a runtime dependency and has low install friction. It supports warning annotations when used with Pytest 6.0 or later, and can be disabled with a command-line flag if needed. For Docker-based test runs or tests in repository subdirectories, environment variables must be configured to ensure GitHub correctly maps reported failures to source files.

Use it for:

  • Automatically surface test failures in GitHub Actions job summaries and PR checks without manual log parsing
  • Integrate pytest test results into GitHub's native CI/CD UI for faster failure identification
  • Annotate both test failures and warnings in GitHub Actions workflows with a single plugin install
  • Run tests in Docker containers within GitHub Actions while preserving failure annotations via environment variable configuration

Worth the install?

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

A pytest plugin that automatically annotates failed tests in GitHub Actions workflows using GitHub's workflow annotation commands, making test failures visible directly in the Actions UI.

Yes. This plugin is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and solves a real workflow problem—making test failures visible in GitHub Actions without extra configuration. Install it if you run pytest in GitHub Actions and want failures to surface directly in the UI.

Install

pytest-github-actions-annotate-failures on PyPI

pip

pip install pytest-github-actions-annotate-failures

uv

uv add pytest-github-actions-annotate-failures

poetry

poetry add pytest-github-actions-annotate-failures

Installing pytest-github-actions-annotate-failures

Before you install

Low install friction with a single runtime dependency on pytest. Actively maintained with a recent release; last commit on 2026-08-13 and marked as Production/Stable.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions, making it straightforward to integrate into any project.

Quickstart

pip install pytest-github-actions-annotate-failures
pytest

# In GitHub Actions workflow:
- run: pytest

Requires Python 3.10 or later. When running tests in Docker, the GITHUB_ACTIONS environment variable must be manually set to true. If tests run from a subdirectory, PYTEST_RUN_PATH must be set to the relative path for correct file identification.

Verify before relying

  • Whether warning annotations (available with Pytest 6.0+) work correctly with all current pytest versions
  • Performance impact when handling large numbers of test failures in a single run

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pytest
Maintenance actively maintained — 56 days since the last release
Last repo commit
First released
Downloads 3,672,515/month — #2,531 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytest_github_actions_annotate_failures-0.4.2-py3-none-any.whl

Keywords: plugin, pytest, testing

Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: PytestIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Quality AssuranceTopic :: Software Development :: TestingTopic :: System :: Systems AdministrationTopic :: Utilities

Tags

pytest github actions integrationgithub actions test failure annotationspytest workflow command pluginci/cd test reporting githubpytest github actions plugintest failure annotations cigithub actions pytest reporting
github-actionsci-cdtest-reporting

More Utilities packages