def test_init_module_context(monkeypatch):
    """Test that the strategy returns the context manager for initializing the module."""

    fabric = Fabric(accelerator="cpu")
    strategy = SingleDeviceStrategy(device=torch.device("cuda"))
    strategy.module_init_context = Mock(wraps=strategy.module_init_context)
    fabric._strategy = strategy
    with fabric.init_module():
        pass
    strategy.module_init_context.assert_called_once_with(empty_init=None)
    strategy.module_init_context.reset_mock()
Test that the strategy returns the context manager for initializing the module.
tests/tests_fabric/test_fabric.py