Skip to content

Commit

Permalink
omit dots if option testthat.summary.omit_dots is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Müller committed Jul 7, 2016
1 parent 8fa82bd commit 9da95a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion R/reporter-summary.R
Expand Up @@ -23,10 +23,12 @@ SummaryReporter <- R6::R6Class("SummaryReporter", inherit = Reporter,
warnings = NULL,
max_reports = getOption("testthat.summary.max_reports", 15L),
show_praise = TRUE,
omit_dots = FALSE,

initialize = function(show_praise = TRUE) {
initialize = function(show_praise = TRUE, omit_dots = getOption("testthat.summary.omit_dots")) {
super$initialize()
self$show_praise <- show_praise
self$omit_dots <- omit_dots
self$failures <- Stack$new()
self$skips <- Stack$new()
self$warnings <- Stack$new()
Expand All @@ -51,6 +53,10 @@ SummaryReporter <- R6::R6Class("SummaryReporter", inherit = Reporter,
self$skips$push(result)
} else if (expectation_warning(result)) {
self$warnings$push(result)
} else {
if (isTRUE(self$omit_dots)) {
return()
}
}

self$cat_tight(dot %||% single_letter_summary(result))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-reporter.R
Expand Up @@ -65,7 +65,7 @@ test_that("reporters produce consistent output", {
save_report("debug")
)
save_report("check", error_regexp = NULL)
save_report("summary", SummaryReporter$new(show_praise = FALSE))
save_report("summary", SummaryReporter$new(show_praise = FALSE, omit_dots = FALSE))
save_report("minimal")
save_report("tap")
save_report("teamcity")
Expand Down

0 comments on commit 9da95a7

Please sign in to comment.