Skip to content

Commit

Permalink
Merge pull request optuna#5214 from nabenabe0928/hotfix/fix-reproduci…
Browse files Browse the repository at this point in the history
…bility-issue-in-lightgbm

Skip the reproducibility tests for lightgbm
  • Loading branch information
c-bata authored Jan 31, 2024
2 parents 0253dea + faa6564 commit 53d8554
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions tests/artifacts_tests/test_boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
from typing import TYPE_CHECKING

import boto3
from moto import mock_s3
import pytest

from optuna.artifacts import Boto3ArtifactStore
from optuna.artifacts.exceptions import ArtifactNotFound


try:
from moto import mock_aws
except ImportError:
from moto import mock_s3 as mock_aws


if TYPE_CHECKING:
from collections.abc import Iterator

Expand All @@ -22,7 +27,7 @@

@pytest.fixture()
def init_mock_client() -> Iterator[tuple[str, S3Client]]:
with mock_s3():
with mock_aws():
# Runs before each test
bucket_name = "moto-bucket"
s3_client = boto3.client("s3")
Expand Down
8 changes: 5 additions & 3 deletions tests/integration_tests/lightgbm_tuner_tests/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_higher_is_better(self) -> None:
tuner = _BaseTuner(lgbm_params={"metric": metric})
assert not tuner.higher_is_better()

def test_get_booster_best_score__using_valid_names_as_str(self) -> None:
def test_get_booster_best_score_using_valid_names_as_str(self) -> None:
expected_value = 1.0

booster = mock.MagicMock(
Expand All @@ -173,7 +173,7 @@ def test_get_booster_best_score__using_valid_names_as_str(self) -> None:
val_score = tuner._get_booster_best_score(booster)
assert val_score == expected_value

def test_get_booster_best_score__using_valid_names_as_list(self) -> None:
def test_get_booster_best_score_using_valid_names_as_list(self) -> None:
unexpected_value = 0.5
expected_value = 1.0

Expand Down Expand Up @@ -331,7 +331,7 @@ def test_with_minimum_required_args(self) -> None:
assert "num_boost_round" not in runner.auto_options
assert runner.lgbm_kwargs["num_boost_round"] == 5

def test__parse_args_wrapper_args(self) -> None:
def test_parse_args_wrapper_args(self) -> None:
params: dict[str, Any] = {}
train_set = lgb.Dataset(None)
val_set = lgb.Dataset(None)
Expand Down Expand Up @@ -726,6 +726,7 @@ def test_optuna_callback(self) -> None:

assert callback_mock.call_count == 10

@pytest.mark.skip(reason="Fail since 28 Jan 2024. TODO(nabenabe0928): Fix here.")
def test_tune_best_score_reproducibility(self) -> None:
iris = sklearn.datasets.load_iris()
X_trainval, X_test, y_trainval, y_test = train_test_split(
Expand Down Expand Up @@ -1057,6 +1058,7 @@ def test_get_best_booster_with_error(self) -> None:
with pytest.raises(ValueError):
tuner3.get_best_booster()

@pytest.mark.skip(reason="Fail since 28 Jan 2024. TODO(nabenabe0928): Fix here.")
def test_tune_best_score_reproducibility(self) -> None:
iris = sklearn.datasets.load_iris()
X_trainval, X_test, y_trainval, y_test = train_test_split(
Expand Down

0 comments on commit 53d8554

Please sign in to comment.