skillfed

opentelemetry-test-utils

Test utilities for OpenTelemetry unit tests

opentelemetry-test-utils v0.65b0 651.2K downloads/30d#5,552 on PyPI2,588
Permissive license Apache-2.0 Active released

What it is and what it does

OpenTelemetry Test Utils is a support package within the OpenTelemetry Python project that supplies test utilities and fixtures for writing unit tests. It is designed to help developers test OpenTelemetry instrumentation and SDK code by providing reusable testing helpers. The package depends on opentelemetry-api, opentelemetry-sdk, asgiref, and requests, making it part of the broader OpenTelemetry ecosystem.

This is a Beta-status package (Development Status :: 4 - Beta) that supports Python 3.10 through 3.14. It is maintained by the OpenTelemetry community and receives regular updates. The package is not intended as a standalone tool but rather as a dependency for projects that need to test their own OpenTelemetry instrumentation code.

Use it for:

  • Writing unit tests for custom OpenTelemetry instrumentation packages
  • Testing OpenTelemetry SDK extensions and exporters
  • Validating trace and metric collection in your instrumented application code
  • Setting up test fixtures for telemetry-related test suites

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides test utilities and helpers for writing unit tests for OpenTelemetry instrumentation and SDK code.

Yes, if you are developing OpenTelemetry instrumentation or testing SDK code. Install it as a test dependency (dev/test requirements) in projects that need to validate their own telemetry logic. Not needed for applications that only consume OpenTelemetry instrumentation.

Install

opentelemetry-test-utils on PyPI

pip

pip install opentelemetry-test-utils

uv

uv add opentelemetry-test-utils

poetry

poetry add opentelemetry-test-utils

Installing opentelemetry-test-utils

Before you install

Low install friction with a pure-Python wheel. Actively maintained as part of the OpenTelemetry project with a recent release (29 days ago) and active repository status.

License in practice

Licensed under Apache-2.0 (permissive), which allows free use, modification, and distribution with minimal restrictions.

Quickstart

pip install opentelemetry-test-utils

from opentelemetry_test_utils import ...
# Use test utilities in your test suite

Requires Python 3.10 or later; intended for use within test code, not production applications.

Verify before relying

  • What specific test utilities and fixtures are included in this package
  • Whether this package is intended for end-user testing or only for OpenTelemetry developers
  • Compatibility guarantees with specific versions of opentelemetry-api and opentelemetry-sdk

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — asgiref, opentelemetry-api, opentelemetry-sdk, requests
Maintenance actively maintained — 29 days since the last release
Last repo commit
First released
Downloads 651,231/month — #5,552 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opentelemetry_test_utils-0.65b0-py3-none-any.whl

Development Status :: 4 - BetaFramework :: OpenTelemetryIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

opentelemetry testing utilitiesotel test helpersopentelemetry unit test toolstelemetry test fixturesotel instrumentation testing
opentelemetrytestinginstrumentation

More Testing packages

pluggy

Pluggy provides a plugin system that lets you…

permissive · top 100 on PyPI

pytest

pytest is a testing framework that lets you…

permissive · top 100 on PyPI

virtualenv

virtualenv creates isolated Python environments…

permissive · top 100 on PyPI

coverage

Coverage.py measures which lines of Python code…

permissive · top 1,000 on PyPI

pytest-asyncio

pytest-asyncio is a pytest plugin that enables…

permissive · top 1,000 on PyPI

pytest-json-ctrf

A pytest plugin that generates test reports in…

permissive · top 1,000 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-distro

Provides a Python distribution package for…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-logging

Integrates Python's standard logging module…

permissive · top 1,000 on PyPI

opentelemetry-contrib-instrumentations

A meta-package that installs all OpenTelemetry…

permissive · top 15,000 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-instrumentation-exceptions

Automatically captures uncaught exceptions in…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-openai-agents-v2

Automatically captures telemetry data from…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-structlog

Integrates structlog logging with OpenTelemetry…

permissive · top 15,000 on PyPI