Skip to content

Commit e3fad2a

Browse files
Fix CI: pylint too-many-public-methods and DuplicateFilter test bleed
- Add pylint disable for too-many-public-methods on TestOTLPSpanExporter (21 methods exceeds limit of 20, matching existing log exporter fix) - Reset DuplicateFilter state between log exporter tests via setUp() to prevent log suppression from 413 tests bleeding into test_export_no_collector_available
1 parent 1ffcda9 commit e3fad2a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

exporter/opentelemetry-exporter-otlp-proto-http/tests/test_proto_log_exporter.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
DEFAULT_LOGS_EXPORT_PATH,
3636
DEFAULT_TIMEOUT,
3737
OTLPLogExporter,
38+
_logger,
3839
)
3940
from opentelemetry.exporter.otlp.proto.http.version import __version__
4041
from opentelemetry.proto.collector.logs.v1.logs_service_pb2 import (
@@ -79,6 +80,13 @@
7980

8081

8182
class TestOTLPHTTPLogExporter(unittest.TestCase): # pylint: disable=too-many-public-methods
83+
def setUp(self):
84+
# Reset the DuplicateFilter between tests so that log suppression
85+
# from one test does not bleed into the next.
86+
for f in _logger.filters:
87+
if hasattr(f, "last_log"):
88+
f.last_log = None
89+
8290
def test_constructor_default(self):
8391
exporter = OTLPLogExporter()
8492

exporter/opentelemetry-exporter-otlp-proto-http/tests/test_proto_span_exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474

7575
# pylint: disable=protected-access
76-
class TestOTLPSpanExporter(unittest.TestCase):
76+
class TestOTLPSpanExporter(unittest.TestCase): # pylint: disable=too-many-public-methods
7777
def test_constructor_default(self):
7878
exporter = OTLPSpanExporter()
7979

0 commit comments

Comments
 (0)