280c4fb338bbb4cc967adfcc9714f05a606c6acf,tests/storages_tests/test_storages.py,,test_get_all_study_summaries,#Any#,546
Before Change
trial_id_2 = storage.create_new_trial(study_id)
storage.set_trial_value(trial_id_2, 2.0)
for key, value in EXAMPLE_ATTRS.items():
storage.set_study_user_attr(study_id, key, value)
summaries = storage.get_all_study_summaries()
assert len(summaries) == 1
assert summaries[0]._study_id == study_id
After Change
@pytest.mark.parametrize("storage_mode", STORAGE_MODES)
def test_get_all_study_summaries(storage_mode: str) -> None:
with StorageSupplier(storage_mode) as storage:
expected_summaries, _ = _setup_studies(storage, n_study=10, n_trial=10, seed=46)
summaries = storage.get_all_study_summaries()
assert len(summaries) == len(expected_summaries)
for summary in summaries:
expected_summary = expected_summaries[summary.study_id]
assert summary.study_id == expected_summary.study_id
assert summary.direction == expected_summary.direction
assert summary.datetime_start == expected_summary.datetime_start
assert summary.study_name == expected_summary.study_name
assert summary.n_trials == expected_summary.n_trials
assert summary.user_attrs == expected_summary.user_attrs
assert summary.system_attrs == expected_summary.system_attrs
if expected_summary.best_trial is not None:
assert summary.best_trial == expected_summary.best_trial
@pytest.mark.parametrize("storage_mode", STORAGE_MODES)
def test_get_trial(storage_mode: str) -> None:
with StorageSupplier(storage_mode) as storage:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances
Project Name: pfnet/optuna
Commit Name: 280c4fb338bbb4cc967adfcc9714f05a606c6acf
Time: 2020-04-29
Author: ytsmiling@gmail.com
File Name: tests/storages_tests/test_storages.py
Class Name:
Method Name: test_get_all_study_summaries
Project Name: pfnet/optuna
Commit Name: 754642db5ff35be98e4b6fc3a17823482881cb27
Time: 2020-04-29
Author: ytsmiling@gmail.com
File Name: tests/storages_tests/test_storages.py
Class Name:
Method Name: test_get_all_study_summaries
Project Name: tensorflow/datasets
Commit Name: 2b867a66ea0938ea281b5e6ea37ae3e18e15ae19
Time: 2018-12-04
Author: epot@google.com
File Name: tensorflow_datasets/testing/dataset_builder_testing.py
Class Name: TestCase
Method Name: test_download_and_prepare_as_dataset