class_docstr: Test cases for diagnostics emitted by the Dynamo ONNX export code.
class_docstr_tok: ["Test","cases","for","diagnostics","emitted","by","the","Dynamo","ONNX","export","code","."]
code: def test_log_is_not_emitted_to_terminal_when_log_artifact_is_not_enabled(
      self,
  ):
      self.diagnostic_context.options.verbosity_level = logging.INFO
      with self.diagnostic_context:
          diagnostic = fx_diagnostics.Diagnostic(
              self.rules.rule_without_message_args, infra.Level.NONE
          )
  
          with self.assertLogs(
              diagnostic.logger, level=logging.INFO
          ) as assert_log_context:
              diagnostic.info("message")
              # NOTE: self.assertNoLogs only exist >= Python 3.10
              # Add this dummy log such that we can pass self.assertLogs, and inspect
              # assert_log_context.records to check if the log we don't want is not emitted.
              diagnostic.logger.log(logging.ERROR, "dummy message")
  
          self.assertEqual(len(assert_log_context.records), 1)
  
imports: from __future__ import annotations
  import contextlib
  import dataclasses
  import io
  import logging
  import typing
  import unittest
  from typing import AbstractSet, Protocol, Tuple
  import torch
  from torch.onnx import errors
  from torch.onnx._internal import diagnostics
  from torch.onnx._internal.diagnostics import infra
  from torch.onnx._internal.diagnostics.infra import formatter, sarif
  from torch.onnx._internal.fx import diagnostics
  from torch.testing._internal import common_utils, logging_utils
label_desc: Use image node_id 4 for calling the TestDynamoOnnxDiagnostics obj's underlying member method code with example usage: obj.test_log_is_not_emitted_to_terminal_when_log_artifact_is_not_enabled() without return types