Skip to content

Commit

Permalink
test: 'Resource.create' tolerates missing resource detector
Browse files Browse the repository at this point in the history
  • Loading branch information
cruisehall committed Dec 29, 2024
1 parent 2dbd4f4 commit a47ffe3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions opentelemetry-sdk/tests/resources/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,3 +800,11 @@ def test_resource_detector_entry_points_host(self):
resource = Resource({}).create()
self.assertIn(HOST_NAME, resource.attributes)
self.assertIn(HOST_ARCH, resource.attributes)

@patch.dict(
environ, {OTEL_EXPERIMENTAL_RESOURCE_DETECTORS: "doesnotexist,host"}, clear=True
)
def test_resource_detector_entry_points_tolerate_missing_detector(self):
resource = Resource({}).create()
self.assertIn(HOST_NAME, resource.attributes)
self.assertIn(HOST_ARCH, resource.attributes)

0 comments on commit a47ffe3

Please sign in to comment.