Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file pytest_github_actions_annotate_failures-0.4.1.tar.gz.

File metadata

File hashes

Hashes for pytest_github_actions_annotate_failures-0.4.1.tar.gz
Algorithm Hash digest
SHA256 cce5ed29b57e8f454fcc4414f8c9aaa9bf8e40848cfcb444b13d7204e9fc9dcb
MD5 8e74833784883ec9e80f0536943f7495
BLAKE2b-256 05749ee7377ed117e7084e7a04a8e5748239b5b2b99a58daa55bfb0d8b9a1a19

See more details on using hashes here.

File details

Details for the file pytest_github_actions_annotate_failures-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_github_actions_annotate_failures-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d117bba2f975a357f4e395a71bf1638b4bcf5558fd7e8ee56d2480a521af8e03
MD5 74889818305270df57c6e973e1c9d913
BLAKE2b-256 6acc962a57f364ffe32dea6400a5115c23b217146597b8a445f8a5c656343f0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page