From ef3f6577dd3d2ef0f006091596002407ade61c17 Mon Sep 17 00:00:00 2001 From: Milo Cress Date: Wed, 5 Jun 2024 22:01:36 +0000 Subject: [PATCH] typo III --- tests/a_scripts/eval/test_eval_inputs.py | 5 +---- tests/a_scripts/train/test_train_inputs.py | 9 ++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/a_scripts/eval/test_eval_inputs.py b/tests/a_scripts/eval/test_eval_inputs.py index b1e88b2443..0ca5765a26 100644 --- a/tests/a_scripts/eval/test_eval_inputs.py +++ b/tests/a_scripts/eval/test_eval_inputs.py @@ -68,10 +68,7 @@ def test_optional_mispelled_params_raise_error( updated_param = param + '-mispelling' cfg[updated_param] = orig_value with pytest.raises(ValueError): - try: - main(cfg) - except: - pass + main(cfg) # restore configs. cfg = copy.deepcopy(old_cfg) diff --git a/tests/a_scripts/train/test_train_inputs.py b/tests/a_scripts/train/test_train_inputs.py index bfd7cf849a..5901d53e94 100644 --- a/tests/a_scripts/train/test_train_inputs.py +++ b/tests/a_scripts/train/test_train_inputs.py @@ -62,7 +62,9 @@ def cfg(self, foundry_dir: str) -> DictConfig: def test_misspelled_mandatory_params_fail(self, cfg: DictConfig) -> None: """Check that mandatory misspelled inputs fail to train.""" cfg.trai_loader = cfg.pop('train_loader') - with pytest.raises((omegaconf.errors.MissingMandatoryValue, TypeError)): + with pytest.raises( + (omegaconf.errors.MissingMandatoryValue, TypeError, ValueError), + ): main(cfg) def test_missing_mandatory_parameters_fail(self, cfg: DictConfig) -> None: @@ -113,10 +115,7 @@ def test_optional_misspelled_params_raise_error( updated_param = param + '-misspelling' cfg[updated_param] = orig_value with pytest.raises(ValueError): - try: - main(cfg) - except: - pass + main(cfg) # restore configs. cfg = copy.deepcopy(old_cfg)