pytest-github-actions-annotate-failures 0.4.0


pip install pytest-github-actions-annotate-failures

  Latest version

Released: Mar 02, 2026


Meta
Author: utgwkk
Maintainer: utgwkk
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console

Framework
  • Pytest

Intended Audience
  • Developers
  • Information Technology
  • System Administrators

Programming Language
  • Python
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Software Development :: Quality Assurance
  • Software Development :: Testing
  • System :: Systems Administration
  • Utilities

pytest-github-actions-annotate-failures

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

Usage

Just install and run pytest with this plugin in your workflow. For example,

name: test

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - uses: actions/setup-python@v5
      with:
        python-version: 3.13

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt

    - name: Install plugin
      run: pip install pytest-github-actions-annotate-failures

    - run: pytest

If your test is running in a Docker container, you have to install this plugin and manually set GITHUB_ACTIONS environment variable to true inside of Docker container. (For example, docker-compose run --rm -e GITHUB_ACTIONS=true app -- pytest)

If your tests are run from a subdirectory of the git repository, you have to set the PYTEST_RUN_PATH environment variable to the path of that directory relative to the repository root in order for GitHub to identify the files with errors correctly.

Warning annotations

This plugin also supports warning annotations when used with Pytest 6.0+. To disable warning annotations, pass --exclude-warning-annotations to pytest.

Screenshot

Image from Gyazo

Extras: None
Dependencies:
pytest (>=7.0.0)