def test_find_unused_parameters_ddp_exception():
    """Test that the DDP strategy can change PyTorch's error message so that it's more useful for Lightning users."""
    trainer = Trainer(accelerator="cpu", devices=1, strategy="ddp", max_steps=2, logger=False)
    with pytest.raises(RuntimeError, match="It looks like your LightningModule has parameters that were not used in"):
        trainer.fit(UnusedParametersModel())
Test that the DDP strategy can change PyTorch's error message so that it's more useful for Lightning users.
tests/tests_pytorch/strategies/test_ddp_integration.py