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

local_mock() #856

Closed
jennybc opened this issue Mar 30, 2019 · 0 comments
Closed

local_mock() #856

jennybc opened this issue Mar 30, 2019 · 0 comments

Comments

@jennybc
Copy link
Member

@jennybc jennybc commented Mar 30, 2019

Most withr functions have a with_() variant and a local_() variant. The local_() variant is especially appealing with multi-line expressions, so you don't have to nest lots of logic inside the with_() call.

I would like a similar alternative for with_mock() inside a test, i.e. the ability to put a local_mock() in place that will be cleared when it goes out of scope. Is that possible?

@hadley hadley added the feature label Apr 1, 2019
@hadley hadley added this to the testthat 2.1.0 milestone Apr 1, 2019
@hadley hadley closed this in c5ae6a8 Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants