Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionally run tests if there is a testthat infrastructure #824

Closed
krlmlr opened this issue May 29, 2015 · 2 comments · Fixed by #831
Closed

Conditionally run tests if there is a testthat infrastructure #824

krlmlr opened this issue May 29, 2015 · 2 comments · Fixed by #831

Comments

@krlmlr
Copy link
Member

krlmlr commented May 29, 2015

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?

@hadley
Copy link
Member

hadley commented May 29, 2015

I'd say export

@lock
Copy link

lock bot commented Sep 18, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants