Is it possible to determine test order in testthat?

前端 未结 1 1422
死守一世寂寞
死守一世寂寞 2021-01-01 23:39

I am using testthat to check the code in my package. Some of my tests are for basic functionality, such as constructors and getters. Others are for complex func

1条回答
  •  别那么骄傲
    2021-01-02 00:15

    To answer your question, I don't think it can be determined other than by having appropriate alphanumeric naming of your test-*.R files.

    From testthat source, this is the function which test_package calls, via test_dir, to get the tests:

    find_test_scripts <- function(path, filter = NULL, invert = FALSE, ...) {
      files <- dir(path, "^test.*\\.[rR]$", full.names = TRUE)
    

    What is wrong with just letting the complex task fail first, anyway?

    0 讨论(0)
提交回复
热议问题