Skip to content

TST: added ensure_clean file cleanup context manager for file based test #3103

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 1 commit into from
Mar 20, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Mar 20, 2013

avoids leaving temp files around if they are interrupted (during dev),
passes thru exceptions

idiom is:

with ensure_clean(path=None) as path:
     .....

rather than

try:
    ....
finally:
    os.remove(path)

@jreback
Copy link
Contributor Author

jreback commented Mar 20, 2013

@y-p pls have a look when u have a chance

@ghost
Copy link

ghost commented Mar 20, 2013

Looks fine. Preferably, PRs that touch many things at once should land
right at the start of a release cycle not near it's end, to allow time for hidden
issues to manifest in master before being shipped.

@jreback
Copy link
Contributor Author

jreback commented Mar 20, 2013

delay to 0.12....?

@jreback
Copy link
Contributor Author

jreback commented Mar 20, 2013

if we do that....need a small fix in test_frame/test_to_csv_dups_cols.....not removing the test file....

@ghost
Copy link

ghost commented Mar 20, 2013

no, this is ok to merge I think. better just go for it or you'll have to redo the whole
thing in two weeks due to conlict hell.

jreback added a commit that referenced this pull request Mar 20, 2013
TST: added ensure_clean file cleanup context manager for file based test
@jreback jreback merged commit a6db105 into pandas-dev:master Mar 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant