Skip to content

Commit 5768b7e

Browse files
committed
fix unit test
1 parent c512273 commit 5768b7e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ For any change that affects end users of this package, please add an entry under
1111
If your change does not need a CHANGELOG entry, add the "skip changelog" label to your PR.
1212

1313
## Unreleased
14+
- Disable django instrumentation if DJANGO_SETTINGS_MODULE is not set
15+
([#549](https://github.com/aws-observability/aws-otel-python-instrumentation/pull/549))
1416
- Add Service and Environment dimensions to EMF metrics when Application Signals EMF export is enabled
1517
([#548](https://github.com/aws-observability/aws-otel-python-instrumentation/pull/548))
1618
- Add Resource and CFN Attributes for Bedrock AgentCore spans

aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelemetry_distro.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,21 @@ def test_configure_without_patches(self, mock_super_configure, mock_apply_patche
101101

102102
@patch("amazon.opentelemetry.distro.aws_opentelemetry_distro.get_aws_region")
103103
@patch("amazon.opentelemetry.distro.aws_opentelemetry_distro.is_agent_observability_enabled")
104+
@patch("amazon.opentelemetry.distro.aws_opentelemetry_distro.is_installed")
104105
@patch("amazon.opentelemetry.distro.aws_opentelemetry_distro.apply_instrumentation_patches")
105106
@patch("amazon.opentelemetry.distro.aws_opentelemetry_distro.OpenTelemetryDistro._configure")
106107
def test_configure_with_agent_observability_enabled(
107-
self, mock_super_configure, mock_apply_patches, mock_is_agent_observability, mock_get_aws_region
108+
self,
109+
mock_super_configure,
110+
mock_apply_patches,
111+
mock_is_installed,
112+
mock_is_agent_observability,
113+
mock_get_aws_region,
108114
):
109115
"""Test that _configure sets agent observability defaults when enabled"""
110116
mock_is_agent_observability.return_value = True
111117
mock_get_aws_region.return_value = "us-west-2"
118+
mock_is_installed.return_value = False # Mock Django as not installed to avoid interference
112119

113120
distro = AwsOpenTelemetryDistro()
114121
distro._configure()

0 commit comments

Comments
 (0)