Skip to content

Commit 618f3fa

Browse files
committed
Added a testthat helper to skip a test if it's not running within R CMD check, and bumped release version.
1 parent 9121b6e commit 618f3fa

4 files changed

Lines changed: 26 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: statnet.common
2-
Version: 4.12.0-496
3-
Date: 2025-05-29
2+
Version: 4.13.0-502
3+
Date: 2025-08-29
44
Title: Common R Scripts and Utilities Used by the Statnet Project Software
55
Authors@R: c(
66
person(c("Pavel", "N."), "Krivitsky", role=c("aut","cre"), email="pavel@statnet.org", comment=c(ORCID="0000-0002-9101-3362", affiliation="University of New South Wales")),
@@ -20,6 +20,7 @@ Suggests: covr,
2020
roxygen2,
2121
rlang (>= 1.1.1),
2222
purrr,
23+
testthat,
2324
MASS
2425
Remotes:
2526
krivit/roxygen2@anchor-sometimes

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export(set.control.class)
136136
export(set_diag)
137137
export(sginv)
138138
export(simplify_simple)
139+
export(skip_if_not_checking)
139140
export(snctrl)
140141
export(snctrl_names)
141142
export(snearPD)

R/test.utilities.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#' Skip a test if not called via `R CMD` [`check`]
3+
#'
4+
#' A \CRANpkg{testthat} predicate to skip tests if not run as a part
5+
#' of a package [check].
6+
#'
7+
#' @export
8+
skip_if_not_checking <- function() {
9+
testthat::skip_if_not(testthat::is_checking(), "not inside R CMD check")
10+
}

man/skip_if_not_checking.Rd

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)