pytest-otr
pytest plugin that streams test results in the Open Test Reporting (OTR) event-based XML format, maintained by the JUnit team.
Usage
pytest --otr-report events.xml
Or stream events live to a consumer on 127.0.0.1 (e.g. a listener daemon):
pytest --otr-socket 8080
Validate with the official CLI:
java -jar open-test-reporting-cli-0.2.7-standalone.jar validate events.xml
java -jar open-test-reporting-cli-0.2.7-standalone.jar html-report --output report.html events.xml
Status mapping
| pytest outcome | OTR status | notes |
|---|---|---|
| passed | SUCCESSFUL | |
| skipped | SKIPPED | reason = skip reason |
| failed (call) | FAILED | reason = longreprtext |
| failed (setup/teardown) | ERRORED | reason = longreprtext |
| xfail (failed as expected) | SKIPPED | reason = "xfail: ..." |
| xpass (unexpected pass) | FAILED | reason = "XPASS: ..." |
xpass with strict=True |
FAILED | reason = "[XPASS(strict)] ..." |
| collection error | ABORTED | container-level |
Captured stdout/stderr of each test is attached as <output> elements
under <attachments>.
Hierarchy: root session → file container → class container → test.
Known limitations
- Schema is still 0.2.x; output targets events-0.2.0.xsd.
--otr-socketconnects once at session start and fails with a warning (no report) if the consumer is not listening.
Development
pip install -e ".[test]"
python -m pytest tests/
License
Apache-2.0. OTR is a format specification of the JUnit team (ota4j-team/open-test-reporting), Apache-2.0.
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_otr-0.2.0.tar.gz.
File metadata
- Download URL: pytest_otr-0.2.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdc4e27a59ca59763bfc5315a641442ff7b11df84e1965420b359d5d4b57f719
|
|
| MD5 |
40308680821d048c2efc8180624dd882
|
|
| BLAKE2b-256 |
32cf4852842f073bebfba7d6df426e39eb85131c5e4a41dbda5137d0600b5f44
|
File details
Details for the file pytest_otr-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pytest_otr-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a875e1231e8c8907e789bd98c39d93c5d61dca83fc3e4235b464c2a179965138
|
|
| MD5 |
d478940295ac917b37692a38d63cc44b
|
|
| BLAKE2b-256 |
019d4b6b8ac5eb28ca25fab1b2021904e42c4bb5a49ca155969e5f96232339f3
|