【发布时间】:2017-08-21 11:31:24
【问题描述】:
我正在开发一个包 (this one),我在其中根据 testthat workflow 设置我的测试。这包括将我的测试放在./testthat/testthat/ 文件夹和./testthat/testthat.R 文件中,如下所示:
library(testthat)
library(rpostgisLT)
test_check("rpostgisLT")
所有测试都要求附加testthat 包(因此我没有使用testthat::function 引用。
在重新启动 R 之后(没有附加 testthat)我尝试运行 devtools::document() 但它中断了,因为它没有找到我在测试中使用的 testthat 函数。当然,附上testthat后devtools::document()跑通了。
为什么devtools::document() 会查看/tests 文件夹?不应该只记录/R文件夹中的函数吗?
【问题讨论】: