Skip to content

Conversation

@eschmidt42
Copy link
Owner

This pull request updates the test suite to improve its robustness and clarity by replacing the use of pytest.xfail in exception handling with more explicit assertions, and by modernizing import and parameter usage in utility tests. The changes make the tests stricter and more idiomatic, ensuring that expected failures are handled using pytest.raises or by simply passing, rather than marking them as expected failures.

Test robustness and exception handling improvements:

  • Replaced pytest.xfail with pytest.raises(NotImplementedError) in tests for unimplemented fit and predict methods in test_estimators.py, test_extratrees.py, test_gradientboostedtrees.py, and test_randomforest.py, making the tests fail if the error is not raised as expected. [1] [2] [3] [4]
  • Updated exception handling throughout the test suite (including test_split.py, test_split_objects.py, test_node.py, and test_scoring.py) to replace pytest.xfail with pass in branches where errors are expected, ensuring tests only fail when the error is not raised. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]

Utility test modernization:

  • Refactored tests/test_utils.py to use direct imports of parameter classes and enums, improved parameterization, and replaced pytest.xfail with direct assertions or pass statements for failed initializations, making the tests clearer and more maintainable. [1] [2]

@eschmidt42 eschmidt42 merged commit 2411a5f into main Aug 17, 2025
4 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.

2 participants