Skip to content

Migrate test_evaluations to pytest - #1444

Merged
PGijsbers merged 2 commits into
openml:mainfrom
anirudhsengar:migrate/test_evaluations
Oct 21, 2026
Merged

PGijsbers merged 2 commits into
openml:mainfrom
anirudhsengar:migrate/test_evaluations

Conversation

@anirudhsengar

Copy link
Copy Markdown
Contributor

Metadata

  • Reference Issue: Part of Migrate all unittests to pytest #1252
  • New Tests Added: Yes (migrated existing tests to pytest style)
  • Documentation Updated: No
  • Change Log Entry: "Migrate tests/test_evaluations to pytest-style tests"

Details

  • This PR migrates all test files in test_evaluations from unittest.TestCase-based tests to pure pytest-style tests.
  • test_evaluation_functions.py: Removed TestBase class inheritance and converted all class-based test methods to module-level test functions. Replaced self.assertSequenceEqual() with plain assert statements and converted the helper method _check_list_evaluation_setups to a standalone function. Tests that use the long_version option now access it directly via request.config.getoption("--long") instead of relying on the class-scoped fixture.
  • test_evaluations_example.py: Removed unittest.TestCase class structure and converted the test method to a standalone pytest function test_example_python_paper(). The overwrite_config_context pattern is preserved.
  • Server configuration (production vs. test) is now handled automatically by the with_server fixture in conftest.py, eliminating the need for explicit self.use_production_server() calls.
  • All assertions now use plain assert statements consistent with pytest best practices and the style already used in test_utils.
  • No functional changes to the OpenML evaluations API are introduced; only the test implementation is refactored.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 13:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@codecov-commenter

codecov-commenter commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.47%. Comparing base (c8e2aaf) to head (bbc4162).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1444      +/-   ##
==========================================
+ Coverage   53.40%   54.47%   +1.07%     
==========================================
  Files          63       63              
  Lines        5230     5230              
==========================================
+ Hits         2793     2849      +56     
+ Misses       2437     2381      -56     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PGijsbers
PGijsbers merged commit 2d65778 into openml:main Oct 21, 2026
61 of 66 checks passed
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.

4 participants