code: def test_interruptible(monkeypatch):
      """Test interruptible can be enabled with env variables and for GPU only."""
      with pytest.raises(ValueError, match="isn't supported yet"):
          CloudCompute("gpu", interruptible=True)
  
      monkeypatch.setenv("LIGHTNING_INTERRUPTIBLE_WORKS", "1")
      with pytest.raises(ValueError, match="supported only with GPU"):
          CloudCompute("cpu", interruptible=True)
  
      cloud_compute = CloudCompute("gpu", interruptible=True)
      assert hasattr(cloud_compute, "interruptible")
      # TODO: To be removed once the platform is updated.
      assert hasattr(cloud_compute, "preemptible")
  
file_path: pytorch-lightning/tests/tests_app/utilities/packaging/test_cloud_compute.py
imports: import pytest
  from lightning.app import CloudCompute
  from lightning.app.storage import Mount
label_desc: Use image node_id 6 for calling a global function with example usage: test_interruptible(monkeypatch) without return types