Pytest reporter for Flakiness.io
Project description
pytest-flakiness
The official Flakiness.io reporter for pytest.
Automatically detect, track, and resolve flaky tests in your Python test suite. This plugin hooks into your pytest execution and uploads test results directly to your Flakiness.io dashboard.
Installation
Install using uv (recommended):
uv add --dev pytest-flakiness
Or via standard pip:
pip install pytest-flakiness
Configuration
To upload reports, you need your project's API Key. You can find this in your project settings on flakiness.io.
Set the API key in your environment. This is best for CI/CD systems.
export FLAKINESS_API_KEY="fk_live_..."
Usage
Once installed, simply run pytest. If the FLAKINESS_API_KEY is present, the reporter will automatically activate, aggregate test results, and upload them at the end of the session.
uv run pytest
You should see a confirmation in your terminal summary:
...
PASSED [100%]
==============================
✅ Flakiness.io report uploaded successfully:
https://app.flakiness.io/report/12345
==============================
CI/CD Example (GitHub Actions)
To ensure reports are uploaded during your CI runs, map the secret in your workflow:
- name: Run Tests
env:
FLAKINESS_API_KEY: ${{ secrets.FLAKINESS_API_KEY }}
run: uv run pytest
🛠️ Development Setup
This project uses uv for dependency management and pre-commit for code quality checks.
1. Install Dependencies
Ensure you have uv installed, then run:
uv sync
2. Enable Git Hooks
This project uses ruff (formatting/linting) and pyright (type checking) as pre-commit hooks. You must install the git hooks to ensure checks run automatically before you commit:
uv run pre-commit install
3. (Optional) Run Checks Manually
You can trigger the full suite of checks on all files at any time:
uv run pre-commit run --all-files
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_flakiness-0.9.0.tar.gz.
File metadata
- Download URL: pytest_flakiness-0.9.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f76664f1597613c145a9dd4f81fcd0d0af2a6a31ad2f07232050119ae0948ed7
|
|
| MD5 |
db1e33e7d668eb742758d8f5b380d9d5
|
|
| BLAKE2b-256 |
61655ef1065a43fd3d3b5e4b86d0c4e39ac65baf3b400bbc845f2ca624ad0f10
|
File details
Details for the file pytest_flakiness-0.9.0-py3-none-any.whl.
File metadata
- Download URL: pytest_flakiness-0.9.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90d255dca9a46bbfbe3c6bafce4a3b4642059b1a3c9ae751929ddbe8275f217f
|
|
| MD5 |
e4bb9855fcff00de2da2c5c1840bd431
|
|
| BLAKE2b-256 |
c1e679f9ad67c3afe0a2bf94ffbdeb50220f970c273bdba45188d26cb72a5924
|