Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't muffle warnings.
Closes #254
  • Loading branch information
hadley committed Sep 29, 2015
1 parent 0a7d27b commit 6403639
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
@@ -1,5 +1,9 @@
# testthat 0.10.0.9000

* testthat no longer muffles warning messages. If you don't want to see them
in your output, you need to explicitly quiet them, or use an expectation that
captures them (e.g. `expect_warning()`). (#254)

* Use tests in `inst/tests` is formally deprecated. Please move them into
`tests/testthat` instead (#231).

Expand Down
3 changes: 1 addition & 2 deletions R/test-that.r
Expand Up @@ -58,8 +58,7 @@ test_code <- function(description, code, env) {
withCallingHandlers(
eval(code, new_test_environment),
error = capture_calls,
message = function(c) invokeRestart("muffleMessage"),
warning = function(c) invokeRestart("muffleWarning")
message = function(c) invokeRestart("muffleMessage")
),
error = function(e) {
ok <- FALSE
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-silence.R
Expand Up @@ -2,7 +2,5 @@ context("Silence")

test_that("Nothing to see here", {
message("YOU SHOULDN'T SEE ME")
warning("YOU SHOULDN'T SEE ME", immediate. = TRUE)

succeed()
})

0 comments on commit 6403639

Please sign in to comment.