A pytest plugin to send test statistics to Test Radar.
Project description
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 the --test-radar-endpoint option to specify the server where statistics will be sent:
pytest --test-radar-endpoint="http://your-server.com/api/test-results"
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 --test-radar-endpoint="http://localhost:8000/api/test-results"
This will send the following payload to the specified endpoint:
{
"total_tests": 2,
"results": [
{
"test_name": "test_sample.py::test_pass",
"outcome": "passed",
"duration": 0.001
},
{
"test_name": "test_sample.py::test_fail",
"outcome": "failed",
"duration": 0.002
}
]
}
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_test_radar-0.0.1a1.tar.gz.
File metadata
- Download URL: pytest_test_radar-0.0.1a1.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e5bbf1424e57dc0d8397feb9ae1d11a5ccdfbeca5e7afc3dfb09a03af1aab4c
|
|
| MD5 |
3cbc4985ad1d46c8a5d10d9631d1481b
|
|
| BLAKE2b-256 |
5592fc489fad624c852d407d080615317f72f0c1c0f83d2471b4a2a211e6106b
|
File details
Details for the file pytest_test_radar-0.0.1a1-py3-none-any.whl.
File metadata
- Download URL: pytest_test_radar-0.0.1a1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f601038108e34faa69ddb42bc90dbebdfb8bad01e21aa0ff062bdc79fea72a98
|
|
| MD5 |
155152e2239de0baa1884620b7b654aa
|
|
| BLAKE2b-256 |
7eabf18e7034d084acf7faefa7ab75d5a5cac042c48fd69658afa60d5f5710a9
|