Skip to content

Commit bda252b

Browse files
authored
Require R 4.1 (#2101)
1 parent d947142 commit bda252b

File tree

13 files changed

+18
-30
lines changed

13 files changed

+18
-30
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ License: MIT + file LICENSE
1515
URL: https://testthat.r-lib.org, https://github.com/r-lib/testthat
1616
BugReports: https://github.com/r-lib/testthat/issues
1717
Depends:
18-
R (>= 3.6.0)
18+
R (>= 4.1.0)
1919
Imports:
2020
brio (>= 1.1.3),
2121
callr (>= 3.7.3),

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# testthat (development version)
22

3+
* testthat now requires R 4.1.
34
* `expect_s4_class()` now supports unquoting (@stibu81, #2064).
45
* `it()` now finds the correct evaluation environment in more cases (@averissimo, #2085).
56
* Fixed an issue preventing compilation from succeeding due to deprecation / removal of `std::uncaught_exception()` (@kevinushey, #2047).

R/snapshot-cleanup.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ snapshot_expected <- function(
6464
}
6565

6666
dir_contains <- function(paths, expected_files) {
67-
map_lgl(paths, ~ any(file.exists(file.path(.x, expected_files))))
67+
map_lgl(paths, \(path) any(file.exists(file.path(path, expected_files))))
6868
}

tests/testthat/_snaps/R4.0/snapshot-file/version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/testthat/_snaps/R4.0/snapshot.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/testthat/test-expect-condition.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test_that("can capture Throwable conditions from rJava", {
7878

7979
test_that("capture correct trace_env (#1994)", {
8080
# This should fail, not error
81-
expect_failure(expect_error(stop("oops")) %>% expect_warning())
81+
expect_failure(expect_error(stop("oops")) |> expect_warning())
8282
expect_failure(expect_warning(expect_error(stop("oops"))))
8383
})
8484

tests/testthat/test-expect-equality.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ test_that("can control numeric tolerance", {
4242
expect_failure(expect_equal(x1, x2))
4343
expect_success(expect_equal(x1, x2, tolerance = 1e-5))
4444
expect_success(expect_equivalent(x1, x2, tolerance = 1e-5))
45+
4546
# with partial matching
46-
# we work around https://github.com/r-lib/testthat/issues/1188
47-
if (getRversion() < "3.6.0" && is.null(getOption("warnPartialMatchArgs"))) {
48-
options(warnPartialMatchArgs = FALSE)
49-
}
5047
withr::local_options(warnPartialMatchArgs = FALSE)
5148
expect_success(expect_equal(x1, x2, tol = 1e-5))
5249

tests/testthat/test-expect-no-condition.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ test_that("expect_no_* don't emit success when they fail", {
2727

2828
test_that("capture correct trace_env (#1994)", {
2929
# This should fail, not error
30-
expect_failure(expect_message({message("a"); warn("b")}) %>% expect_no_warning())
31-
expect_failure(expect_no_message({message("a"); warn("b")}) %>% expect_warning())
30+
expect_failure(expect_message({message("a"); warn("b")}) |> expect_no_warning())
31+
expect_failure(expect_no_message({message("a"); warn("b")}) |> expect_warning())
3232
})
3333

3434
test_that("unmatched conditions bubble up", {

tests/testthat/test-snapshot-file.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
test_that("expect_snapshot_file works", {
2-
skip_if_not(getRversion() >= "3.6.0")
32
expect_snapshot_file(
43
write_tmp_lines(letters),
54
"foo.r",
@@ -33,7 +32,6 @@ test_that("expect_snapshot_file works", {
3332

3433

3534
test_that("expect_snapshot_file works in a different directory", {
36-
skip_if_not(getRversion() >= "3.6.0")
3735
path <- withr::local_tempdir()
3836
withr::local_dir(path)
3937

tests/testthat/test-snapshot-reporter.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ test_that("basic workflow", {
1313
snapper <- local_snapshotter(path)
1414
snapper$start_file("snapshot-2")
1515
# output if not active (because test not set here)
16-
expect_snapshot_output("x") %>%
17-
expect_message("Can't save") %>%
16+
expect_snapshot_output("x") |>
17+
expect_message("Can't save") |>
1818
expect_output("[1] \"x\"", fixed = TRUE)
1919

2020
# warns on first creation

0 commit comments

Comments
 (0)