From c9850d1003eaf1961d7105e98674c3b95837a50b Mon Sep 17 00:00:00 2001 From: Li Jiang Date: Thu, 5 Mar 2026 08:55:59 +0000 Subject: [PATCH] Fix test_no_optuna reinstalling optuna at wrong version test_no_optuna() uninstalls optuna to test graceful handling, then reinstalls it. It was hardcoded to reinstall optuna==2.8.0 instead of the version range used elsewhere (>=2.8.0,<=3.6.1), leaving the test environment with a downgraded optuna for the rest of the CI run. This caused the saved dependency snapshot to incorrectly report optuna==2.8.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- test/tune/test_searcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tune/test_searcher.py b/test/tune/test_searcher.py index 9931047e6f..e49c1aa5c1 100644 --- a/test/tune/test_searcher.py +++ b/test/tune/test_searcher.py @@ -323,7 +323,7 @@ def test_no_optuna(): subprocess.check_call([sys.executable, "-m", "pip", "uninstall", "-y", "optuna"]) import flaml.tune.searcher.suggestion - subprocess.check_call([sys.executable, "-m", "pip", "install", "optuna==2.8.0"]) + subprocess.check_call([sys.executable, "-m", "pip", "install", "optuna>=2.8.0,<=3.6.1"]) def test_unresolved_search_space(caplog):