Skip to content

Commit 56707a8

Browse files
authored
Remove tidyverse conflicts (#2122)
These have been deprecated for >5 years. Fixes #2109
1 parent 5f6c810 commit 56707a8

File tree

5 files changed

+1
-93
lines changed

5 files changed

+1
-93
lines changed

NAMESPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,13 @@ export(is.expectation)
145145
export(is_a)
146146
export(is_checking)
147147
export(is_equivalent_to)
148-
export(is_false)
149148
export(is_identical_to)
150149
export(is_informative_error)
151150
export(is_less_than)
152151
export(is_more_than)
153-
export(is_null)
154152
export(is_parallel)
155153
export(is_snapshot)
156154
export(is_testing)
157-
export(is_true)
158155
export(it)
159156
export(local_edition)
160157
export(local_mock)
@@ -164,7 +161,6 @@ export(local_snapshotter)
164161
export(local_test_context)
165162
export(local_test_directory)
166163
export(make_expectation)
167-
export(matches)
168164
export(mock_output_sequence)
169165
export(new_expectation)
170166
export(not)

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+
* `is_null()`/`matches()` deprecated in 2.0.0 (2017-12-19) and `is_true()`/`is_false()` deprecated in 2.1.0 (2019-04-23) have been removed (#2109).
34
* `local_edition()` now gives a useful error for bad values (#1547).
45
* testthat now requires R 4.1.
56
* `expect_s4_class()` now supports unquoting (@stibu81, #2064).

R/old-school.R

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,12 @@
1414
#' @keywords internal
1515
NULL
1616

17-
#' @export
18-
#' @rdname oldskool
19-
is_null <- function() {
20-
warning(
21-
"`is_null()` is deprecated. Please use `expect_null()` instead.",
22-
call. = FALSE
23-
)
24-
function(x) expect_null(x)
25-
}
26-
2717
#' @export
2818
#' @rdname oldskool
2919
is_a <- function(class) {
3020
function(x) expect_is(x, class)
3121
}
3222

33-
#' @export
34-
#' @rdname oldskool
35-
is_true <- function() {
36-
function(x) {
37-
warning(
38-
"`is_true()` is deprecated. Please use `expect_true()` instead.",
39-
call. = FALSE
40-
)
41-
expect_true(x)
42-
}
43-
}
44-
45-
#' @export
46-
#' @rdname oldskool
47-
is_false <- function() {
48-
function(x) {
49-
warning(
50-
"`is_false()` is deprecated. Please use `expect_false()` instead.",
51-
call. = FALSE
52-
)
53-
expect_false(x)
54-
}
55-
}
56-
5723
#' @export
5824
#' @rdname oldskool
5925
has_names <- function(expected, ignore.order = FALSE, ignore.case = FALSE) {
@@ -127,17 +93,6 @@ throws_error <- function(regexp = NULL, ...) {
12793
function(x) expect_error(x, regexp, ...)
12894
}
12995

130-
#' @export
131-
#' @rdname oldskool
132-
matches <- function(regexp, all = TRUE, ...) {
133-
warning(
134-
"`matches()` is deprecated. Please use `expect_match()` instead.",
135-
call. = FALSE
136-
)
137-
function(x) expect_match(x, regexp, all = all, ...)
138-
}
139-
140-
14196
#' Does code take less than the expected amount of time to run?
14297
#'
14398
#' This is useful for performance regression testing.

man/oldskool.Rd

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

tests/testthat/test-old-school.R

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,9 @@
1-
test_that("old school logical works", {
2-
local_edition(2L)
3-
4-
expect_warning(
5-
expect_success(expect_that(TRUE, is_true())),
6-
"deprecated"
7-
)
8-
9-
expect_warning(
10-
expect_success(expect_that(FALSE, is_false())),
11-
"deprecated"
12-
)
13-
})
14-
151
test_that("old school types still work", {
162
local_edition(2L)
173

184
expect_success(expect_that(1L, is_a("integer")))
195
})
206

21-
test_that("tidyverse conflicts throw warnings", {
22-
local_edition(2L)
23-
24-
expect_warning(
25-
expect_that(NULL, is_null()),
26-
"deprecated"
27-
)
28-
29-
expect_warning(
30-
expect_that("te*st", matches("e*", fixed = TRUE)),
31-
"deprecated"
32-
)
33-
expect_warning(
34-
expect_that("test", matches("TEST", ignore.case = TRUE)),
35-
"deprecated"
36-
)
37-
})
38-
397
test_that("old school names still work", {
408
local_edition(2L)
419

0 commit comments

Comments
 (0)