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.

Metadata

Release files for respan-instrumentation-pytest 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-instrumentation-pytest 0.1.1
File Size Uploaded
respan_instrumentation_pytest-0.1.1.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-pytest 0.1.1
File Interpreter ABI Platform
respan_instrumentation_pytest-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / respan_instrumentation_pytest-0.1.1.tar.gz

Download URL respan_instrumentation_pytest-0.1.1.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
636665ef8a57f5a49b4cddb18fa6d7fbd200a8528801c4f6ed651aaafceac838
BLAKE2b-256 checksum
How to use checksums
237b3c917ffb6557147c3508fe445a9e585b4469dfd2269deed01471d6666d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / respan_instrumentation_pytest-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_pytest-0.1.1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53473a25f9c5c842386f0da7acb67e208dd6bd2933b8fd18565b963cb3b6d622
BLAKE2b-256 checksum
How to use checksums
83e4070fc61a9152e6615152aad62e37826f10773d7a2f97b02f1541ba72d529
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release 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