code: def test_register_invalid_logger():
      class LoggerWithoutInfoMethod:
          def warning(self, msg: str) -> None:
              print(msg)
  
      class LoggerWithoutWarningMethod:
          def info(self, msg: str) -> None:
              print(msg)
  
      class LoggerWithAttributeNotCallable:
          def __init__(self):
              self.info = 1
              self.warning = 2
  
      expected_error_message = (
          "Logger must provide 'info' and 'warning' method"
      )
  
      with pytest.raises(TypeError, match=expected_error_message):
          lgb.register_logger(LoggerWithoutInfoMethod())
  
      with pytest.raises(TypeError, match=expected_error_message):
          lgb.register_logger(LoggerWithoutWarningMethod())
  
      with pytest.raises(TypeError, match=expected_error_message):
          lgb.register_logger(LoggerWithAttributeNotCallable())
  
imports: import logging
  import numpy
  import pytest
  import lightgbm
label_desc: Use image node_id 2 for calling a global function with example usage: test_register_invalid_logger() without return types