Skip to content

Move test_before_trial and test_after_trial_* to test_trial.py and test_study.py, respectively#6429

Merged
c-bata merged 1 commit intooptuna:masterfrom
y0z:feature/feature/pytest_samplers_subset
Feb 10, 2026
Merged

Move test_before_trial and test_after_trial_* to test_trial.py and test_study.py, respectively#6429
c-bata merged 1 commit intooptuna:masterfrom
y0z:feature/feature/pytest_samplers_subset

Conversation

@y0z
Copy link
Copy Markdown
Member

@y0z y0z commented Feb 9, 2026

Motivation & Description of the changes

This PR is a subset of #6424.
For clarity, I'm splitting the PR into two parts. In this PR, I moved the tests as follows.

  • test_before_trial -> test_trial.py
    • Since before_trial is called in Trial.
  • test_after_trial_* -> test_study.py

Copy link
Copy Markdown
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.

Thank you for your pull request!

My initial thought was that having test_before_trial and test_after_trial in separate test files felt a bit awkward to me. While I understand this matches the caller's structure, it feels too tied to implementation details.

That said, this is just a minor point. We should not spend much time on it, so let's move forward. LGTM!

@c-bata c-bata added this to the v4.8.0 milestone Feb 10, 2026
@c-bata c-bata merged commit 90c1a3b into optuna:master Feb 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Unit test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants