Repository navigation
Update vignette advice for migrating to {testthat} 3e - #2080
Merged
Merged
Conversation
hadley
reviewed
Jul 23, 2025
| ``` r | ||
| devtools::test(filter = "badtest", reporter = "check") | ||
| ``` | ||
| If you want to use `cat()` or `message()` for print-debugging test cases, then the best is to temporarily run tests sequentially, by changing the `Config` entry in `DESCRIPTION` or setting `Sys.setenv(TESTTHAT_PARALLEL = "false")`. |
Member
There was a problem hiding this comment.
Replaced this with a technique I just learned about.
Member
|
Thank you! |
schloerke
added a commit
to schloerke/testthat
that referenced
this pull request
Jul 25, 2025
* upstream/HEAD: (250 commits) Implement `expect_shape()` (r-lib#1469) Re-enable catch tests on windows (r-lib#2104) Move digest to suggests (r-lib#2105) Support emscripten in `skip_on_os()` (r-lib#2103) Add `skip_unless_r()` (r-lib#2094) Require R 4.1 (r-lib#2101) Allow unquoting first arg for `expect_s4_class()` (r-lib#2065) typo fix (r-lib#2051) Explicitly pass `parent.frame()` in `it()` (r-lib#2086) Update vignette advice for migrating to {testthat} 3e (r-lib#2080) New praise messages (r-lib#1974) move '!' outside aggregation (r-lib#2067) Handle deprecation of std::uncaught_exception() (r-lib#2097) perf: use `anyNA()` (r-lib#2058) Upkeep (r-lib#2099) Implement `mock_output_sequence()` (r-lib#2061) Increment version number to 3.2.3.9000 Increment version number to 3.2.3 Update CRAN comments Finish off r-lib#2046 ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have recently been working on migrating some packages from {testthat} 2e to 3e. This PR updates a few places in the vignettes where I got confused.
First is the behavior of
expect_equal(ignore_attr = TRUE). From what I can decipher from the history, this initially ignored the attributenames. However, now it appears to ignore all attributes just likeexpect_equivalent(). I'm not sure exactly when this change occurred since this functionality was migrated to {waldo}.xref: #1241, #1422, r-lib/waldo#97
Second is the advice for interactive debugging when the tests are configured to run in parallel. I wasn't able to use
browser()withCheckReporterbecause it still ran the tests in parallel. I was able to usebrowser()with theDebugReporter.