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@v3

    - uses: actions/setup-python@v4
      with:
        python-version: 3.7

    - 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.

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

File details

Details for the file pytest-github-actions-annotate-failures-0.2.0.tar.gz.

File metadata

File hashes

Hashes for pytest-github-actions-annotate-failures-0.2.0.tar.gz
Algorithm Hash digest
SHA256 844ab626d389496e44f960b42f0a72cce29ae06d363426d17ea9ae1b4bef2288
MD5 c070d5da6f9c4029f4d46fc34744b4dd
BLAKE2b-256 a8d676d074e1e4d78c5144397e6061af29bcc218dbf19bb64b39e5c296bf42f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_github_actions_annotate_failures-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8bcef65fed503faaa0524b59cfeccc8995130972dd7b008d64193cc41b9cde85
MD5 cf5dbb6519cb2bdeaa7e1c3dbf36c202
BLAKE2b-256 eb869ffd9f10a7ba7387ce4ef4362505d739a48dd988051b41d255eb7f102c17

See more details on using hashes here.

Supported by

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