Skip to content

added test for improving test coverage - #13137

Merged
qinhanmin2014 merged 1 commit into
scikit-learn:masterfrom
rajdeepd:test_coverage
Feb 13, 2019
Merged

qinhanmin2014 merged 1 commit into
scikit-learn:masterfrom
rajdeepd:test_coverage

Conversation

@rajdeepd

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

What does this implement/fix? Explain your changes.

Any other comments?

Comment thread sklearn/tests/test_base.py Outdated
from sklearn.utils.testing import ignore_warnings

from sklearn.base import BaseEstimator, clone, is_classifier
from sklearn.base import BaseEstimator, clone, is_classifier, \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we kinda prefer this style:

from sklearn.base import (BaseEstimator, clone, is_classifier,
    _first_and_last_element)

Comment thread sklearn/tests/test_base.py Outdated
def test_first_and_last_element():
numpy_array_input = np.array([1, 2, 3])
numpy_array_returned = _first_and_last_element(numpy_array_input)
assert_equal(numpy_array_returned[0], 1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please use simple assert instead.

@adrinjalali

Copy link
Copy Markdown
Member

Although it doesn't improve coverage on the non-external codebase, I don't see why not.

@jnothman

Copy link
Copy Markdown
Member

_first_and_last_element appears to be unused in the entire repository. Shouldn't we be removing it?

@adrinjalali

Copy link
Copy Markdown
Member

+1 to remove then.

@rajdeepd

Copy link
Copy Markdown
Contributor Author

@adrinjalali i will remove it then.

@rajdeepd
rajdeepd force-pushed the test_coverage branch 2 times, most recently from 44f06dc to 7ebfe18 Compare February 12, 2019 15:08
@rajdeepd

Copy link
Copy Markdown
Contributor Author

@jnothman removed the method

@qinhanmin2014 qinhanmin2014 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks @rajdeepd

@qinhanmin2014
qinhanmin2014 merged commit be5d3ea into scikit-learn:master Feb 13, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants