【问题标题】:Want Travis to fail on warnings in tests希望 Travis 在测试中出现警告失败
【发布时间】:2018-08-24 13:07:58
【问题描述】:

我在 R 中使用testthat,如果在测试中生成警告,我希望 travis 使我的构建失败。我有warnings_are_errors: true,但似乎在测试中生成的警告不会传播到那个级别。有没有办法设置这个?这是一个 build,通过了该测试并带有警告:

test_that("warnings cause travis to fail", { odd <- 1:2 * 1:5 expect_equal(length(odd), 5) })

【问题讨论】:

标签: r travis-ci testthat


【解决方案1】:

基于 this thread 和 testthat 作者,听起来目前没有一种简单的方法可以做到这一点,但他们会考虑在未来添加一个选项。这是GH issue 供将来参考。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-31
    • 2020-03-24
    • 1970-01-01
    • 1970-01-01
    • 2018-11-22
    • 2016-05-28
    • 2020-06-19
    • 1970-01-01
    相关资源
    最近更新 更多