Metadata-Version: 2.2
Name: pytest-github-actions-annotate-failures
Version: 0.3.0
Summary: pytest plugin to annotate failed tests with a workflow command for GitHub Actions
Author-email: utgwkk <utagawakiki@gmail.com>
Maintainer-email: utgwkk <utagawakiki@gmail.com>
License: MIT
Project-URL: homepage, https://github.com/pytest-dev/pytest-github-actions-annotate-failures
Project-URL: repository, https://github.com/pytest-dev/pytest-github-actions-annotate-failures
Project-URL: changelog, https://github.com/pytest-dev/pytest-github-actions-annotate-failures/releases
Keywords: ansible,testing,molecule,plugin
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Framework :: Pytest
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pytest>=6.0.0

# pytest-github-actions-annotate-failures
[Pytest](https://pypi.org/project/pytest/) plugin to annotate failed tests with a [workflow command for GitHub Actions](https://help.github.com/en/actions/reference/workflow-commands-for-github-actions)

## Usage
Just install and run pytest with this plugin in your workflow. For example,

```yaml
name: test

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3

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

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

### Warning annotations

This plugin also supports warning annotations when used with Pytest 6.0+. To disable warning annotations, pass `--exclude-warning-annotations` to pytest.

## Screenshot
[![Image from Gyazo](https://i.gyazo.com/b578304465dd1b755ceb0e04692a57d9.png)](https://gyazo.com/b578304465dd1b755ceb0e04692a57d9)
