From ddd171fe28b20070adccbeeade955eeb003a5048 Mon Sep 17 00:00:00 2001 From: Andres Cecilia Luque Date: Sat, 8 Aug 2026 03:13:20 +0200 Subject: [PATCH] Remove deprecation warnings from synchronous polling expectations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #1199 added @available(*, deprecated) annotations to all synchronous polling functions (toEventually, toEventuallyNot, toNotEventually, toNever, neverTo, toAlways, alwaysTo, waitUntil). These functions continue to work correctly for non-concurrent tests using QuickSpec — the async variants and AsyncSpec exist separately for concurrent test code. The deprecation warnings produce noise across large codebases that still rely on the synchronous API with no immediate migration path. See: https://github.com/Quick/Nimble/pull/1199#issuecomment-5223748618 --- Sources/Nimble/DSL+Wait.swift | 1 - Sources/Nimble/Polling.swift | 7 ------- 2 files changed, 8 deletions(-) diff --git a/Sources/Nimble/DSL+Wait.swift b/Sources/Nimble/DSL+Wait.swift index f42222b5f..bee3b73d7 100644 --- a/Sources/Nimble/DSL+Wait.swift +++ b/Sources/Nimble/DSL+Wait.swift @@ -105,7 +105,6 @@ public class NMBWait: NSObject { /// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function /// is executing. Any attempts to touch the run loop may cause non-deterministic behavior. @available(*, noasync, message: "the sync variant of `waitUntil` does not work in async contexts. Use the async variant as a drop-in replacement") -@available(*, deprecated, message: "the synchronous variant of `waitUntil` will be unavailable from Swift in a future release of Nimble. Please use the asynchronous variant as a near drop-in replacement.") public func waitUntil( timeout: NimbleTimeInterval = PollingDefaults.timeout, fileID: String = #fileID, diff --git a/Sources/Nimble/Polling.swift b/Sources/Nimble/Polling.swift index 19b12ea0c..794d9bbe1 100644 --- a/Sources/Nimble/Polling.swift +++ b/Sources/Nimble/Polling.swift @@ -172,7 +172,6 @@ extension SyncExpectation { /// This form of `toEventually` does not work in any kind of async context. Use the async form of `toEventually` if you are running tests in an async context. @discardableResult @available(*, noasync, message: "the sync variant of `toEventually` does not work in async contexts. Use the async variant as a drop-in replacement") - @available(*, deprecated, message: "the synchronous variant of `toEventually` will be unavailable from Swift in a future release of Nimble. Please use the asynchronous variant as a near drop-in replacement.") public func toEventually(_ matcher: Matcher, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self { nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue) @@ -206,7 +205,6 @@ extension SyncExpectation { /// Use the async form of `toEventuallyNot` if you are running tests in an async context. @discardableResult @available(*, noasync, message: "the sync variant of `toEventuallyNot` does not work in async contexts. Use the async variant as a drop-in replacement") - @available(*, deprecated, message: "the synchronous variant of `toEventuallyNot` will be unavailable from Swift in a future release of Nimble. Please use the asynchronous variant as a near drop-in replacement.") public func toEventuallyNot(_ matcher: Matcher, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self { nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue) @@ -242,7 +240,6 @@ extension SyncExpectation { /// Use the async form of `toNotEventually` if you are running tests in an async context. @discardableResult @available(*, noasync, message: "the sync variant of `toNotEventually` does not work in async contexts. Use the async variant as a drop-in replacement") - @available(*, deprecated, message: "the synchronous variant of `toNotEventually` will be unavailable from Swift in a future release of Nimble. Please use the asynchronous variant as a near drop-in replacement.") public func toNotEventually(_ matcher: Matcher, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self { return toEventuallyNot(matcher, timeout: timeout, pollInterval: pollInterval, description: description) } @@ -259,7 +256,6 @@ extension SyncExpectation { /// Use the async form of `toNever` if you are running tests in an async context. @discardableResult @available(*, noasync, message: "the sync variant of `toNever` does not work in async contexts. Use the async variant as a drop-in replacement") - @available(*, deprecated, message: "the synchronous variant of `toNever` will be unavailable from Swift in a future release of Nimble. Please use the asynchronous variant as a near drop-in replacement.") public func toNever(_ matcher: Matcher, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self { nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue) @@ -295,7 +291,6 @@ extension SyncExpectation { /// Use the async form of `neverTo` if you are running tests in an async context. @discardableResult @available(*, noasync, message: "the sync variant of `neverTo` does not work in async contexts. Use the async variant as a drop-in replacement") - @available(*, deprecated, message: "the synchronous variant of `neverTo` will be unavailable from Swift in a future release of Nimble. Please use the asynchronous variant as a near drop-in replacement.") public func neverTo(_ matcher: Matcher, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self { return toNever(matcher, until: until, pollInterval: pollInterval, description: description) } @@ -312,7 +307,6 @@ extension SyncExpectation { /// Use the async form of `toAlways` if you are running tests in an async context. @discardableResult @available(*, noasync, message: "the sync variant of `toAlways` does not work in async contexts. Use the async variant as a drop-in replacement") - @available(*, deprecated, message: "the synchronous variant of `toAlways` will be unavailable from Swift in a future release of Nimble. Please use the asynchronous variant as a near drop-in replacement.") public func toAlways(_ matcher: Matcher, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self { nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue) @@ -348,7 +342,6 @@ extension SyncExpectation { /// Use the async form of `alwaysTo` if you are running tests in an async context. @discardableResult @available(*, noasync, message: "the sync variant of `alwaysTo` does not work in async contexts. Use the async variant as a drop-in replacement") - @available(*, deprecated, message: "the synchronous variant of `alwaysTo` will be unavailable from Swift in a future release of Nimble. Please use the asynchronous variant as a near drop-in replacement.") public func alwaysTo(_ matcher: Matcher, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self { return toAlways(matcher, until: until, pollInterval: pollInterval, description: description) }