brodieG / unitizer

Easy R Unit Tests
Other
39 stars 6 forks source link

`suppressWarnings` defeated when warning issued by print #249

Closed brodieG closed 2 years ago

brodieG commented 6 years ago

Because the unitizer print set-up is broken into two steps:

  1. evaluate expression
  2. if visible, display it

suppressWarnings can only handle step #1.

brodieG commented 2 years ago

This also true with the regular R prompt, so it's not a bug:

> print.blah <- function(x, ...) warning("blah")
> x <- structure(1, class='blah')
> suppressWarnings(x)
Warning message:
In print.blah(x) : blah