File: test_entry_points.py

package info (click to toggle)
sentry-python 2.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,004 kB
  • sloc: python: 55,908; makefile: 114; sh: 111; xml: 2
file content (17 lines) | stat: -rw-r--r-- 525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import importlib
import os
from unittest.mock import patch

from opentelemetry import propagate
from sentry_sdk.integrations.opentelemetry import SentryPropagator


def test_propagator_loaded_if_mentioned_in_environment_variable():
    try:
        with patch.dict(os.environ, {"OTEL_PROPAGATORS": "sentry"}):
            importlib.reload(propagate)

            assert len(propagate.propagators) == 1
            assert isinstance(propagate.propagators[0], SentryPropagator)
    finally:
        importlib.reload(propagate)