Skip to content

Conditionally run tests if there is a testthat infrastructure #824

@krlmlr

Description

@krlmlr

I haven't found an "official" way to detect from outside if testing infrastructure is present: uses_testthat() is not exported. On the other hand, test() fails in non-interactive mode if no testing infrastructure is present. So there seems to be no way to run tests if they exist, and do nothing if they don't. Am I missing anything?

I see two solutions:

  1. Export uses_testthat()
  2. Don't fail in test() in non-interactive mode if no infrastructure is present.

Which is better?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions