Skip to content

Optionally skip tests requiring 'mockr'#434

Closed
MichaelChirico wants to merge 1 commit intotidyverse:mainfrom
MichaelChirico:skip-mockr
Closed

Optionally skip tests requiring 'mockr'#434
MichaelChirico wants to merge 1 commit intotidyverse:mainfrom
MichaelChirico:skip-mockr

Conversation

@MichaelChirico
Copy link
Copy Markdown
Contributor

It would be simpler to add the skip() inside the helper:

with_mock <- function(..., .parent = parent.frame()) {
mockr::with_mock(..., .parent = .parent, .env = "googledrive")
}

But the tests would have to be rewritten a bit, e.g.

with_mock(
root_id = function() "",
{
out <- resolve_paths(as_dribble(x), ancestors)
}
)
expect_equal(out$path, "e")

Would probably become:

with_mock(
  root_id = function() "",
  expect_equal(resolve_paths(as_dribble(x), ancestors)$path, "e")
)

That format of test looks more natural to me anyway, but filing as is now pending feedback.

@jennybc
Copy link
Copy Markdown
Member

jennybc commented Jun 27, 2023

I've been removing mockr dependencies in favor of testthat::local_mocked_bindings(). Apparently I just haven't done so here yet. So I'm not going to take a change that touches this stuff in any other way; it's not worth fiddling with it.

@MichaelChirico
Copy link
Copy Markdown
Contributor Author

Makes sense! I'll leave this open for now in case it serves as a reminder, but feel free to close at any time.

@jennybc jennybc closed this in be516a9 Sep 6, 2025
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

Successfully merging this pull request may close these issues.

2 participants