You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support XCTestExpectation creation APIs on XCTestCase from non-main threads
This matches a behavior change made in the Xcode copy of XCTest and allows tests which call `XCTestCase.expectation(description:)` — as well as other `XCTestCase` APIs that return an `XCTestExpectation` — to do so from any thread. This removes a previous requirement that tests call these APIs from the main thread, and it allows existing tests using them to adopt `async` without requiring `@MainActor`.
rdar://85344643
rdar://79163972
rdar://81024086
Copy file name to clipboardExpand all lines: Sources/XCTest/Public/Asynchronous/XCTestCase+Asynchronous.swift
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ public extension XCTestCase {
41
41
/// these environments. To ensure compatibility of tests between
42
42
/// swift-corelibs-xctest and Apple XCTest, it is not recommended to pass
43
43
/// explicit values for `file` and `line`.
44
+
// FIXME: This should have `@MainActor` to match Xcode XCTest, but adding it causes errors in tests authored pre-Swift Concurrency which don't typically have `@MainActor`.
0 commit comments