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

"testthat:::all_passed" method returns TRUE even when some tests fail #799

Closed
anirudhacharya opened this issue Sep 14, 2018 · 1 comment
Closed

Comments

@anirudhacharya
Copy link

While writing a test if I made a typo and used testthat instead of test_that( doc) it will fail the test, but calling all_passed on the test result will return TRUE.

For example if I write the test as follows -

testthat("sample", {
       expect_equal(1, 1)
   })

and run the test with res<-test_dir("R-package/tests/testthat") then it will fail with syntax errors, as expected, but calling testthat:::all_passed(res) will return TRUE.

@hadley
Copy link
Member

hadley commented Mar 28, 2019

I don't see the problem:

library(testthat)
testthat("sample", {
  expect_equal(1, 1)
})
#> Error in testthat("sample", {: could not find function "testthat"

Created on 2019-03-28 by the reprex package (v0.2.1.9000)

I suspect there is something else going on in your environment.

@hadley hadley closed this as completed Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants