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

Test with no expectation becomes a "skip" (problem for test_examples) #841

Closed
colearendt opened this issue Jan 30, 2019 · 2 comments
Closed
Labels
expectation 🙀 feature a feature request or enhancement

Comments

@colearendt
Copy link

colearendt commented Jan 30, 2019

When testthat runs a test_that with no expectations in it, the result is "Skipped." I think this behavior would preferably be "Passed", since the code was executed without error or skip().

In particular, this is certainly not correct behavior for test_examples(), which should not be expected to have an expectation. As a result, if we can change the behavior for test_example or test_examples() at least, that would be helpful!

Also, if we are not changing the default, is it possible that we could make the "Skip" note more informative? Something like Skipped: No expectation found. I found it quite confusing trying to debug why my tests were getting skipped, when they were in fact being executed but did not have an expectation.

Thanks!

@hadley hadley added feature a feature request or enhancement expectation 🙀 labels Mar 28, 2019
@hadley
Copy link
Member

hadley commented Mar 28, 2019

Two features:

  • skip_empty() should return a more informative message
  • test_example() should call test_code(..., skip_on_empty = FALSE)

@hadley
Copy link
Member

hadley commented Jul 19, 2019

First problem was #868

@hadley hadley closed this as completed in 4000f83 Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expectation 🙀 feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants