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.1.7.tar.gz.

File metadata

File hashes

Hashes for pytest-github-actions-annotate-failures-0.1.7.tar.gz
Algorithm Hash digest
SHA256 c6af8f9d13f1f09ef4c104a30875a4975db131ddbba979c8e48fdc456c8dde1f
MD5 11ed3c2f53a31ead0937ffad0daa1f18
BLAKE2b-256 072fc203a7d8df92453fea36e0135d47e5b47b6bf920b7d5ff388f31fdef0292

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_github_actions_annotate_failures-0.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c4a7346d1d95f731a6b53e9a45f10ca56593978149266dd7526876cce403ea38
MD5 51bcd9082c11e0c722493562bfa1685a
BLAKE2b-256 7e15669aba06ec65b951d6856f9ea14a1c19dc650c4993d02eae341dc958513a

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