fix(docs): drop testthat from the whereInStack example (main) - #50
Merged
Conversation
The last line of the whereInStack example called
testthat::expect_error(findB3())
testthat is in Suggests, so under `_R_CHECK_DEPENDS_ONLY_` it is not on the
library path and R CMD check fails outright:
* checking examples ... ERROR
Error in loadNamespace(x) : there is no package called 'testthat'
* checking examples with --run-donttest ... ERROR
`try()` is a better fit regardless. The point of that line is to show the
reader that dynGet("b$a") fails because `b$a` is not an object name, and try()
prints the error where expect_error() swallowed it -- so the example now
demonstrates the thing it is describing, to every reader, whether or not they
have testthat installed. Verified it still errors identically:
Error in dynGet("b$a") : 'b$a' not found
Found by the nosuggests leg of PR #44's matrix, which is the first
`_R_CHECK_DEPENDS_ONLY_` check this package has ever had. Its tests now pass
there (FAIL 0 | SKIP 12 | PASS 82, the 9 image tests skipped by #46's guard);
this was the only remaining failure on that leg, and the last red square in an
otherwise green 11-leg matrix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011kpoQV6nNqcknk16R3RzBB
(cherry picked from commit 6035823)
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.
Cherry-pick (
-x) of6035823from #49, somainhas it before #44 lands.The
whereInStackexample ended withtestthat::expect_error(findB3()).testthatis in Suggests, so under_R_CHECK_DEPENDS_ONLY_it is not on the library path andR CMD checkfails:Replaced with
try(findB3())inR/plotting.Randman/whereInStack.Rd.try()is the better call anyway — the line exists to show thatdynGet("b$a")fails, andtry()prints that error whereexpect_error()swallowed it.Why it has to be on
mainThis is the last red square in #44's matrix. Run 33928053320, after #48 landed:
The
nosuggestsleg's tests already pass —FAIL 0 | SKIP 12 | PASS 82, the 9 image tests skipped by the guard from #46/#48. Only the examples check fails, and only for this one line.Verification
R/plotting.Randman/whereInStack.Rdon this branch are identical tofix/example-without-testthat(#49); the only differences between the two branches are the pre-existingmain/developmentdivergences (.Rbuildignore,CRAN-SUBMISSION,cran-comments.md,revdeps.yaml, DESCRIPTION version, theres =/resolution =split).As with #48, a PR into
maingets no R-CMD-check —main's current workflow triggers on[master, development]. Merge this, re-trigger #44, and that run is the verification.🤖 Generated with Claude Code
https://claude.ai/code/session_011kpoQV6nNqcknk16R3RzBB