diff --git a/Modules/Account/Tests/AccountTests/TestAccountManager.swift b/Modules/Account/Tests/AccountTests/TestAccountManager.swift index 9cc1c13bd..2f035dbf1 100644 --- a/Modules/Account/Tests/AccountTests/TestAccountManager.swift +++ b/Modules/Account/Tests/AccountTests/TestAccountManager.swift @@ -16,9 +16,9 @@ import Secrets nonisolated static let shared = TestAccountManager() - var accountsFolder: URL { - return try! FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true) - } + // Not Caches: macOS puts a `group:everyone deny delete` ACE on it, so test accounts + // created there can't be removed afterward. + private let accountsFolder = FileManager.default.temporaryDirectory.appendingPathComponent("NetNewsWireTestAccounts") func createAccount(type: AccountType, username: String? = nil, password: String? = nil) -> Account { @@ -46,13 +46,8 @@ import Secrets account.deleteSettings() - do { - try FileManager.default.removeItem(atPath: account.dataFolder) - } catch let error as CocoaError where error.code == .fileNoSuchFile { - - } catch { - assertionFailure("Could not delete folder at: \(account.dataFolder) because \(error)") - abort() - } + // Cleanup failing is not a test failure, and aborting here would take every + // other test in the process down with it. + try? FileManager.default.removeItem(atPath: account.dataFolder) } }