-
Notifications
You must be signed in to change notification settings - Fork 0
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
Move duplicate functions #145
base: develop
Are you sure you want to change the base?
Conversation
- Move custom `expect_` functions out of `dataset_test`, into R/test_functions.R so that R CMD check warnings are removed - Rename prefixes to `test_`
|
||
# Expected output | ||
tables <- c("traits", "locations", "contexts", "methods", "excluded_data", | ||
"taxonomic_updates", "taxa", "contributors") | ||
expect_no_error( | ||
expected_output <- | ||
purrr::map( | ||
tables, ~read_csv(sprintf("examples/Test_2023_8/output/%s.csv", .x), col_types = cols(.default = "c"))), | ||
info = "Reading in expected output tables" |
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.
Why delete? The info isn't helpful?
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.
It's using expect_no_error
from {testthat} which does not accept an info argument.
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.
Ok, but you also had a new function defined called expect_no_error
, which would overwrite the one from {test that}. Now it's renamed to test_ expect_no_error
, so perhaps isn't being used?
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.
Oh there shouldn't have been a new function defined called expect_no_error
; if there was- that's my bad!
I can't seem to find it though. I did a find and replace on test_
to test_expect_
before so theoretically I shouldn't have touched expect_no_error
.
@dfalster I should have explained clearer but basically |
Ok! |
dataset_test
andtests
#131expect_
functions out ofdataset_test
, into R/test_functions.R so that R CMD check warnings are removed (otherwise "no visible global function definition" warning comes up)test_expect_
to differentiate between customtestthat
functions and built-intestthat
functionsexpect_silent()
from {testthat} instead of writing a custom function because I'm not sure how to rewrite the function to capture messages on top of errors and warnings