inverted `skip_if` logic in 'skipping' vingette?

Open Beginner friendly
#2,348 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
r
Domain
documentation

Research direction

Update the vignettes/skipping.Rmd example at lines 65-66, starting by checking the current skip_if condition against the vignette's opt-in wording. Ensure the example skips slow tests unless RUN_SLOW_TESTS is set to true, while preserving the intended contrast with skip_if_not.

Written by the indexing model from the issue text.

Description

The skipping vignette shows

https://github.com/r-lib/testthat/blob/9b6f12b9f50c297b4b5f485f728a2a19305770eb/vignettes/skipping.Rmd#L65-L66

Unless I'm mistaken, this would cause the tests to be skipped if we say we want to run them.

To keep the opt-in phrasing (and show an example of skip_if versus skip_if_not, which is what the previous two show), something like

skip_if(Sys.getenv("RUN_SLOW_TESTS") != "true")

might do?

Dominant language
R
Stars
939
Forks
346
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/testthat

All issues in r-lib/testthat

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.