Skip to content

Commit a00a1e4

Browse files
Alex Botenocelotl
andauthored
tests: added missing tests (#2325)
A couple of the exporters were not being tested by the opentelemetry-exporter-otlp package tests. Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
1 parent 636262d commit a00a1e4

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

exporter/opentelemetry-exporter-otlp/tests/test_otlp.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,23 @@
1414

1515
import unittest
1616

17+
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import (
18+
OTLPLogExporter,
19+
)
1720
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
1821
OTLPSpanExporter,
1922
)
23+
from opentelemetry.exporter.otlp.proto.http.trace_exporter import (
24+
OTLPSpanExporter as HTTPSpanExporter,
25+
)
2026

2127

2228
class TestOTLPExporters(unittest.TestCase):
2329
def test_constructors(self):
24-
try:
25-
OTLPSpanExporter()
26-
except Exception: # pylint: disable=broad-except
27-
self.fail(
28-
"Unexpected exception raised when instantiating OTLPSpanExporter"
29-
)
30+
for exporter in [OTLPSpanExporter, HTTPSpanExporter, OTLPLogExporter]:
31+
try:
32+
exporter()
33+
except Exception: # pylint: disable=broad-except
34+
self.fail(
35+
f"Unexpected exception raised when instantiating {exporter.__name__}"
36+
)

0 commit comments

Comments
 (0)