-
Notifications
You must be signed in to change notification settings - Fork 62
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
Remove uses of is_testing()
#724
Conversation
I am having trouble with the tests similar to r-lib/mockery#57 and it looks like Gabor says that the |
The new testthat that has
|
It's taking a while for the new testthat to get on CRAN so let's do this instead:
|
|
||
old <- readBin(path, "raw", fs::file_size(path)) | ||
write_rds_test <- function(x, path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used in one test, but the function is called directly so I can't seem to mock it. If I do this:
local_mocked_bindings(write_rds = write_rds_test)
it does not mock the results when I call write_rds()
. Is that right?
@@ -5,7 +5,7 @@ test_that("non-existent file returns default data", { | |||
test_that("standard metadata is useful", { | |||
df <- data.frame(x = 1:10) | |||
path <- withr::local_tempfile() | |||
write_rds(df, path) | |||
write_rds_test(df, path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is where I am calling write_rds_test()
, that function used only here because I can't seem to mock write_rds()
if I call it directly.
Merge commit 'be3437462467c5fdf1eb70490787b09814382839' #Conflicts: # DESCRIPTION
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Closes #640