Skip to content
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

TST Fix leak in tmp folders in LFW test when pillow is missing #15676

Merged
merged 1 commit into from
Nov 20, 2019

Conversation

ogrisel
Copy link
Member

@ogrisel ogrisel commented Nov 20, 2019

I just noticed that sklearn/datasets/tests/test_lfw.py creates temporary folders that are not collected when the pillow/PIL package is not installed: this is because the teardown_module function is not called when SkipTest is raised in the setup_module function.

This PR fixes that by not creating the temp folders before we check for the presence of PIL.

@ogrisel ogrisel added the Bug label Nov 20, 2019
Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Might be nicer implemented as a pytest fixture, but okay.

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!

@rth rth changed the title [MRG] Fix leak in tmp folders in LFW test when pillow is missing TST Fix leak in tmp folders in LFW test when pillow is missing Nov 20, 2019
@rth rth merged commit e81884f into scikit-learn:master Nov 20, 2019
@ogrisel ogrisel deleted the fix-test-folders-leak branch November 20, 2019 11:07
@ogrisel
Copy link
Member Author

ogrisel commented Nov 20, 2019

Might be nicer implemented as a pytest fixture, but okay.

Indeed but I wanted a minimal quick fix.

@ogrisel
Copy link
Member Author

ogrisel commented Nov 20, 2019

@adrinjalali you might want to backport this to 0.22.X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants