-
-
Notifications
You must be signed in to change notification settings - Fork 26k
MAINT Adjust tests for numpydoc 1.2 #22287
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
glemaitre
merged 12 commits into
scikit-learn:main
from
thomasjpfan:new_numpy_doc_test_fix
Feb 11, 2022
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5aacb11
MAINT Adjust tests for numpydoc 1.2
thomasjpfan 3fe2cac
Merge remote-tracking branch 'upstream/main' into new_numpy_doc_test_fix
thomasjpfan 1b0115c
CLN Remove print
thomasjpfan 03badc9
CLN Better error for underline length
thomasjpfan 72cb141
Merge remote-tracking branch 'upstream/main' into new_numpy_doc_test_fix
thomasjpfan 9a9fa0c
CLN Remove pin
thomasjpfan a342efb
CLN Address comments
thomasjpfan bc2d157
Update sklearn/utils/_testing.py
thomasjpfan 255c2a9
Merge remote-tracking branch 'origin/main' into new_numpy_doc_test_fix
ogrisel 72e83d8
Merge remote-tracking branch 'upstream/main' into new_numpy_doc_test_fix
thomasjpfan 772f80c
TST Update test for new error message
thomasjpfan 7fd63d3
Merge branch 'main' into new_numpy_doc_test_fix
thomasjpfan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -370,7 +370,7 @@ def f_check_param_definition(a, b, c, d, e): | |
b: | ||
Parameter b | ||
c : | ||
Parameter c | ||
This is parsed correctly in numpydoc 1.2 | ||
d:int | ||
Parameter d | ||
e | ||
|
@@ -387,7 +387,7 @@ def f_bad_sections(self, X, y): | |
"""Function f | ||
|
||
Parameter | ||
---------- | ||
--------- | ||
a : int | ||
Parameter a | ||
b : float | ||
|
@@ -525,7 +525,9 @@ def fit(self, X, y): | |
) | ||
def test_check_docstring_parameters(mock_meta): | ||
pytest.importorskip( | ||
"numpydoc", reason="numpydoc is required to test the docstrings" | ||
"numpydoc", | ||
reason="numpydoc is required to test the docstrings", | ||
minversion="1.2.0", | ||
) | ||
|
||
incorrect = check_docstring_parameters(f_ok) | ||
|
@@ -546,8 +548,6 @@ def test_check_docstring_parameters(mock_meta): | |
"was no space between the param name and colon ('a: int')", | ||
"sklearn.utils.tests.test_testing.f_check_param_definition There " | ||
"was no space between the param name and colon ('b:')", | ||
"sklearn.utils.tests.test_testing.f_check_param_definition " | ||
"Parameter 'c :' has an empty type spec. Remove the colon", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In numpydoc 1.2, the |
||
"sklearn.utils.tests.test_testing.f_check_param_definition There " | ||
"was no space between the param name and colon ('d:int')", | ||
] | ||
|
@@ -602,20 +602,16 @@ def test_check_docstring_parameters(mock_meta): | |
"In function: " | ||
+ f"sklearn.utils.tests.test_testing.{mock_meta_name}." | ||
+ "predict_proba", | ||
"Parameters in function docstring have less items w.r.t. function" | ||
" signature, first missing item: X", | ||
"Full diff:", | ||
"- ['X']", | ||
"+ []", | ||
"potentially wrong underline length... ", | ||
"Parameters ", | ||
"--------- in ", | ||
], | ||
[ | ||
"In function: " | ||
+ f"sklearn.utils.tests.test_testing.{mock_meta_name}.score", | ||
"Parameters in function docstring have less items w.r.t. function" | ||
" signature, first missing item: X", | ||
"Full diff:", | ||
"- ['X']", | ||
"+ []", | ||
"potentially wrong underline length... ", | ||
"Parameters ", | ||
"--------- in ", | ||
], | ||
[ | ||
"In function: " + f"sklearn.utils.tests.test_testing.{mock_meta_name}.fit", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.