From 91affe4f7ae8bf3c7f93b203071d0bc5c64f8f14 Mon Sep 17 00:00:00 2001 From: jerevoss Date: Fri, 30 Aug 2024 11:43:23 -0700 Subject: [PATCH] lint --- opentelemetry-sdk/tests/logs/test_export.py | 25 ++++++++++++++------ opentelemetry-sdk/tests/logs/test_handler.py | 2 +- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/opentelemetry-sdk/tests/logs/test_export.py b/opentelemetry-sdk/tests/logs/test_export.py index 43d9201077..9510ce2f7a 100644 --- a/opentelemetry-sdk/tests/logs/test_export.py +++ b/opentelemetry-sdk/tests/logs/test_export.py @@ -207,7 +207,9 @@ def test_simple_log_record_processor_different_msg_types(self): ] self.assertEqual(expected, emitted) - def test_simple_log_record_processor_different_msg_types_with_formatter(self): + def test_simple_log_record_processor_different_msg_types_with_formatter( + self, + ): self.maxDiff = None exporter = InMemoryLogExporter() log_record_processor = BatchLogRecordProcessor(exporter) @@ -217,9 +219,9 @@ def test_simple_log_record_processor_different_msg_types_with_formatter(self): logger = logging.getLogger("different_msg_types") handler = LoggingHandler(logger_provider=provider) - handler.setFormatter(logging.Formatter( - "%(name)s - %(levelname)s - %(message)s" - )) + handler.setFormatter( + logging.Formatter("%(name)s - %(levelname)s - %(message)s") + ) logger.addHandler(handler) logger.warning("warning message: %s", "possible upcoming heatwave") @@ -231,13 +233,22 @@ def test_simple_log_record_processor_different_msg_types_with_formatter(self): finished_logs = exporter.get_finished_logs() expected = [ - ("different_msg_types - WARNING - warning message: possible upcoming heatwave", "WARN"), - ("different_msg_types - ERROR - Very high rise in temperatures across the globe", "ERROR"), + ( + "different_msg_types - WARNING - warning message: possible upcoming heatwave", + "WARN", + ), + ( + "different_msg_types - ERROR - Very high rise in temperatures across the globe", + "ERROR", + ), ( "different_msg_types - CRITICAL - Temperature hits high 420 C in Hyderabad", "CRITICAL", ), - ("different_msg_types - WARNING - ['list', 'of', 'strings']", "WARN"), + ( + "different_msg_types - WARNING - ['list', 'of', 'strings']", + "WARN", + ), ("different_msg_types - ERROR - {'key': 'value'}", "ERROR"), ] emitted = [ diff --git a/opentelemetry-sdk/tests/logs/test_handler.py b/opentelemetry-sdk/tests/logs/test_handler.py index 6177b1b680..e8f70d6f5c 100644 --- a/opentelemetry-sdk/tests/logs/test_handler.py +++ b/opentelemetry-sdk/tests/logs/test_handler.py @@ -13,7 +13,7 @@ # limitations under the License. import logging import unittest -from unittest.mock import Mock, MagicMock +from unittest.mock import Mock from opentelemetry._logs import NoOpLoggerProvider, SeverityNumber from opentelemetry._logs import get_logger as APIGetLogger