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

    - uses: actions/setup-python@v1
      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.1.4.tar.gz.

File metadata

  • Download URL: pytest-github-actions-annotate-failures-0.1.4.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pytest-github-actions-annotate-failures-0.1.4.tar.gz
Algorithm Hash digest
SHA256 65f19676544861eb312ef22314be9421d553d9edd21ed91d3c39e19e25ef8e02
MD5 2d9da86627e5f74395bb7d69109bf905
BLAKE2b-256 11d8c30dbf8fc9c76fd113aba71c8ff4d92a49afd6767d15c18ba5af4223ea7b

See more details on using hashes here.

File details

Details for the file pytest_github_actions_annotate_failures-0.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_github_actions_annotate_failures-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 549a11524a0363db22e18fd1eb1d4d9b97f1fb05e97bede1c4a3f40848b4abc2
MD5 bc35838b9d4cb84b22ec5e2ab04690e3
BLAKE2b-256 1d0131aecc37f90a0b6d17cd4fc0b8a46928bf960415fd6ee5bee2259fc9d6a2

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