From 690fdb87ed8db5411ef80c0d041a188853cd7050 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Wed, 8 Jan 2025 14:54:18 -0600 Subject: [PATCH] Finish off #2046 * Add news bullet * Add explanatory comment --- NEWS.md | 2 ++ R/expect-no-condition.R | 2 ++ 2 files changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 393e9bf88..5c6efc566 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # testthat (development version) +* Fixed an issue where `expect_no_error(1)` was failing (#2037). + * Fixed an issue where calling `skip()` outside of an active test could cause an unexpected error (@kevinushey, #2039). diff --git a/R/expect-no-condition.R b/R/expect-no-condition.R index 8d87b2aec..02c42796e 100644 --- a/R/expect-no-condition.R +++ b/R/expect-no-condition.R @@ -98,6 +98,8 @@ expect_no_ <- function(base_class, try_fetch( { code + # We can't call succeed() here because that generates a condition + # that causes `expect_no_condition()` to always fail NULL }, !!base_class := function(cnd) {