-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: HDFStore tests don't clean up files after KeyboardInterrupt #2769
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
Comments
yup....test need to be run on a clean (non-empty) file in case of ctrl-c.....so if they fail or user interrupts then the .h5 are left behind..... how do you think we should handle this? |
Moving the cleanup to a try/finally around each test body would solve the problem. with ensure_cleanup(path):
foo |
cheating a bit, but seems to work...GH #2755 |
hmm. race condition if break occurs between closing of file and invocation of tearDown? sidenote - I usually squash back-and-forth commits with "git rebase -i" |
ok...back to context manager |
@y-p this should be closable as PR was merged in...ok? |
ok, thanks for fixing it. |
@jreback - oh, sorry. Go ahead and exercise your new and well-earned bit. :) |
thanks! |
Cleanup code exists in the
tearDown
method, but aKeyboardInterrupt
either doesn't run the
tearDown
, or maybe the file handle isn't closed sothe
os.remove
fails.One example which left behind a file in the root of the source tree.
The text was updated successfully, but these errors were encountered: