def test_optional_misspelled_params_raise_error(
        self,
        cfg: DictConfig,
    ) -> None:
        """Check that warnings are raised for optional misspelled parameters."""
        optional_params = [
            'save_weights_only',
            'save_filename',
            'run_name',
            'progress_bar',
            'python_log_level',
            'eval_first',
            'autoresume',
            'save_folder',
            'fsdp_config',
            'lora_config',
            'eval_loader',
            'icl_tasks_config',
        ]
        old_cfg = copy.deepcopy(cfg)
        for param in optional_params:
            orig_value = cfg.pop(param, None)
            updated_param = param + '-misspelling'
            cfg[updated_param] = orig_value
            with pytest.raises(ValueError):
                train(cfg)
            # restore configs.
            cfg = copy.deepcopy(old_cfg)
Check that warnings are raised for optional misspelled parameters.
tests/a_scripts/train/test_train_inputs.py