Skip to content

Commit

Permalink
Update error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
toshihikoyanase committed Oct 21, 2021
1 parent 00ba603 commit c5b9edd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion optuna/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,8 @@ def take_action(self, parsed_args: Namespace) -> None:
else:
if parsed_args.sampler_kwargs is not None:
raise ValueError(
"`--sampler_kwargs` is set without `--sampler`. Please specify `--sampler` as well."
"`--sampler_kwargs` is set without `--sampler`. Please specify `--sampler` as"
" well or omit `--sampler-kwargs`."
)

if parsed_args.search_space is not None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ def test_ask_sampler_kwargs_without_sampler() -> None:

result = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
error_message = result.stderr.decode()
assert "`sampler_kwargs` is set without `sampler`." in error_message
assert "`--sampler_kwargs` is set without `--sampler`." in error_message


def test_tell() -> None:
Expand Down

0 comments on commit c5b9edd

Please sign in to comment.