Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT make test_docstrings.py a regular test file #21899

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

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

ogrisel
Copy link
Member

@ogrisel ogrisel commented Dec 6, 2021

I am not sure what was the original motivation to keep the test_docstrings.py file outside of the sklearn folder (under the maint_tools/ folder) but in retrospect I find it confusing.

I think it should be treated as a regular test file.

@@ -344,7 +344,7 @@ def repr_errors(res, estimator=None, method: Optional[str] = None) -> str:
if estimator is not None:
obj = getattr(estimator, method)
try:
obj_signature = signature(obj)
obj_signature = str(signature(obj))
Copy link
Member Author

@ogrisel ogrisel Dec 6, 2021

Choose a reason for hiding this comment

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

Note to reviewers: this change was needed to make mypy happier.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Removing test_docstring.sh is nice. I am happy with this change. LGTM

@jeremiedbb
Copy link
Member

The original motivation from @rth: "One point is that this needs numpydoc master, and generally I would rather see it as an optional linter than unit tests. Currently this validation is run in one of Azure CI jobs, maybe there is a better way to do it. The code style in the tests can also probably be improved."

I don't have a strong opinion but since we tend to include our consistency checks in the test suite I don't mind adding this one as well.

@ogrisel
Copy link
Member Author

ogrisel commented Dec 6, 2021

The original motivation from @rth: "One point is that this needs numpydoc master, and generally I would rather see it as an optional linter than unit tests. Currently this validation is run in one of Azure CI jobs, maybe there is a better way to do it. The code style in the tests can also probably be improved."

It's now using a released version of numpydoc. So at least that specific concern has been raised.

For the other points, I think having too much complexity in our CI setup is detrimental, both for maintenance and for understanding by users reading the report.

I checked in the Azure test report view that the tests are being executed as expected by the pylatest_pip_openblas_pandas config (they are skipped otherwise because numpydoc is not installed).

@ogrisel ogrisel merged commit b975c6f into scikit-learn:main Dec 6, 2021
@ogrisel ogrisel deleted the move-test_docstrings.py branch December 6, 2021 17:24
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants