code: def test_propagation(
      caplog: _pytest.logging.LogCaptureFixture,
  ) -> None:
      optuna.logging._reset_library_root_logger()
      logger = optuna.logging.get_logger("optuna.foo")
  
      # Propagation is disabled by default.
      with caplog.at_level(logging.INFO, logger="optuna"):
          logger.info("no-propagation")
      assert "no-propagation" not in caplog.text
  
      # Enable propagation.
      optuna.logging.enable_propagation()
      with caplog.at_level(logging.INFO, logger="optuna"):
          logger.info("enable-propagate")
      assert "enable-propagate" in caplog.text
  
      # Disable propagation.
      optuna.logging.disable_propagation()
      with caplog.at_level(logging.INFO, logger="optuna"):
          logger.info("disable-propagation")
      assert "disable-propagation" not in caplog.text
  
file_path: optuna/tests/test_logging.py
imports: import logging
  import _pytest.capture
  import _pytest.logging
  import optuna.logging
label_desc: Use image node_id 4 for calling a global function with example usage: test_propagation(caplog) without return types