def test_default_attributes(monkeypatch):
    """Test the default attributes when no environment variables are set."""
    # pretend mpi4py is available
    monkeypatch.setattr(lightning.fabric.plugins.environments.mpi, "_MPI4PY_AVAILABLE", True)
    mpi4py_mock = MagicMock()
    with mock.patch.dict("sys.modules", {"mpi4py": mpi4py_mock}):
        env = MPIEnvironment()

    assert env._node_rank is None
    assert env._main_address is None
    assert env._main_port is None
    assert env.creates_processes_externally
Test the default attributes when no environment variables are set.
tests/tests_fabric/plugins/environments/test_mpi.py