From be6078cfd8edc49fe17cb3eccaceba68c890cf23 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Sat, 6 Dec 2025 13:19:52 -0500 Subject: [PATCH] Clean up expectations when done before stopping the test run --- Sources/XCTest/Public/XCTestCase.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/XCTest/Public/XCTestCase.swift b/Sources/XCTest/Public/XCTestCase.swift index 2d899b91..f296977e 100644 --- a/Sources/XCTest/Public/XCTestCase.swift +++ b/Sources/XCTest/Public/XCTestCase.swift @@ -141,6 +141,8 @@ open class XCTestCase: XCTest { let allExpectations = XCTWaiter.subsystemQueue.sync { _allExpectations } failIfExpectationsNotWaitedFor(allExpectations) + cleanUpExpectations() + testRun.stop() XCTCurrentTestCase = nil }