Instance Method

tearDownWithError()

Provides an opportunity to perform cleanup and throw errors after each test method in a test case ends.

Declaration

func tearDownWithError() throws

Discussion

After each test completes, XCTest calls tearDown(), followed by tearDownWithError(). If state cleanup might throw errors, override tearDownWithError(). XCTest marks the test failed when when it catches errors, or skipped when it catches XCTSkip.

See Also

Setup and Teardown

func setUp()

Provides an opportunity to reset state before calling each test method in a test case.

func setUpWithError()

Provides an opportunity to reset state and throw errors before calling each test method in a test case.

func tearDown()

Provides an opportunity to perform cleanup after each test method in a test case ends.