Skip to content

TST/CI Fixes import for hashing test for PyPy #15170

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
merged 10 commits into from
Oct 13, 2019

Conversation

thomasjpfan
Copy link
Member

Fixes error on master when running on pypy.

This is set to NOMRG, because the circleci config must be adjusted to run the pypy test on this PR.

@rth
Copy link
Member

rth commented Oct 10, 2019

Sorry @thomasjpfan didn't see your PR. It should have been fixed in 4ef679b on master this morning, but I guess using suppress is also a possibility (though I'm not very keen on silently ignoring import errors on all platforms).

@rth
Copy link
Member

rth commented Oct 10, 2019

Hmm, though I should have indeed checked it more carefully. Not sure why pytestmark with a local import is not enough (in your first commit). Maybe adding @fails_if_pypy for good measure on the test function would help? I need to re-create my pypy env, testing in CI is not very convenient right now...

@thomasjpfan
Copy link
Member Author

I tried that fix on master here: b03b34a and it didn't work on this PR.

@rth
Copy link
Member

rth commented Oct 10, 2019

pytest.importorskip maybe? A bit out of ideas on why this is happening there.. I am pretty sure doing local imports for PyPy was working fine in such cases elsewhere.

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

LGTM, once the Circle CI change is reverted. I don't really understand why we have to do all this..

@thomasjpfan
Copy link
Member Author

The fix was to remove the raises keyword in pytest.mark.skip. Now it skips the test 100% of the time when running in pypy.

@@ -580,7 +580,7 @@ def set_random_state(estimator, random_state=0):
reason='skipped on 32bit platforms')
skip_travis = pytest.mark.skipif(os.environ.get('TRAVIS') == 'true',
reason='skip on travis')
fails_if_pypy = pytest.mark.xfail(IS_PYPY, raises=NotImplementedError,
fails_if_pypy = pytest.mark.xfail(IS_PYPY,
Copy link
Member

Choose a reason for hiding this comment

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

Aww makes sense.

@thomasjpfan thomasjpfan changed the title [NOMRG] FIX Fixes import for pypy test [MRG] FIX Fixes import for pypy test Oct 12, 2019
Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks for taking time to get to the bottom of it @thomasjpfan !

@rth rth changed the title [MRG] FIX Fixes import for pypy test TST/CI Fixes import for hashing test for PyPy Oct 13, 2019
@rth rth merged commit fbfb4da into scikit-learn:master Oct 13, 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.

2 participants