gpt4 book ai didi

r - testthat 模式用于长时间运行的测试

转载 作者:行者123 更新时间:2023-12-04 01:00:22 26 4
gpt4 key购买 nike

我有一堆测试,我不希望它们在 CRAN 检查或 Travis CI 构建期间运行。它们要么长时间运行,要么可能导致写入网络数据库的事务/并发冲突。将它们分开的方法(从 R CMD 检查测试中)最适合 testthat ?

我应该将这些测试放在单独的文件夹中吗?我应该标记他们的文件名并使用正则表达式吗? (例如,@Jeroen Using filter argument in test_package to skip tests)

http://cran.r-project.org/web/packages/policies.html :

Long-running tests and vignette code can be made optional for checking, but do ensure that the checks that are left do exercise all the features of the package.

最佳答案

如果你把它们放在 tests 内的另一个目录中,那么您仍然可以使用 test_dir() 手动测试它们,但它们不会与 test() 一起运行或 R CMD check .

例如R6 有一些手动测试:https://github.com/wch/R6/tree/master/tests

关于r - testthat 模式用于长时间运行的测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25595487/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com