Skip to content

Commit

Permalink
typo III
Browse files Browse the repository at this point in the history
  • Loading branch information
milocress committed Jun 5, 2024
1 parent 6ed76b5 commit ef3f657
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 1 addition & 4 deletions tests/a_scripts/eval/test_eval_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 4 additions & 5 deletions tests/a_scripts/train/test_train_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit ef3f657

Please sign in to comment.