code: def test_default_attributes():
      """Test the default attributes when no environment variables are set."""
      env = KubeflowEnvironment()
      assert env.creates_processes_externally
  
      with pytest.raises(KeyError):
          # MASTER_ADDR is required
          env.main_address
      with pytest.raises(KeyError):
          # MASTER_PORT is required
          env.main_port
      with pytest.raises(KeyError):
          # WORLD_SIZE is required
          env.world_size()
      with pytest.raises(KeyError):
          # RANK is required
          env.global_rank()
      assert env.local_rank() == 0
  
file_path: pytorch-lightning/tests/tests_fabric/plugins/environments/test_kubeflow.py
imports: import logging
  import os
  from unittest import mock
  import pytest
  from lightning.fabric.plugins.environments import KubeflowEnvironment
label_desc: Use image node_id 1 for calling a global function with example usage: test_default_attributes() without return types