code: def pytest_ignore_collect(
      collection_path: pathlib.Path, config: pytest.Config
  ):
      """Hook to ignore tests that require optional dependencies."""
      outcome = yield
      if config.getoption("--ignore-requires-optional-deps"):
          if any(
              fnmatch.fnmatch(str(collection_path), pattern)
              for pattern in _REQUIRES_OPTIONAL_DEPS
          ):
              outcome.force_result(True)
  
imports: import fnmatch
  import pathlib
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: pytest_ignore_collect(collection_path, config) without return types