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

File metadata

  • Download URL: pytest-github-actions-annotate-failures-0.1.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for pytest-github-actions-annotate-failures-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e2bbb307b16abb70721046913d18e855fab867c8e490f71e38a6ca6042911822
MD5 3e9308e659c843e7bdde4350e17b8e84
BLAKE2b-256 f5cb7cd50be1a7a0ec1cdf603f1f1fb3fc5aefdde1dd81966846f7dd197c81f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_github_actions_annotate_failures-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4c00d1f8182341a0a1a4c94e5ec3ab22098590ae173326ec282729a5e162d6bb
MD5 66f7eb7c8cab57c4122b6b657451371e
BLAKE2b-256 8d7e04f636be3136a8558a032ac1fa2b6a5dd31d81f47c60ce2852bb9a8fe418

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