Skip to content

Add warnings to test #2312

@jmnavarro

Description

@jmnavarro

Hi there!

We're working on some tests that have 3 possible outcomes: fail (green), error (red), and warning (orange).
Tests will fail only in case of errors but we want to report in the output both errors and warnings.

I've noticed there's a function for that:

testthat::testthat_warn("this is a warning")

but it's not exported, so when I invoke it, I get error Error: 'testthat_warn' is not an exported object from 'namespace:testthat'

Is there any workaround?

I'm happy to make a contribution making testthat_warn public, but first I want to make sure which is the best approach

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions