r-lib / testthat

An R 📦 to make testing 😀
https://testthat.r-lib.org
Other
887 stars 317 forks source link

optional praise #92

Closed gsee closed 10 years ago

gsee commented 11 years ago

Please consider adding an option to allow the user to turn off praise.

hadley commented 11 years ago

Do you want insults instead? ;)

gsee commented 11 years ago

hmm. That might be a handy feature too. The issue is that I'm using testthat outside of its intended use case. I'm checking files with it, and things like "you're a coding rockstar" do not make sense in that context.

AdamSpannbauer commented 5 years ago

This is a really old closed issue, but I'd also cast a vote to have optional praise. It might not be a popular opinion, but... I find the messages like "Your tests are super-duper!" more pandering than encouraging when my tests pass, and I find messages like "Programming is hard!" to be more frustrating than the actual failed test that prompted the message. This is, of course, a minor thing and can just be ignored, but if there was an easy way to turn off praise, I would.

This could be set at an environment level in tests/testthat.R with something like Sys.setenv("curmudgeon" = TRUE) or Sys.setenv("grinch" = TRUE) so that users not wanting praise are forced to self-reflect while setting the option.

I have implemented this in my fork of the project (using "grinch"), but I've held off opening a PR in case it's not a welcome addition.

gaborcsardi commented 5 years ago

tests/testthat.R is not used when running devtools::test(). Also, tests/testthat.R usually uses the check reporter, which does not praise.

You can actually turn praise off, by running the tests with something like

devtools::test(reporter = testthat::ProgressReporter$new(show_praise = FALSE))

so you could define a shortcut for this.

gaborcsardi commented 5 years ago

Also, you got lucky this time, but comments on closed issues are very often missed, so consider opening a new issue instead.