Skip to main content

respan-instrumentation-pytest

An installable Pytest plugin that emits one canonical Respan workflow span for each test session and one task span for every test protocol. The test span remains current across setup, synchronous or asynchronous execution, and teardown, so application spans created by a test are nested beneath the correct test.

The plugin records pass, skip, xfail, setup failure, assertion failure, teardown failure, phase duration, parametrization, markers, and fixture names. Failures include OpenTelemetry error status plus backend-visible status_code and error.message fields.

Install and enable

pip install respan-ai respan-instrumentation-pytest
pytest --respan-tracing

Pytest discovers the package through its pytest11 entry point. It remains opt-in after installation so a globally installed plugin does not unexpectedly export every test run. Enable it in CI with:

RESPAN_PYTEST_ENABLED=true pytest

The usual RESPAN_API_KEY and optional RESPAN_BASE_URL variables configure export. Configuration can also live in pytest.ini:

[pytest]
respan_tracing = true
respan_capture_content = true
respan_workflow_name = checkout_integration_tests

Equivalent environment variables are RESPAN_PYTEST_ENABLED, RESPAN_PYTEST_CAPTURE_CONTENT, and RESPAN_PYTEST_WORKFLOW_NAME.

Content capture

By default, test parameters, fixture names, markers, and failure text are captured. Disable sensitive values with:

pytest --respan-tracing --no-respan-capture-content

With capture disabled, node IDs, outcomes, phase durations, and exception types remain visible while parameter values and failure messages are omitted. Fixture return values are never recorded. Each xdist worker creates its own session span with worker metadata. The lifecycle is idempotent.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respan_instrumentation_pytest-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

respan_instrumentation_pytest-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file respan_instrumentation_pytest-0.1.0.tar.gz.

File metadata

  • Download URL: respan_instrumentation_pytest-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Linux/6.17.0-35-generic

File hashes

Hashes for respan_instrumentation_pytest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3f3450b93a4a51782eb591aaeaacbb4f8b861fd2d011d45c13f0f207ae6c432f
MD5 70ae5227e8bc501904fb66b54cd6d71f
BLAKE2b-256 6a534ede5e7bac2814172d78f5ff6affd05950c6ef998ff177daa11a59c36c10

See more details on using hashes here.

File details

Details for the file respan_instrumentation_pytest-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for respan_instrumentation_pytest-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71b55cc5c3ac11d74156203c835a3243b87068ea5331e40a21403d8a3c3f604f
MD5 949da4881b967b0bef6a5204b21534c1
BLAKE2b-256 491c0b7489cf53141272e4ed8d5a6ec57a80bf57dde6fc012dc598d197ddeade

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page