code: def test_verbosity_filter(app, status, warning):
      # verbosity = 0: INFO
      app.verbosity = 0
      logging.setup(app, status, warning)
      logger = logging.getLogger(__name__)
  
      logger.info("message1")
      logger.verbose("message2")
      logger.debug("message3")
  
      assert "message1" in status.getvalue()
      assert "message2" not in status.getvalue()
      assert "message3" not in status.getvalue()
      assert "message4" not in status.getvalue()
  
      # verbosity = 1: VERBOSE
      app.verbosity = 1
      logging.setup(app, status, warning)
      logger = logging.getLogger(__name__)
  
      logger.info("message1")
      logger.verbose("message2")
      logger.debug("message3")
  
      assert "message1" in status.getvalue()
      assert "message2" in status.getvalue()
      assert "message3" not in status.getvalue()
      assert "message4" not in status.getvalue()
  
      # verbosity = 2: DEBUG
      app.verbosity = 2
      logging.setup(app, status, warning)
      logger = logging.getLogger(__name__)
  
      logger.info("message1")
      logger.verbose("message2")
      logger.debug("message3")
  
      assert "message1" in status.getvalue()
      assert "message2" in status.getvalue()
      assert "message3" in status.getvalue()
      assert "message4" not in status.getvalue()
  
imports: import codecs
  import os
  import os.path
  import pytest
  from docutils import nodes
  from sphinx.errors import SphinxWarning
  from sphinx.testing.util import strip_escseq
  from sphinx.util import logging, osutil
  from sphinx.util.console import colorize
  from sphinx.util.logging import is_suppressed_warning, prefixed_warnings
  from sphinx.util.parallel import ParallelTasks
label_desc: Use image node_id 3 for calling a global function with example usage: test_verbosity_filter(app, status, warning) without return types