<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestCase/tearDown()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTestCase(cm)tearDown"
  },
  "title" : "tearDown()"
}
-->

# tearDown()

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

```
class func tearDown()
```

## Discussion

The [`tearDown()`](/documentation/XCTest/XCTestCase/tearDown()) class method is called exactly once for a test case, after its final test method completes. Override this method to perform any cleanup after all test methods have ended.

## See Also

[`tearDown()`](/documentation/XCTest/XCTest/tearDown())

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)