[MRG + 1] [TST] (half-cosmetic) use less nose.tools import to simplify future transition to py.test#7384
Conversation
|
There is no new functionality here and changes are very simple, so I really believe it should me merged ASAP. The sooner it is merged, the less work would be required to cleanup those imports from other PRs |
|
My concern is the load on the core dev team to review, reflect on whether On 12 September 2016 at 06:59, Konstantin Podshumok <
|
|
I think @mblondel did something similar at some point and got some push-back. but then it was cosmetic, now it's actually quite useful to hide the source so we can move. |
|
May be I should extend this PR to full "Move to py.test" branch? Currently it is more or less cosmetic. But as I said above every new merged PR can introduce new nose imports, keeping it in actual state may not wroth it |
You have a good memory :) |
This would be quite useful. Could you rebase please? Also maybe add a [MRG] tag to the title if you happy for this to be merged. Even if new PR introduce new nose imports, this is still an improvement over the current state. |
amueller
left a comment
There was a problem hiding this comment.
Yeah I think this would be great to have.
| # Nose < 1.0.0 | ||
| SkipTest = unittest.case.SkipTest | ||
| except AttributeError: | ||
| # Python <= 2.6, we stil need nose here |
|
I think this would be good to merge ASAP. Please address the fact that we no longer support Python 2.6 (at master) |
|
Also please rebase. |
…eveloping test suites/runners
…string_values and one missed ImportError that should be replaced with AttributeError
although failed test will look a little bit ugly
6dba4c1 to
675b900
Compare
|
Thanks for rebasing ! Out of curiosity, is this PR supposed to remove all nose imports? I still see a few of them: I understand that Given the probability of conflicts with other changes, I would be fine leaving the nose imports for Python 2.6 and do the Python 2.6 support removal in a separate PR. |
|
Currently: imports in
Please note, that One thing I noticed during my work on this PR is active usage of Should we document guidelines about Can I remove py2.6 from |
|
I don't know what to do with externals.joblib.testing
Open an issue in the joblib repo. If the devs are in favor of moving to
py.test, make a PR there.
|
Yeah do that, I'd be more than favourable of using joblib for a test bed of moving to py.test. For completeness, sklearn/externals/joblib is always an unmodified release of joblib so it shouldn't be changed within scikit-learn. |
My personal preference would be to do the Python 2.6 support removal in a separate PR. There is quite a few things to remove not related to nose or testing (the OrderedDict backport jumps to mind) and single-purpose PR are far easier to merge. I think we should keep the .travis.yml Python 2.6 build but replace Python 2.6 by Python 2.7 in order to test old versions of dependencies. |
Those are imports are used to test if some sklearn's and noses's Even more, until we have a nose dependency there is a sense in extending them - after all, I introduced some new (untested) code... |
lesteve
left a comment
There was a problem hiding this comment.
LGTM, as I said above I am fine merging as is and removing the Python 2.6 support in a separate PR.
|
Thanks. Let's see where this'll bite us first ;) |
…y future transition to py.test (scikit-learn#7384) * use less nose.tools import to simplify future transition to activly developing test suites/runners * assert_equal -> assert_array_equal in test_feature_hasher_pairs_with_string_values and one missed ImportError that should be replaced with AttributeError * test for py2.6 compat with except AttributeError * fix importing of SkipTest * force using nose in python2.6 for now * there was no assert_dict_equal in py2.6. but we can use assert_equal although failed test will look a little bit ugly * remove nose imports from doc/datasets # Conflicts: # sklearn/neighbors/tests/test_dist_metrics.py # sklearn/utils/tests/test_fixes.py
…y future transition to py.test (scikit-learn#7384) * use less nose.tools import to simplify future transition to activly developing test suites/runners * assert_equal -> assert_array_equal in test_feature_hasher_pairs_with_string_values and one missed ImportError that should be replaced with AttributeError * test for py2.6 compat with except AttributeError * fix importing of SkipTest * force using nose in python2.6 for now * there was no assert_dict_equal in py2.6. but we can use assert_equal although failed test will look a little bit ugly * remove nose imports from doc/datasets
…y future transition to py.test (scikit-learn#7384) * use less nose.tools import to simplify future transition to activly developing test suites/runners * assert_equal -> assert_array_equal in test_feature_hasher_pairs_with_string_values and one missed ImportError that should be replaced with AttributeError * test for py2.6 compat with except AttributeError * fix importing of SkipTest * force using nose in python2.6 for now * there was no assert_dict_equal in py2.6. but we can use assert_equal although failed test will look a little bit ugly * remove nose imports from doc/datasets
Reference Issue
Contributing my experiments with ideas from #7319 issue
What does this implement/fix? Explain your changes.
Replaces most occasions of
import noseandfrom nose.tools importwithfrom sklearn.utils.testing importAny other comments?
For now we can't get rid of nosetests completely because numpy.testing is built on top of them and there is a lot of
numpy.testingimports.But with that and with strong recommendation to not import anything from
nosewe will be able to replace it as soon asnumpywill.Also, with this PR setting $NOSETESTS to pytest should just work without any significant code changes.