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

[ENH] parametrize_with_checks utility for granular API compliance test setup in 2nd/3rd party libraries #6588

Merged
merged 9 commits into from
Jun 20, 2024

Conversation

fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Jun 13, 2024

This PR adds a paramterize_with_checks decorator utility for granular test setup of API compliance tests in 2nd/3rd party libraries.

It is a pytest decorator, inspired by the sklearn utility of the same name.

Maintainers of third party libraries can use this with the following pattern to set up tests granular by test name:

@parametrize_with_checks([NaiveForecaster, ExponentialSmoothing])
def test_sktime_compatible_estimators(obj, test_name):
    check_estimator(obj, tests_to_run=test_name, raise_exceptions=True)

Supports both classes and instances, and all object types supported by check_estimator.
In case of classes, get_test_params is used to generate instances.

@fkiraly fkiraly added module:tests test framework functionality - only framework, excl specific tests enhancement Adding new functionality labels Jun 13, 2024
@fkiraly fkiraly changed the title [ENH] parametrize_with_checks utility for granular test setup in 2nd/3rd party libraries [ENH] parametrize_with_checks utility for granular API compliance test setup in 2nd/3rd party libraries Jun 13, 2024
@fkiraly
Copy link
Collaborator Author

fkiraly commented Jun 17, 2024

FYI @felipeangelimvieira, @Tveten

@fkiraly fkiraly merged commit a1163c3 into main Jun 20, 2024
46 checks passed
@fkiraly fkiraly deleted the parametrize_with_checks branch June 20, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding new functionality module:tests test framework functionality - only framework, excl specific tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant