From d05ffff6da8984c746e1dcc5554686950dc5f2e7 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Fri, 24 Jul 2026 08:54:57 -0500 Subject: [PATCH] fix: use title in Experiment.from_title not found message Experiment.from_title previously referenced the built-in id() function in its assertion message, producing 'Experiment not found.'. Update the message to use the title parameter and tighten the existing test to verify the message content. Signed-off-by: Andrew White --- nemo_run/run/experiment.py | 2 +- test/run/test_experiment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nemo_run/run/experiment.py b/nemo_run/run/experiment.py index ba430413..c0b93a8a 100644 --- a/nemo_run/run/experiment.py +++ b/nemo_run/run/experiment.py @@ -291,7 +291,7 @@ def from_title( parent_dir = os.path.join(get_nemorun_home(), "experiments", title) exp_dir = _get_latest_dir(parent_dir) - assert os.path.isdir(exp_dir), f"Experiment {id} not found." + assert os.path.isdir(exp_dir), f"Experiment {title} not found." exp = cls._from_config(exp_dir) return exp diff --git a/test/run/test_experiment.py b/test/run/test_experiment.py index 4f160237..d750dca9 100644 --- a/test/run/test_experiment.py +++ b/test/run/test_experiment.py @@ -436,7 +436,7 @@ def test_from_title_nonexistent(temp_dir): mock_get_latest_dir.return_value = nonexistent_path # The assertion should fail because the directory doesn't exist - with pytest.raises(AssertionError): + with pytest.raises(AssertionError, match=f"Experiment {title} not found"): Experiment.from_title(title)