This release is a pre-release and may not be stable for production use.
pytest-test-radar
pytest-test-radar is a pytest plugin designed to send test execution statistics to a centralized server. This allows teams to monitor flaky tests, track performance, and identify redundant or overly stable tests that might not be adding value to the test suite.
Features
- Collects test execution statistics, including:
- Test name
- Outcome (passed, failed, skipped)
- Execution duration
- Sends data to a configured HTTP endpoint.
- Easy integration with any centralized monitoring system.
Installation
You can install it to your project dependencies:
pip install pytest-test-radar
Usage
Run pytest with --radar-endpoint and --radar-token options to specify
the server URL and agent token:
pytest --radar-endpoint="http://your-server.com" --radar-token="ci_your_token_here"
You can also configure both via pyproject.toml:
[tool.pytest.ini_options]
radar_endpoint = "http://your-server.com"
radar_token = "ci_your_token_here"
# Optional
radar_include_setup = true # False by default; --radar-include-setup
The token is obtained from the Test Radar web UI when creating or regenerating
an agent for a project. It is sent as an Authorization: Token <token> header
with every request.
Example
Create a sample test file:
# test_sample.py
def test_pass():
assert 1 == 1
def test_fail():
assert 1 == 2
Run the tests with the plugin:
pytest test_sample.py --radar-endpoint="http://localhost:8000" --radar-token="ci_your_token_here"
Test results are accumulated and sent in batches to /api/v1/test_record/bulk_create/:
{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"started_at": "2024-01-01T12:00:00+00:00",
"environment": {
"os": "Linux",
"os_version": "6.6.0",
"arch": "x86_64"
},
"context": {
"branch": "main",
"commit_hash": "abc123def456"
},
"records": [
{
"label": "test_sample.py::test_pass",
"timestamp": "2024-01-01T12:00:00+00:00",
"logs": "",
"success": true
},
{
"label": "test_sample.py::test_fail",
"timestamp": "2024-01-01T12:00:00+00:00",
"logs": "KLUv/QBY...",
"success": false
}
]
}
The logs field for failed tests contains base64-encoded zstd-compressed traceback text.
Release files for pytest-test-radar 0.0.1a9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_test_radar-0.0.1a9.tar.gz | 33.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_test_radar-0.0.1a9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.0 kB
Release files / pytest_test_radar-0.0.1a9.tar.gz
| Download URL | pytest_test_radar-0.0.1a9.tar.gz |
|---|---|
| Size | 33.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8205e334d970497f9aca90bb6e781bddc42abcc75cc4724d60679828f3bd753a
|
|
BLAKE2b-256 checksum How to use checksums |
1d6ca9cfcca1adac70deb13a08a97953f411c454625410520d30b898f786c652
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.6 Darwin/25.6.0
|
Release files / pytest_test_radar-0.0.1a9-py3-none-any.whl
| Download URL | pytest_test_radar-0.0.1a9-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1cce96df2ab05ca12fd7006c1dba04685faccf2183018fbacc59d30990edd83c
|
|
BLAKE2b-256 checksum How to use checksums |
d59f3da669aa46dc070f29ee8c71cced61237f75df3c15d90246ee7d32ed0f32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.6 Darwin/25.6.0
|