mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
263 stars 30 forks source link

Add check for data.table installation #263

Closed MichaelChirico closed 3 months ago

MichaelChirico commented 3 months ago

Found in the other test_that() units here, missing from this 3rd

MichaelChirico commented 3 months ago

BTW, is there any meaningful difference to skip_if_not_installed()?

https://github.com/mllg/checkmate/blob/aaaa16d38de39d8c38f2fb0d0f92842a612e14b2/tests/testthat/test_interoperability.R#L4

tdeenes commented 3 months ago

BTW, is there any meaningful difference to skip_if_not_installed()?

https://github.com/mllg/checkmate/blob/aaaa16d38de39d8c38f2fb0d0f92842a612e14b2/tests/testthat/test_interoperability.R#L4

skip_if_not_physically_installed does not try to load the namespace of the package, in contrary to testthat::skip_if_not_installed. Given that later in this test data.table::as.data.table is called which does load the data.table namespace, there is no difference in the actual outcome of the two skip_if_not... implementations.