Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for save_trial_user_attrs #702

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

toshihikoyanase
Copy link
Member

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code.
This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

save_trial_user_attrs was introduced to optuna/_app.py in #431. However, it lacks unit tests.

What does this implement/fix? Explain your changes.

  • Add test cases for save_trial_user_attrs to python_tests/test_api.py
    • Verify that user_attrs are saved correctly
    • Ensure it can handle an empty dictionary as invalid input

Copy link

codecov bot commented Nov 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6d0fef3) 64.00% compared to head (c1c6adc) 64.35%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #702      +/-   ##
==========================================
+ Coverage   64.00%   64.35%   +0.35%     
==========================================
  Files          35       35              
  Lines        2250     2250              
==========================================
+ Hits         1440     1448       +8     
+ Misses        810      802       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@c-bata c-bata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 I will merge this PR after passing CI.

@c-bata c-bata merged commit cd2159e into optuna:main Nov 17, 2023
14 checks passed
@toshihikoyanase toshihikoyanase deleted the add-save-trial-user-attrs-tests branch November 17, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants