-
Notifications
You must be signed in to change notification settings - Fork 15
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] refactor repetitive clone tests with pytest.mark.parametrize, fixes #170 #392
[ENH] refactor repetitive clone tests with pytest.mark.parametrize, fixes #170 #392
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Some comments:
- the tests
test_clone_none_and_empty_array
andtest_clone_nan_sparse_matrix
look like they could be merged - we should not import
sklearn
on module level to ensure soft dependency isolation. Could you leave that in the tests? - The
sklearn
tests do not look very similar, in fact the assertions are different, and the parameterization make the tests more difficult to read. Could you revert your changes to thesklearn
tests?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #392 +/- ##
==========================================
+ Coverage 85.07% 85.77% +0.70%
==========================================
Files 45 48 +3
Lines 3015 3311 +296
==========================================
+ Hits 2565 2840 +275
- Misses 450 471 +21 ☔ View full report in Codecov by Sentry. |
for more information, see https://pre-commit.ci
Hi @fkiraly , i have made changes according to your comments please review it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I will start the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just reviewing, and it seems the new tests do not exactly test the same:
- in the case of
np.array
, it is fine to useassert_array_equal
to check for equality in value - in the other two cases we need to check identity, as in the tests before, using
is
The difference is whether the object in question is an np.ndarray
.
could you ensure the logic is identical to what was there before? That is, in the test using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it quickly - was only a small thing - and added you to the contributors file.
Thanks a lot!
Thank you so much! |
Reference Issues/PRs
Fixes #170
What does this implement/fix? Explain your changes.
refactored repetitive clone tests with pytest.mark.parametrize
Does your contribution introduce a new dependency? If yes, which one?
No
What should a reviewer concentrate their feedback on?
Any other comments?
PR checklist
For all contributions
the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions