def test_try_resume_from_non_existing_checkpoint(tmp_path):
    """Test that trying to resume from non-existing `ckpt_path` fails with an error."""
    model = BoringModel()
    trainer = Trainer(logger=False)

    with pytest.raises(FileNotFoundError, match="Checkpoint file not found"):
        trainer.fit(model, ckpt_path=str(tmp_path / "non_existing.ckpt"))
Test that trying to resume from non-existing `ckpt_path` fails with an error.
tests/tests_pytorch/models/test_restore.py