def test_root_gpu_property_0_raising(mps_count_0, cuda_count_0, devices):
    """Test that asking for a GPU when none are available will result in a MisconfigurationException."""
    with pytest.raises(MisconfigurationException, match="No supported gpu backend found!"):
        Trainer(accelerator="gpu", devices=devices, strategy="ddp")
Test that asking for a GPU when none are available will result in a MisconfigurationException.
tests/tests_pytorch/models/test_gpu.py