Skip to content

Commit 14c9080

Browse files
committed
Add test
1 parent ff66806 commit 14c9080

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def __init__(
180180
# Added for backward compatibility. Not recommended to directly access/use underlying exporter.
181181
@property
182182
def span_exporter(self):
183-
return self._batch_processor._exporter #pylint: disable=protected-access
183+
return self._batch_processor._exporter # pylint: disable=protected-access
184184

185185
def on_start(
186186
self, span: Span, parent_context: Context | None = None

opentelemetry-sdk/tests/trace/export/test_export.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ def test_simple_span_processor_not_sampled(self):
150150
# before the end of the test, otherwise the worker thread will continue
151151
# to run after the end of the test.
152152
class TestBatchSpanProcessor(unittest.TestCase):
153+
def test_get_span_exporter(self):
154+
exporter = MySpanExporter(destination=[])
155+
batch_span_processor = export.BatchSpanProcessor(exporter)
156+
self.assertEqual(exporter, batch_span_processor.span_exporter)
157+
153158
@mock.patch.dict(
154159
"os.environ",
155160
{

0 commit comments

Comments
 (0)