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
Project details
Release history Release notifications | RSS feed
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
- Download URL: pytest-github-actions-annotate-failures-0.2.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 844ab626d389496e44f960b42f0a72cce29ae06d363426d17ea9ae1b4bef2288 |
|
MD5 | c070d5da6f9c4029f4d46fc34744b4dd |
|
BLAKE2b-256 | a8d676d074e1e4d78c5144397e6061af29bcc218dbf19bb64b39e5c296bf42f1 |
File details
Details for the file pytest_github_actions_annotate_failures-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_github_actions_annotate_failures-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bcef65fed503faaa0524b59cfeccc8995130972dd7b008d64193cc41b9cde85 |
|
MD5 | cf5dbb6519cb2bdeaa7e1c3dbf36c202 |
|
BLAKE2b-256 | eb869ffd9f10a7ba7387ce4ef4362505d739a48dd988051b41d255eb7f102c17 |