def METHOD_NAME(monkeypatch):
    """Test the default attributes when no environment variables are set."""
    if _using_pjrt():
        # calling these creates side effects in other tests
        if _XLA_GREATER_EQUAL_2_1:
            from torch_xla import runtime
            monkeypatch.setattr(runtime, "world_size", lambda: 2)
            monkeypatch.setattr(runtime, "global_ordinal", lambda: 0)
            monkeypatch.setattr(runtime, "local_ordinal", lambda: 0)
            monkeypatch.setattr(runtime, "host_index", lambda: 1)
        else:
            from torch_xla.experimental import pjrt
            monkeypatch.setattr(pjrt, "world_size", lambda: 2)
            monkeypatch.setattr(pjrt, "global_ordinal", lambda: 0)
            monkeypatch.setattr(pjrt, "local_ordinal", lambda: 0)
            os.environ["XRT_HOST_ORDINAL"] = "1"
    else:
        from torch_xla import _XLAC
        os.environ["XRT_SHARD_WORLD_SIZE"] = "2"
        os.environ["XRT_HOST_ORDINAL"] = "1"
        # avoid: "Cannot replicate if number of devices ... is different from ..."
        monkeypatch.setattr(_XLAC, "_xla_get_default_device", lambda: torch.device("xla:0"))
    env = XLAEnvironment()
    assert not env.creates_processes_externally
    assert env.world_size() == 2
    assert env.global_rank() == 0
    assert env.local_rank() == 0
    assert env.node_rank() == 1
    with pytest.raises(NotImplementedError):
        _ = env.main_address
    with pytest.raises(NotImplementedError):
        _ = env.main_port