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

Eliminate on.exit() #1217

Closed
jennybc opened this issue Sep 16, 2020 · 0 comments
Closed

Eliminate on.exit() #1217

jennybc opened this issue Sep 16, 2020 · 0 comments
Labels
tooling 🔨 Internal usethis tooling

Comments

@jennybc
Copy link
Member

jennybc commented Sep 16, 2020

Eliminate all uses of on.exit() and consider shimming, like we've done with interactive() (steering usage towards is_interactive()). Context: when usage of on.exit() slips in, it clobbers cleanup scheduled with withr::local_*() functions, often at some distance. Using on.exit(add = TRUE, after = FALSE) "rescues" things, but it's even easier and more consistent to stay within the withr toolkit.

@jennybc jennybc added this to the v2.0.0 milestone Oct 28, 2020
@jennybc jennybc added the tooling 🔨 Internal usethis tooling label Oct 29, 2020
jennybc added a commit that referenced this issue Oct 30, 2020
Closes #1217
Closes #1125
Closes #1211

Notes:

  * The need to understand and fix #1125 came up incidentally, in the write_*() tests
  * testthat::local_mock() calls on.exit(), which clashed my new shim and I know I need to move away from the testthat mocking functions anyway; `with_mock()` fixes things up temporarily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling 🔨 Internal usethis tooling
Projects
None yet
Development

No branches or pull requests

1 participant