Skip to main content

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-socket connects 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

pytest_otr-0.2.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_otr-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

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

Hashes for pytest_otr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bdc4e27a59ca59763bfc5315a641442ff7b11df84e1965420b359d5d4b57f719
MD5 40308680821d048c2efc8180624dd882
BLAKE2b-256 32cf4852842f073bebfba7d6df426e39eb85131c5e4a41dbda5137d0600b5f44

See more details on using hashes here.

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

Hashes for pytest_otr-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a875e1231e8c8907e789bd98c39d93c5d61dca83fc3e4235b464c2a179965138
MD5 d478940295ac917b37692a38d63cc44b
BLAKE2b-256 019d4b6b8ac5eb28ca25fab1b2021904e42c4bb5a49ca155969e5f96232339f3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page