code: def test_rich_progress_bar_import_error(monkeypatch):
      import lightning.pytorch.callbacks.rich_model_summary as imports
  
      monkeypatch.setattr(imports, "_RICH_AVAILABLE", False)
      with pytest.raises(
          ModuleNotFoundError,
          match="`RichModelSummary` requires `rich` to be installed.",
      ):
          RichModelSummary()
  
file_path: pytorch-lightning/tests/tests_pytorch/callbacks/test_rich_model_summary.py
imports: from typing import Any
  from unittest import mock
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import RichModelSummary, RichProgressBar
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.utilities.model_summary import summarize
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 2 for calling a global function with example usage: test_rich_progress_bar_import_error(monkeypatch) without return types