Skip to content

MAINT make test_docstrings.py a regular test file#21899

Merged
ogrisel merged 1 commit intoscikit-learn:mainfrom
ogrisel:move-test_docstrings.py
Dec 6, 2021
Merged

MAINT make test_docstrings.py a regular test file#21899
ogrisel merged 1 commit intoscikit-learn:mainfrom
ogrisel:move-test_docstrings.py

Conversation

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

obj = getattr(estimator, method)
try:
obj_signature = signature(obj)
obj_signature = str(signature(obj))
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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