Pytest plugin that streams Allure test results to Testtrain in real time
Project description
testtrain-pytest-allure
A pytest plugin that streams Allure test results to Testtrain in real time using allure-python-commons hooks.
Each test result — including steps, parameters, attachments, and defect links — is posted to the Testtrain API immediately after the test finishes, with no file scanning required.
Installation
pip install testtrain-pytest-allure
Usage
pytest \
--testtrain-url=http://localhost:3000 \
--testtrain-auth-token=your-token \
--alluredir=allure-results \
--testtrain-run-id=testrun-id
The plugin activates automatically when all three --testtrain-* options are provided.
Environment variables
You can provide the Testtrain settings via environment variables instead of command-line options. The plugin prefers CLI options but will fall back to env vars when options are not given.
export TESTTRAIN_RUN_ID="your-run-uuid"
export TESTTRAIN_AUTH_TOKEN="your-token"
export TESTTRAIN_URL="https://testtrain.io" # Optional (defaults to https://testtrain.io)
Run pytest normally (use -s to show plugin logs):
pytest -k <one_test> -s
Options
| Option | Description |
|---|---|
--testtrain-url |
Testtrain platform base URL |
--testtrain-auth-token |
Bearer token for API authentication |
--testtrain-run-id |
UUID of an existing testrun to report results to |
How It Works
The plugin registers a listener into allure_commons.plugin_manager that implements the report_result hook. When Allure finalises a test (after teardown), the listener:
- Maps the
TestResultobject (status, steps, parameters, links) to the Testtrain API schema. - Collects any in-memory attachment data captured during the test run.
- Sends everything to
POST /api/tests(JSON or multipart when attachments are present). - Retries up to 3 times on transient errors with exponential back-off.
- Stops the test session if all retries fail.
Development
cd plugins/testtrain-pytest-allure
uv sync
uv run pytest tests/
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 testtrain_pytest_allure-1.0.0b20.tar.gz.
File metadata
- Download URL: testtrain_pytest_allure-1.0.0b20.tar.gz
- Upload date:
- Size: 36.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ac1869990dc6ed8b52a8c9790d9101de331bbe908c71f58096c8af48ea13a88
|
|
| MD5 |
e91791dbcbfe01d2a3a267b0bc55b822
|
|
| BLAKE2b-256 |
cc4a1d576face84a1aca9cf476ec2dd2e72150d3628da3d19b10d4629638ec03
|
Provenance
The following attestation bundles were made for testtrain_pytest_allure-1.0.0b20.tar.gz:
Publisher:
pypi-publish.yml on njxqlus/testtrain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
testtrain_pytest_allure-1.0.0b20.tar.gz -
Subject digest:
2ac1869990dc6ed8b52a8c9790d9101de331bbe908c71f58096c8af48ea13a88 - Sigstore transparency entry: 1306711906
- Sigstore integration time:
-
Permalink:
njxqlus/testtrain@5523dbe927edbec0ff91921f1d851aa5552a358d -
Branch / Tag:
refs/tags/1.0.0b20 - Owner: https://github.com/njxqlus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@5523dbe927edbec0ff91921f1d851aa5552a358d -
Trigger Event:
release
-
Statement type:
File details
Details for the file testtrain_pytest_allure-1.0.0b20-py3-none-any.whl.
File metadata
- Download URL: testtrain_pytest_allure-1.0.0b20-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c49d3e6fd5ab856704491e0a38a9d128e30412757d7b09e330f9920211973008
|
|
| MD5 |
c7a8d7d671f5f5d50464cc2fe3ee6a66
|
|
| BLAKE2b-256 |
9e58c2ca1af27c62847bed5080c782e1356a55564e95211219a71e782b3a2d98
|
Provenance
The following attestation bundles were made for testtrain_pytest_allure-1.0.0b20-py3-none-any.whl:
Publisher:
pypi-publish.yml on njxqlus/testtrain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
testtrain_pytest_allure-1.0.0b20-py3-none-any.whl -
Subject digest:
c49d3e6fd5ab856704491e0a38a9d128e30412757d7b09e330f9920211973008 - Sigstore transparency entry: 1306711933
- Sigstore integration time:
-
Permalink:
njxqlus/testtrain@5523dbe927edbec0ff91921f1d851aa5552a358d -
Branch / Tag:
refs/tags/1.0.0b20 - Owner: https://github.com/njxqlus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@5523dbe927edbec0ff91921f1d851aa5552a358d -
Trigger Event:
release
-
Statement type: