code: def test_change_level(caplog: pytest.LogCaptureFixture) -> None:
      caplog.set_level(logging.INFO)
      logger.debug("handler DEBUG level")
      logger.info("handler INFO level")
  
      caplog.set_level(logging.CRITICAL, logger=sublogger.name)
      sublogger.warning("logger WARNING level")
      sublogger.critical("logger CRITICAL level")
  
      assert "DEBUG" not in caplog.text
      assert "INFO" in caplog.text
      assert "WARNING" not in caplog.text
      assert "CRITICAL" in caplog.text
  
imports: import logging
  from typing import Iterator
  import pytest
  from _pytest.logging import caplog_records_key
  from _pytest.pytester import Pytester
label_desc: Use image node_id 3 for calling a global function with example usage: test_change_level(caplog) without return types