Skip to content

Commit

Permalink
Merge pull request #30 from andreasley/fix-testfilecleanup
Browse files Browse the repository at this point in the history
Improve cleanup for database files after running tests
  • Loading branch information
marcoarment authored Aug 25, 2024
2 parents ea48c02 + 52cc7e9 commit d74a3e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tests/BlackbirdTests/BlackbirdTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ final class BlackbirdTestTests: XCTestCase, @unchecked Sendable {
}

override func tearDownWithError() throws {
if sqliteFilename != "", sqliteFilename != ":memory:", FileManager.default.fileExists(atPath: sqliteFilename) { try FileManager.default.removeItem(atPath: sqliteFilename) }
if sqliteFilename != "", sqliteFilename != ":memory:", FileManager.default.fileExists(atPath: sqliteFilename) {
for path in Blackbird.Database.allFilePaths(for: sqliteFilename) {
try? FileManager.default.removeItem(atPath: path)
}
}
}

// Use XCTAssert and related functions to verify your tests produce the correct results.
Expand Down

0 comments on commit d74a3e9

Please sign in to comment.