Skip to content

Commit

Permalink
Add back testthat scopeing
Browse files Browse the repository at this point in the history
  • Loading branch information
F-Noelle committed May 28, 2024
1 parent af7c4cd commit 5a710c8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/expect_lint.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ expect_lint <- function(content, checks, ..., file = NULL, language = "en") {
wrong_number_fmt <- "got %d lints instead of %d%s"
if (is.null(checks)) {
msg <- sprintf(wrong_number_fmt, n_lints, length(checks), lint_str)
return(expect(n_lints %==% 0L, msg))
return(testthat::expect(n_lints %==% 0L, msg))
}

if (!is.list(checks) || !is.null(names(checks))) { # vector or named list
Expand All @@ -74,7 +74,7 @@ expect_lint <- function(content, checks, ..., file = NULL, language = "en") {

if (n_lints != length(checks)) {
msg <- sprintf(wrong_number_fmt, n_lints, length(checks), lint_str)
return(expect(FALSE, msg))
return(testthat::expect(FALSE, msg))
}

local({
Expand Down Expand Up @@ -110,7 +110,7 @@ expect_lint <- function(content, checks, ..., file = NULL, language = "en") {
call. = FALSE
)
}
expect(ok, msg)
testthat::expect(ok, msg)
})
},
lints,
Expand Down Expand Up @@ -138,8 +138,8 @@ expect_no_lint <- function(content, ..., file = NULL, language = "en") {
expect_lint_free <- function(...) {
require_testthat("expect_lint_free")

skip_on_cran()
skip_on_covr()
testthat::skip_on_cran()
testthat::skip_on_covr()

lints <- lint_package(...)
has_lints <- length(lints) > 0L
Expand All @@ -148,7 +148,7 @@ expect_lint_free <- function(...) {
if (has_lints) {
lint_output <- format(lints)
}
result <- expect(
result <- testthat::expect(
!has_lints,
paste0("Not lint free\n", lint_output)
)
Expand Down

0 comments on commit 5a710c8

Please sign in to comment.