def test_invalid_trigger_combination(tmp_path):
    """Test that a MisconfigurationException is raised if more than one of every_n_epochs, every_n_train_steps, and
    train_time_interval are enabled together."""
    with pytest.raises(MisconfigurationException, match=r".*Combination of parameters every_n_train_steps"):
        ModelCheckpoint(dirpath=tmp_path, every_n_train_steps=1, every_n_epochs=2)
    with pytest.raises(MisconfigurationException, match=r".*Combination of parameters every_n_train_steps"):
        ModelCheckpoint(train_time_interval=timedelta(minutes=1), every_n_epochs=2)
    with pytest.raises(MisconfigurationException, match=r".*Combination of parameters every_n_train_steps"):
        ModelCheckpoint(train_time_interval=timedelta(minutes=1), every_n_train_steps=2)

    # These should not fail
    ModelCheckpoint(dirpath=tmp_path, every_n_train_steps=0, every_n_epochs=3)
    ModelCheckpoint(dirpath=tmp_path, every_n_train_steps=4, every_n_epochs=0)
    ModelCheckpoint(dirpath=tmp_path, every_n_train_steps=0, every_n_epochs=0, train_time_interval=timedelta(minutes=1))
Test that a MisconfigurationException is raised if more than one of every_n_epochs, every_n_train_steps, and
    train_time_interval are enabled together.
tests/tests_pytorch/checkpointing/test_model_checkpoint.py