Skip to content

Commit

Permalink
Fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Feb 14, 2024
1 parent 1ddd505 commit 41449c2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions opentelemetry-sdk/tests/logs/test_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ def test_log_record_emit_noop(self):
handler_mock._translate.assert_not_called()

def test_log_flush_noop(self):
emitter_provider_mock = Mock(spec=NoOpLoggerProvider)
logger = get_logger(logger_provider=emitter_provider_mock)

no_op_logger_provider = NoOpLoggerProvider()
no_op_logger_provider.force_flush = Mock()

logger = get_logger(logger_provider=NoOpLoggerProvider())

with self.assertLogs(level=logging.WARNING):
logger.warning("Warning message")

logger.handlers[0].flush()
no_op_logger_provider.force_flush.assert_not_called()

def test_log_record_no_span_context(self):
emitter_provider_mock = Mock(spec=LoggerProvider)
emitter_mock = APIGetLogger(
Expand Down

0 comments on commit 41449c2

Please sign in to comment.