Skip to content

Commit 9867dba

Browse files
committed
I was an idiot an removed the guard statement protecting creating a connection without credentials.
Also added guard to skip deconstruction of nil connection.
1 parent ebc2b30 commit 9867dba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Tests/SQLClientSwiftTests/SQLClientSwiftTests.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ final class SQLClientSwiftTests: XCTestCase {
2828
/// Centralises boilerplate setup making
2929
override func setUp() async throws {
3030
try super.setUpWithError()
31-
31+
guard canConnect else {
32+
throw XCTSkip("Set HOST, USERNAME, PASSWORD environment variables to run tests.")
33+
}
3234
client = try await makeClient()
35+
3336
}
3437

3538
/// Called after each XCTest method is run. Able to throw errors on cleanup.
3639
/// Ensures cleanup from each test is completed after the test is run. Before
3740
/// the next test is run.
3841
override func tearDown() async throws {
42+
guard client != nil else { return }
3943
try await client.disconnect()
4044
try await super.tearDown()
4145
}

0 commit comments

Comments
 (0)