A pytest plugin designed to enhance GitHub Actions workflows by annotating failed tests directly in the pull request or commit view. It parses pytest output and generates GitHub workflow commands to create inline annotations for test failures, providing immediate feedback on problematic code lines. The project is actively maintained under the pytest-dev organization, with its latest version being 0.4.0.
pip install pytest-github-actions-annotate-failuresNo compatibility data collected yet for this library.
This quickstart demonstrates how to set up `pytest-github-actions-annotate-failures` in a basic GitHub Actions workflow. Once installed and integrated, failed tests will automatically produce inline annotations in your GitHub pull requests or commit details, pointing directly to the line of code that caused the failure. No special command-line flags are typically needed for activation, as pytest discovers the plugin automatically upon installation.
Ensure your GitHub Actions workflow or local environment uses Python 3.10+ and pytest 7.0.0+.
Set the `PYTEST_RUN_PATH` environment variable to the path of your test directory relative to the repository root. For example, `env: PYTEST_RUN_PATH: src/tests` in your workflow step.
If you relied on annotations for intermediate rerun failures, be aware of this change in behavior. There is no direct fix to revert to the old behavior; adapt your workflow expectations accordingly.