Skip to content

Commit

Permalink
Add raising=False for delenv
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishree <[email protected]>
  • Loading branch information
athitten committed Jan 7, 2025
1 parent 159d8d4 commit 47e57b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/core/test_exp_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,15 @@ def test_log_dir_overrides(self, monkeypatch, tmp_path):
assert Path(tmp_path).exists()
assert Path(tmp_path / "test_no_name" / "default" / "957").exists()

monkeypatch.delenv(NEMO_ENV_VARNAME_VERSION)
monkeypatch.delenv(NEMO_ENV_VARNAME_VERSION, raising=False)
# Checks that use_datetime_version False toggle works
test_trainer = pl.Trainer(accelerator='cpu', enable_checkpointing=False, logger=False)
log_dir = exp_manager(test_trainer, {"exp_dir": str(tmp_path / "test_no_name"), "use_datetime_version": False})
assert log_dir.resolve() == (tmp_path / "test_no_name" / "default" / "version_0").resolve()
assert Path(tmp_path).exists()
assert Path(tmp_path / "test_no_name" / "default" / "version_0").exists()

monkeypatch.delenv(NEMO_ENV_VARNAME_VERSION)
monkeypatch.delenv(NEMO_ENV_VARNAME_VERSION, raising=False)
# Checks that use_datetime_version False toggle works and version increments
test_trainer = pl.Trainer(accelerator='cpu', enable_checkpointing=False, logger=False)
log_dir = exp_manager(test_trainer, {"exp_dir": str(tmp_path / "test_no_name"), "use_datetime_version": False})
Expand Down

0 comments on commit 47e57b2

Please sign in to comment.