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

Provide a mechanism for retaining file #10

Closed
phillord opened this issue Feb 26, 2018 · 4 comments
Closed

Provide a mechanism for retaining file #10

phillord opened this issue Feb 26, 2018 · 4 comments

Comments

@phillord
Copy link

The default behaviour is nice for writing tests since everything is cleaned up afterwards. But painful if the tests fail -- it becomes hard to debug because it's not possible to see what is in the file that you've just deleted.

It would be nice to have a mechanism to stop file deletions after, say, a panic.

@L-as
Copy link
Contributor

L-as commented Mar 12, 2018

I don't think this is the desired behavior for every user, but I think making an environment variable for this would be nice. Something like RS_MKTEMP_ALWAYS_RELEASE maybe?

@phillord
Copy link
Author

Yes, that would work; I'd have to rerun tests after failure, so it's not quite as nice as non-deletion on unsuccessful exist, but it would be a lot easier than my current solution (changing the temp file constructor for a named one).

@L-as
Copy link
Contributor

L-as commented Mar 12, 2018

Can't you use the release method in stead of that?

@phillord
Copy link
Author

Oh, that prevents deletion. I had assumed that "release" was equivalent to the variable going out of scope, but I see from the example, that this is wrong. My apologies for the noise.

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

No branches or pull requests

2 participants